The Video Toolbox framework (VideoToolbox.framework) includes direct access to hardware video encoding and decoding in iOS and OSX.
Questions tagged [video-toolbox]
117 questions
2
votes
1 answer
Decode an H264 stream using the VideoToolbox API (kVTVideoDecoderBadDataErr)
my goal is to encode the main framebuffer of my Windows machine using nvenc and stream its content to my iPad using the VideoToolbox API
The code I use to encode the h264 stream is basically a copy/paste of…

TheMode
- 21
- 1
- 1
- 5
2
votes
0 answers
VideoToolbox hardware encoder frame delay
Use-case:
I'm trying to encode a video stream in real-time with VideoToolbox hardware encoder for video streaming.
Issue:
The VTCompressionOutputCallback is being called only after 2 or more frames have been passed to the encoder. The last sent…

Tomek Gos
- 41
- 3
2
votes
0 answers
How to decode DRM protected content (FairPlay, WideVine etc) using Video ToolBox on iOS?
I have a custom player on iOS which can decode a HEVC stream using the HEVC decoder provided by the video toolbox, get the handle to the decoded frame, pass it to Metal and render the frame using Metal. I would like to do the same with DRM…

Anon90
- 21
- 1
2
votes
1 answer
ffmpeg build on mac with videotoolbox enabled becomes unportable
If i configure ffmpeg this way:
./configure --disable-everything --enable-static --disable-shared \
--enable-gpl --enable-nonfree --enable-encoder=h264_videotoolbox,aac \
--enable-muxer=mp4 --enable-protocol=file --enable-libfdk-aac…

Alexander Novikov
- 503
- 1
- 3
- 14
2
votes
0 answers
Writing encoded audio CMSampleBuffer not working
I'm using AudioConverter to convert uncompressed CMSampleBuffer being captured via AVCaptureSession to AudioBufferList:
let packetDescriptionsPtr = UnsafeMutablePointer.allocate(capacity:…

Grzegorz Aperliński
- 848
- 1
- 10
- 23
2
votes
1 answer
AVSampleBufferDisplayLayer plays too fast
So I have put together a sample project https://github.com/liuxuan30/TestH264.git that uses VideoToolBox to have a H264 sample decoder to display a stream file, captured from a camera.
The H264 decoder using VideoToolBox is copied from internet, I…

Wingzero
- 9,644
- 10
- 39
- 80
2
votes
2 answers
How to convert AudioBufferList containing AAC data to CMSampleBuffer
I'm using AudioConverter to convert uncompressed CMSampleBuffer being captured via AVCaptureSession to AudioBufferList:
let status: OSStatus = AudioConverterFillComplexBuffer(
converter,
inputDataProc,
…

Grzegorz Aperliński
- 848
- 1
- 10
- 23
2
votes
1 answer
Referencing `self` from within a VTCompressionOutputCallback
I'm currently trying to use VideoToolbox to encode video data from an AVCaptureVideoDataOutput, but I'm having an issue referencing self from within the VTCompressionOutputCallback.
My code is as follows:
...
var sessionRef:…

RPK
- 1,830
- 14
- 30
2
votes
0 answers
Filtering a video stream using GPUImage2
I have access to the CVPixelBufferRef for each frame and want to apply the ChromaKey filter to it before rendering it.
So far, the only solution I can think of is to first convert the pixel buffer to an image. Here is my barebones solution just for…

Zia
- 14,622
- 7
- 40
- 59
2
votes
0 answers
macOS VTCompressionSession: how do I control JPEG chroma subsampling mode? (YUV 4:2:0)
For our current project, we've got a sequence of image frames being generated, which, after some processing, we need to compress in real time with some codec and send over the network. The first implementation needs to use JPEG, although apparently…

pmdj
- 22,018
- 3
- 52
- 103
2
votes
1 answer
H264 encoding and decoding using Videotoolbox
I was testing the encoding and decoding using videotoolbox, to convert the captured frames to H264 and using that data to display it in AVSampleBufferdisplayLayer.
error here while decompress CMVideoFormatDescriptionCreateFromH264ParameterSets with…

Navaneeth A S
- 69
- 9
2
votes
0 answers
Mux elementary streams to transport stream
I am using VideoToolbox on iOS to encode video from iPhone camera. In the callback for the compressed frames I convert from AVCC to Annex B. The result is transport stream which I can successfully play back in VLC if I save it in a .264 file. This…

sigrem
- 57
- 1
- 5
2
votes
1 answer
Decoding H264: VTDecompressionSessionCreate fails with error code -12910 (kVTVideoDecoderUnsupportedDataFormatErr)
I'm getting error -12910 (kVTVideoDecoderUnsupportedDataFormatErr) using VTDecompressionSessionCreate when running code on my iPad, but not on the sim. I'm using Avios (https://github.com/tidwall/Avios) and this is the relevant section:
private func…

HughHughTeotl
- 5,439
- 3
- 34
- 49
2
votes
1 answer
H.264 : VTDecompressionSessionDecodeFrame fails with code 12909
I'm displaying RTSP streams from IP cameras. I want to replace this method avcodec_decode_video2 with VideoToolbox framework. I'm kinda new with video data processing so I'm a little lost...
I've tested both solutions from here and here, but I end…

pyonpyon
- 66
- 9
2
votes
1 answer
Bitrate is not getting limited for H.264 HW accelerated encode on iOS using the VideoToolbox API
Bitrate is not getting limited for H.264 HW accelerated encode on iOS using the VideoToolbox API with property kVTCompressionPropertyKey_AverageBitRate.
It is observed that the bitrate is shooting upto 4mbps(for both 1280x780, 640x360) at times for…

user1619571
- 51
- 4