<div dir="ltr">Take a look at the <a href="https://www.ffmpeg.org/doxygen/2.4/examples.html">examples</a> that come with ffmpeg, specifically the decoding_encoding.c example: <a href="https://www.ffmpeg.org/doxygen/2.4/decoding_encoding_8c-example.html">https://www.ffmpeg.org/doxygen/2.4/decoding_encoding_8c-example.html</a><div><br></div><div>There are also the tutorials by dranger which can be helpful: <a href="http://dranger.com/ffmpeg/ffmpeg.html">http://dranger.com/ffmpeg/ffmpeg.html</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 22, 2015 at 10:50 AM, Isaksson Jörgen <span dir="ltr"><<a href="mailto:jogga@bitfield.se" target="_blank">jogga@bitfield.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I’m new to this list so forgive me if this has been answered before.<br>
<br>
With version 2.8 of the libraries I saw the addition of Video Toolbox hardware decoding support (on Mac OS X that is).<br>
<br>
But I can’t find much documentation on how to use it. There are some clues in the header files on how to set it up, but there’s no docs on how to do the actual decoding.<br>
<br>
I have compiled version 2.8.1 of the libraries and I can confirm that the Video Toolbox hwaccels are there:<br>
<br>
Enabled hwaccels:<br>
h263_videotoolbox       mpeg1_videotoolbox      mpeg4_videotoolbox<br>
h264_videotoolbox       mpeg2_videotoolbox<br>
<br>
In my player app I have setup an AVVideotoolboxContext like described in the headers.<br>
<br>
if (self.codecContext->codec_id == AV_CODEC_ID_H264) {<br>
        _videoToolboxContext = av_videotoolbox_alloc_context();<br>
        int result = av_videotoolbox_default_init2(self.codecContext, self.videoToolboxContext);<br>
        if (result != 0) {<br>
            NSLog(@"Failed to init video toolbox");<br>
            _videoToolboxContext = NULL;<br>
        }<br>
 }<br>
<br>
_codec = avcodec_find_decoder(self.codecContext->codec_id);<br>
<br>
Everything seems to work fine and the _videoToolboxContext is properly allocated.<br>
<br>
But how do I go about actually decoding using it?<br>
<br>
Anyone with any experience from this?<br>
<br>
best regards / Jörgen Isaksson<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</blockquote></div><br></div>