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

# sourceReadOnlyPixelBuffer(byTrackID:)

Returns the source CVReadOnlyPixelBuffer for the given track ID. If the track contains tagged buffers, a pixel buffer from one of the tagged buffers will be returned.

## Declaration

```swift
func sourceReadOnlyPixelBuffer(byTrackID trackID: CMPersistentTrackID) -> CVReadOnlyPixelBuffer?
```

## Parameters

- `trackID`: The track ID for the requested source frame.

## Return Value

Return Value The source CVReadOnlyPixelBuffer for the given track ID.

## See Also

### Accessing source data

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