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 :
https://github.com/manishganvir/iOS-h264Hw-Toolbox
https://github.com/McZonk/VideoToolboxPlus
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With