---
title: AVPlayerItemSampleBufferOutput
framework: avfoundation
role: symbol
role_heading: Class
path: avfoundation/avplayeritemsamplebufferoutput
---

# AVPlayerItemSampleBufferOutput

AVPlayerItemSampleBufferOutput delivers CMSampleBuffers for AVPlayerItem playback.

## Declaration

```swift
class AVPlayerItemSampleBufferOutput
```

## Overview

Overview Playback only happens when the AVPlayerItem is the current item of its AVPlayer. Create an AVPlayerItemSampleBufferOutput with a AVPlayerItemSampleBufferOutputAudioConfiguration to configure it to deliver CMSampleBuffers containing the decoded audio, and attach it to the AVPlayerItem using -[AVPlayerItem addOutput:]; the audio will be in the format specified by the configuration object’s requestedAudioFormat. Note that AVPlayerItemSampleBufferOutput may be used to pull CMSampleBuffers far ahead of the current play time.  Practical use requires clients to monitor the item timebase time, and pause pulling when they have received CMSampleBuffers sufficient to prepare for near-term-future playback or processing. Marker-only CMSampleBuffers may be among those returned; you can detect and skip these by testing whether CMSampleBufferGetNumSamples(sampleBuffer) == 0. The output CMSampleBuffers will have appropriate OutputPresentationTimeStamps for playback, but beyond that, synchronizing presentation to the AVPlayerItem’s timebase is entirely up to the client. Currently supported for HLS AVPlayerItems only, and only for delivering decoded PCM audio.

## Topics

### Creating a sample buffer output

- [init(configuration:)](avfoundation/avplayeritemsamplebufferoutput/init(configuration:).md)

### Retrieving sample buffers

- [nextAvailableSampleBuffer()](avfoundation/avplayeritemsamplebufferoutput/nextavailablesamplebuffer().md)
- [nextSampleBuffer()](avfoundation/avplayeritemsamplebufferoutput/nextsamplebuffer().md)
- [AVPlayerItemSampleBufferOutput.SampleBufferInSequence](avfoundation/avplayeritemsamplebufferoutput/samplebufferinsequence.md)

## Relationships

### Inherits From

- [AVPlayerItemOutput](avfoundation/avplayeritemoutput.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Media output

- [AVPlayerVideoOutput](avfoundation/avplayervideooutput.md)
- [AVVideoOutputSpecification](avfoundation/avvideooutputspecification.md)
- [AVPlayerItemOutput](avfoundation/avplayeritemoutput.md)
- [AVPlayerItemVideoOutput](avfoundation/avplayeritemvideooutput.md)
- [AVPlayerItemLegibleOutput](avfoundation/avplayeritemlegibleoutput.md)
- [AVPlayerItemRenderedLegibleOutput](avfoundation/avplayeritemrenderedlegibleoutput.md)
- [AVRenderedCaptionImage](avfoundation/avrenderedcaptionimage.md)
- [AVPlayerItemMetadataOutput](avfoundation/avplayeritemmetadataoutput.md)
- [AVPlayerItemOutputPushDelegate](avfoundation/avplayeritemoutputpushdelegate.md)
- [AVPlayerItemSampleBufferOutputConfiguration](avfoundation/avplayeritemsamplebufferoutputconfiguration.md)
- [AVPlayerItemSampleBufferOutputAudioConfiguration](avfoundation/avplayeritemsamplebufferoutputaudioconfiguration.md)
