---
title: "sourceFrame(byTrackID:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avasynchronousvideocompositionrequest/sourceframe(bytrackid:)"
---

# sourceFrame(byTrackID:)

Returns a source pixel buffer for the track that contains the specified identifier.

## Declaration

```swift
func sourceFrame(byTrackID trackID: CMPersistentTrackID) -> CVPixelBuffer?
```

## Parameters

- `trackID`: The identifier of the track that contains the source frame.

## Return Value

Return Value A pixel buffer, or nil if not found.

## See Also

### Accessing source data

- [attach(_:to:)](avfoundation/avasynchronousvideocompositionrequest/attach(_:to:).md)
- [sourceReadOnlyPixelBuffer(byTrackID:)](avfoundation/avasynchronousvideocompositionrequest/sourcereadonlypixelbuffer(bytrackid:).md)
- [sourceReadySampleBuffer(byTrackID:)](avfoundation/avasynchronousvideocompositionrequest/sourcereadysamplebuffer(bytrackid:).md)
- [sourceSampleBuffer(byTrackID:)](avfoundation/avasynchronousvideocompositionrequest/sourcesamplebuffer(bytrackid:).md)
- [sourceSampleDataTrackIDs](avfoundation/avasynchronousvideocompositionrequest/sourcesampledatatrackids-3yiab.md)
- [sourceTaggedDynamicBuffers(byTrackID:)](avfoundation/avasynchronousvideocompositionrequest/sourcetaggeddynamicbuffers(bytrackid:).md)
- [sourceTimedMetadata(byTrackID:)](avfoundation/avasynchronousvideocompositionrequest/sourcetimedmetadata(bytrackid:).md)
- [sourceTrackIDs](avfoundation/avasynchronousvideocompositionrequest/sourcetrackids.md)
