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
0
votes
1 answer
CVBuffer is nil in call back of h264 decoder
When i try to decode the raw h264 stream , CVBuffer gives me nil on callback, and this only happen on the real device(iPhone , iPad) and not on the simulator.
Any suggestions?!

LeoNard
- 230
- 1
- 9
0
votes
1 answer
Scale CMSampleBuffer Size Without Passing the Memory Limit Of Broadcast Extension
I am developing an app that sends pixel buffers from the Broadcast Upload Extension to OpenTok. When I run my broadcast extension it hits its memory limit in seconds. I have been looking for ways to reduce the size and scale of CMSampleBuffers and…

Mehmet Baykar
- 367
- 3
- 11
0
votes
1 answer
VideoToolbox HEVC decoding failing for iOS14 on device
So while I'm sure I'm not about to provide enough info for anyone to fix my specific code, what I am itching to know is this:
Does anyone know what might have happened to iOS14 to change HEVC decoding requirements??
I have a decoder built using…

Mete
- 5,495
- 4
- 32
- 40
0
votes
1 answer
NVIDIA NVENC (Media Foundation) encoded h.264 frames not decoded properly using VideoToolbox
I am facing the same problem as described here when trying to decode a frame on iPad Pro OS v14.3 (I am also using Olivia Stork's example):
25% of the picture data is decoded correctly, the rest of the picture is just green.
The decoded image on…

RobX
- 51
- 4
0
votes
0 answers
Getting NALU from H.264 RTSP-Stream with FFmpeg and VideoToolbox in Swift
Im very new to video processing and now I am stuck decoding my H.264 RTSP-Stream with FFmpeg and VideoToolbox in Swift.
Currently I am a bit overwhelmed extracting sps and pps
-> Where are they stored? I have the following options getting data
-…

Chris
- 227
- 2
- 16
0
votes
2 answers
Is it possible to control the conversion of RGB to YUV matrix in VideoToolBox?
I found that different Iphone hardware encoders have different matrices for converting input RGB to YUV.That is, in the function OSStatus VTCompressionSessionEncodeFrame(VTCompressionSessionRef session, CVImageBufferRef imageBuffer, CMTime…

马学睿
- 1
- 4
0
votes
0 answers
Instance member x cannot be used on type y
I have been trying to make a compression callback which sends the compressed data to a different part of the process, but when I put the line to send the data I get back this error
Instance member 'ptManager' cannot be used on type…

Asra
- 151
- 1
- 11
0
votes
0 answers
How do you Apply H.264 Compression to a CMSampleBuffer
I have been trying to apply H.264 encoding to a CMSampleBuffer using VideoToolBox in Swift, I am very new to Swift and do not know how to do this if the compression turns the CMSampleBuffer into a CVPixelBuffer that is fine too as I need to turn it…

Asra
- 151
- 1
- 11
0
votes
2 answers
AddressSanitizer: heap-use-after-free only on Release archive
I have created an example of my class: https://github.com/ChoadPet/H.264-Decoding
When I build my application with DEBUG configuration everything is working fine, but when I archive RELEASE it's crashing on this line:
let status =…

vpoltave
- 1,612
- 3
- 14
- 31
0
votes
1 answer
Video Tool Box. pixel transfer, when to release source buffer?
One simple straight question, when to release source pixelbuffer after transferred image to avoid crash:
//pixel_buffer is the original
CVPixelBufferCreate(kCFAllocatorDefault,
CVPixelBufferGetWidth(pixel_buffer),
…

Steven
- 468
- 4
- 14
0
votes
0 answers
Analyze frames colors displayed in AVSampleBufferDisplayLayer. Image Buffer is nil
I want to analyze colors displayed in AVSampleBufferDisplayLayer which gets frames from the data source which I don't control.
I've made my own subclass of this class and override func enqueue(_ sampleBuffer: CMSampleBuffer) to get my hands on…

msmialko
- 1,439
- 2
- 20
- 35
0
votes
1 answer
iOS Swift VideoToolBox decompress frame EXC_BAD_ADDRESS error
I was trying to convert CMSampleBuffer to Data over the internet and create a copy of that.I already compressed the camera capture's CMSampleBuffer by VTCompressionSession with h264.Now I constructed CMSampleBuffer, created VTDecompressionSession…

user9855122
- 21
- 3
0
votes
1 answer
Decompressed error: Error Domain=NSOSStatusErrorDomain Code=-12909
I am using H264 algorithm below is the link which I am referring to decompress video using VideoToolbox framework
https://stackoverflow.com/a/29525001/1679255
Not all a few videos are stuck in a specific position.
Below is the error logs which i…

Mohammed Ebrahim
- 849
- 1
- 12
- 22
0
votes
1 answer
iOS 13.1.3 VTDecompressionSessionDecodeFrame can't decode right
CVPixelBufferRef outputPixelBuffer = NULL;
CMBlockBufferRef blockBuffer = NULL;
void* buffer = (void*)[videoUnit bufferWithH265LengthHeader];
OSStatus status = CMBlockBufferCreateWithMemoryBlock(kCFAllocatorDefault,
…

Lara Wang
- 1
- 2
0
votes
0 answers
kVTCompressionPropertyKey_DataRateLimits property not being respected by hardware encoder, macOS
I am working on a macOS project that uses hardware acceleration for video encoding, using VideoToolbox. I have tried controlling the bitrate using kVTCompressionPropertyKey_AverageBitRate and kVTCompressionPropertyKey_DataRateLimits, but after many…

LarryW
- 89
- 9