Reputation: 952
I want to play a .H264
video file in iOS 8
with use of VideoToolbox.framework
and not with ffmpeg
library.
I have found few Tutorials + Reference links to understand VideoToolbox.framework
, but still couldn't find, "how to play .H264
in iOS
?".
Few Examples :
Reference Links :
https://developer.apple.com/library/mac/releasenotes/General/APIDiffsMacOSX10_8/VideoToolbox.html
https://developer.apple.com/videos/wwdc/2014/?include=513#513
Decoding H264 VideoToolkit API fails with Error -8971 in VTDecompressionSessionCreate
You can download a test (.H264) video for Testing from here.
Upvotes: 16
Views: 5670
Reputation: 162
It depends on what your trying to decode. If you have a File or valid end point. AVFoundation is what your looking for.
The VideoToolBox is for decoding video manually. Which is used in real-time streaming. For this case you will be required to parse the NAL units from each payload and follow this tutorial:
https://stackoverflow.com/a/29525001/2878935
Upvotes: 1
Reputation: 3362
VideoToolbox.framework
is not used to display video files on screen but rather for decoding and conversion of video data. Use AVKit.framework
or AVFoundation.framework
to play a H264 video instead.
See Apples documentation of the Media Layer:
The Video Toolbox framework comprises the 64-bit replacement for the QuickTime Image Compression Manager. Video Toolbox provide services for video compression and decompression, and for conversion between raster image formats stored in Core Video pixel buffers.
Upvotes: 1