Environment
- OS-X
- Yosemite
- Objective-C
- Compressed video input ( AVCaptureDeviceFormat == 'muxx'/'isr ' )
Use-case
Compressed video stream is exposed to the OS as a HAL capture device ( AVCaptureDevice ) supporting the 'muxx/isr ' payload format, I would like to be able to directly access the raw bytes of the compressed payload w/o decompressing.
Implementation
- Find the device using "+ (AVCaptureDevice *)deviceWithUniqueID:(NSString *)deviceUniqueID"
- Create 'AVCaptureDeviceInput'
- Create 'AVCaptureVideoDataOutput'
- Associate the 'AVCaptureDevice' with 'AVCaptureDeviceInput'
- setSampleBufferDelegate on 'AVCaptureVideoDataOutput'
- Create AVCaptureSession
- Configure the session by adding inputs and outputs ( no preset is selected )
- start the session by calling [session startRunning]
- Upon 'AVCaptureVideoDataOutputSampleBufferDelegate' invocation call 'CMSampleBufferGetDataBuffer(sampleBuffer);' to get a reference to the RAW buffer
Problem description
While the delegate is invoked by the system the buffers I get refer to a decoded yuy2 image rather than to the compressed buffer ( before it was de-muxed and de-coded ), and thus, 'CMSampleBufferGetDataBuffer' returns a nil pointer.