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

# sourceSampleBuffer(byTrackID:)

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

## Declaration

```swift
func sourceSampleBuffer(byTrackID trackID: CMPersistentTrackID) -> CMSampleBuffer?
```

## Parameters

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

## Return Value

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

## See Also

### Accessing source data

- [attach(_:to:)](avfoundation/avasynchronousvideocompositionrequest/attach(_:to:).md)
- [sourceFrame(byTrackID:)](avfoundation/avasynchronousvideocompositionrequest/sourceframe(bytrackid:).md)
- [sourceReadOnlyPixelBuffer(byTrackID:)](avfoundation/avasynchronousvideocompositionrequest/sourcereadonlypixelbuffer(bytrackid:).md)
- [sourceReadySampleBuffer(byTrackID:)](avfoundation/avasynchronousvideocompositionrequest/sourcereadysamplebuffer(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)
