Questions tagged [video-toolbox]

The Video Toolbox framework (VideoToolbox.framework) includes direct access to hardware video encoding and decoding in iOS and OSX.

117 questions
1
vote
0 answers

Can't decompress H.264 frames with VideoToolbox when hardcoding PPS and SPS parameters

I wrote a H.264 decoder that works great. However for performance reasons, I'm trying to hard code in the PPS and SPS parameters (they never change). For reference this is what they look like as a base 10 [UInt8]: SPS [103, 66, 0, 40, 244, 5, 1,…
Philip S
  • 502
  • 6
  • 18
1
vote
1 answer

-12909 error decoding h264 stream with intra-refresh

I'm making an iOS app that decodes an h264 stream using video-toolbox. I create the stream with ffmpeg on a PC and send it to an iPhone using RTP. It's working nicely when I use this command to create it: ffmpeg -y -f:v rawvideo -c:v rawvideo -s…
ciclopez
  • 128
  • 1
  • 8
1
vote
0 answers

AVAssetReader , call method " startReading " fail ,return NO, Error Domain=AVFoundationErrorDomain Code=-11841 (AVErrorInvalidVideoComposition)

I read a MP4 video, frame by frame, so I use AVAssetReader , it always work ok, but 1/100 probability fail in "startReading" method. Error Domain=AVFoundationErrorDomain Code=-11841 (AVErrorInvalidVideoComposition) - (void)test{ self.reader =…
Roger
  • 11
  • 3
1
vote
1 answer

How to adjust properties in Videotoolbox?

I'm now using Videotoolbox to deal with h.264 encoding. And I found a sample code and it works fine : #define VTB_HEIGHT 480 #define VTB_WIDTH 640 int bitRate = VTB_WIDTH * VTB_HEIGHT * 3 * 4 * 8; CFNumberRef bitRateRef =…
scchn
  • 315
  • 3
  • 16
1
vote
1 answer

Is there a way to make VTDecompressionSession decode H264 when app in background mode?

Is there a way to make VTDecompressionSession decode H264 when app in background mode?
1
vote
0 answers

How to enable H.264 Single NALU mode on video toolbox on iOS?

I am trying to configure the video toolbox encoder on iOS 10 (iPhone 6) to enable Single NALU mode for H.264. The default mode seems to be Non-Interleaved Mode where payload type of 28 (FU-A) is always used. From the Apple Developer API reference,…
radium22
  • 155
  • 1
  • 9
1
vote
1 answer

CMBlockBuffer ownership in CMSampleBuffer

I'm writing code to decompress a native annex-B H.264 stream, and I'm going through the process of parsing the stream, creating a CMVideoFormatDescription from the SPS/PPS NALUs, and wrapping the other NALUs I extract from the stream in…
Jim B.
  • 4,512
  • 3
  • 25
  • 53
1
vote
0 answers

VideoToolbox does not create an encoder session for mpeg4 in Swift 3.0

I`ve catch a problem to create a compression session for the MPEG4 encoder with VideoToolbox after migration on Swift 3.0. Before the migration it worked fine. Here is my upgraded code: let imageAttributes:[NSString: AnyObject] = [ …
JULIIncognito
  • 1,875
  • 2
  • 15
  • 15
1
vote
1 answer

Can VideoToolbox decode H264 Annex B natively? Error Code -8969 BadData

My goal is to mirror the screen of an iDevice to OSX, as lag-free as possible. To my knowledge there are 2 ways to this: Airplay Mirroring (e.g. Reflector) CoreMediaIO via Lightning (e.g. Quicktime Recording) I have chosen to pursue the second…
Guillane
  • 48
  • 6
1
vote
1 answer

How to hardcode a MP4 stream file with iOS VideoToolbox and FFMPEG?

Guys! I have found a demo in github that is :-VideoToolboxDemo. And I also found a question in stackoverflow how-to-use-videotoolbox-to-decompress-h-264-video-stream which someone has implemented in github:https:/ /github.com/lileilei1119/VTDemo But…
Kim Jin
  • 180
  • 1
  • 8
1
vote
1 answer

How to combine nalus from one frame into one nalu?

In my situation, iOS HW encoder sometimes generates one nalu and other times generates two nalus which make up the access-unit/picture. When two nalus were generated for one picture, I combine them two by replacing the first nalu's start code with…
1
vote
1 answer

VTCompressionSessionCreate works on iOS 9 but not on iOS 8

These simple lines of code (nothing else whatsoever in the app) work fine on iOS 9 (iPhone 6 and iPhone 4S), but not on iOS 8 (iPhone 5 and iPod Touch 5G): VTCompressionSessionRef videoEncoder; OSStatus err = VTCompressionSessionCreate(NULL, 1920,…
Guy Moreillon
  • 993
  • 10
  • 28
1
vote
1 answer

Dose all H.264 video stream can be decompressed using Video Toolbox in iOS 8?

I met some h.264 video files which show large area of green on the screen without any error when decoding using Video Toolbox while I can decode most other h.264 video files successfully.
1
vote
1 answer

Getting Compression status as -12902(kVTParameterErr) in output callback from iOS Hardware acceleration encode using video toolbox

I try using CVPixelBufferCreateWithPlanarBytes. I do not see any error returned by CVPixelBufferCreateWithPlanarBytes, VTCompressionSessionEncodeFrame. But the output callback gives an error kVTParameterErr. All the parameters for all the API s…
1
vote
0 answers

AVSampleBufferDisplayLayer pixelated and laggy

I'm attempting to use AVSampleBufferDisplayLayer coupled with ffmpeg to play a network stream on iOS. I've gotten the video to show up with help of How to use VideoToolbox to decompress H.264 video stream. However, when there's a lot of motion in…