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
2 answers
AVSampleBufferDisplayLayer with VTDecompressionSession
I've been struggling with AVSampleBufferDisplayLayer being really choppy with a lot of motion. When there was motion in my live stream, it would be come pixelated and half frozen with multiple frames displaying at once. However, once I added the…

user1784317
- 41
- 4
2
votes
1 answer
OSX, VideoToolbox, Compression Session
Environment
OSX Yosemite
xcode 6.4
C++
Use-case
Given a h264 GOP consisting of a single Key-Frame and multiple corresponding Delta Frames, decode the GOP, and then, encode a single 4.2Mbit Key-frame
Problem description
I am able to decode the GOP…

NadavRub
- 2,520
- 27
- 63
2
votes
1 answer
How to set bitrate for VTCompressionSession
I'm working on moving our application from some proprietary codec to iOS native h264 encoder (VideoToolbox.framework) and have question:
Is there exists way to set bitrate or datarate for compressed data ?
Here is how I creating encoder session:…

sage444
- 5,661
- 4
- 33
- 60
1
vote
0 answers
Problem in decoding h264 raw frame in swift
I try to decode an inputstream of [UInt8] to h264 video , I have search the whole web and read the beautiful detailed answer of olivia How to use VideoToolbox to decompress H.264 video stream , I tried to convert her objc answer to swift but it…

LeoNard
- 230
- 1
- 9
1
vote
1 answer
Decoding ProresRAW format to native bayer representation
I am trying to decode Prores video file But it doesn't work. I always got
Optional(Error Domain=AVFoundationErrorDomain Code=-11821 "Cannot Decode" UserInfo={NSLocalizedFailureReason=The media data could not be decoded. It may be damaged.,…

JaSHin
- 211
- 2
- 16
- 43
1
vote
1 answer
EXC_BAD_ACCESS when trying to pass and read UnsafeMutableRawPointer through VTDecompressionSessionDecodeFrame
I think this is more a pointer question than a VideoToolbox session. I'm trying to do something similar to How to calculate FPS of Hardware Decode on iOS 8 exactly? and pass some metadata through VTDecompressionSessionDecodeFrame's…

LLooggaann
- 425
- 1
- 4
- 16
1
vote
1 answer
H264 Decoding with Apple Video Toolkit
I am trying to get an H264 streaming app working on various platforms using a combination of Apple Video Toolbox and OpenH264. There is one use-case that doesn't work and I can't find any solution. When the source uses video Toolbox on a 2011 iMac…

Nelroy
- 41
- 4
1
vote
1 answer
How to fix 'OSStatus' is ambiguous without more context when using VTCompressionSessionEncodeFrame
I have been trying to use VTCompressionSessionEncodeFrame to encode some CMSampleBuffers, but when I try to use it I always get this error: Expression type 'OSStatus' (aka 'Int32') is ambiguous without more context
I have tried to find out what it…

Asra
- 151
- 1
- 11
1
vote
0 answers
IOS VideoToolbox insert pic_timing sei message?
I have a trouble with AWS Medialive. I can't insert NALU: pic_timing SEI message (D.1.2 of ISO/IEC 14496-10-2005) into data and send to RTMP link.
I'm stumped. I couldn't find the answer AWS or Apple document.
Thanks for your help.

Đặng Nguyên Vũ
- 11
- 2
1
vote
0 answers
EXC_BAD_ACCESS occurs on H264 encoding CMSampleBuffer
Trying to convert a CMSampleBuffer to H264 encoded data
aQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0);
- (void) encode:(CMSampleBufferRef )sampleBuffer
{
dispatch_sync(aQueue, ^{
self->frameCount++;
…

Aravind G S
- 392
- 3
- 17
1
vote
1 answer
Synthesize SPS and PPS for incomplete H264 stream for iOS VideoToolbox
I have an AXIS IP camera (M1054) which sends an H264/RTP stream via RTSP.
Unfortunately, they do not send SPS and PPS NALUs at all, they only transfer (fragmented) Codec slices.
I'm trying to decode that stream with the iOS VideoToolbox framework…

DrMickeyLauer
- 4,455
- 3
- 31
- 67
1
vote
0 answers
FFMPEG h264_videotoolbox output is strange
I want to use h264_videotoolbox codec to encode my video in FFMPEG lib.I input image format is AV_PIX_FMT_YUV420P, but output video frame like follow.
I tried libx264 and all work correctly.
Do you guys know what happen?Why encoded frame like…

Yang Chen
- 55
- 11
1
vote
1 answer
How to reduce Android hw video decoding latency? 30ms for H264 720p?
I am trying to test if it is possible to use HW docoding for realtime communication, say 100ms for 720p client to client delay, 40ms for system delay and 60ms for network, iOS with VT is already OK.
When I tried it with AMediaCodec, it looks like…

Wanpeng
- 39
- 3
1
vote
1 answer
H.265 (HEVC) Decoding on iOS - what is the correct NALU order before frames can be decoded
I recently got HEVC / H.265 decoding working using VideoToolbox api in iOS. The incoming RTP stream came from FFMPEG using the x265 codec in libx265.
After much tinkering, I created my CMFormatDescription using the incoming VPS, SPS and PPS nalus -…

John M
- 327
- 3
- 14
1
vote
1 answer
How encode video using hevc/h265 codec via ffmpeg OSX
I try to encode video using hevc codec
./ffmpeg -i 1234.mp4 -vcodec hevc_videotoolbox -vb 1000k -acodec aac -ab 192k -sn 2.mp4
error:
[hevc_videotoolbox @ 0x7fc681813a00] Error: cannot create compression session: -12908
[hevc_videotoolbox @…

Eugenie
- 131
- 1
- 2
- 11