<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 02 Nov 2015, at 11:22, Jean-Yves Avenard <<a href="mailto:jyavenard@gmail.com" class="">jyavenard@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class=""><br class="">Le vendredi 23 octobre 2015, Isaksson Jörgen <<a href="mailto:jogga@bitfield.se" class="">jogga@bitfield.se</a>> a écrit :<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br class="">
<br class="">
I’m new to this list so forgive me if this has been answered before.<br class="">
<br class="">
With version 2.8 of the libraries I saw the addition of Video Toolbox hardware decoding support (on Mac OS X that is).<br class="">
<br class="">
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 class="">
<br class="">
I have compiled version 2.8.1 of the libraries and I can confirm that the Video Toolbox hwaccels are there:<br class="">
<br class="">
Enabled hwaccels:<br class="">
h263_videotoolbox       mpeg1_videotoolbox      mpeg4_videotoolbox<br class="">
h264_videotoolbox       mpeg2_videotoolbox<br class="">
<br class="">
In my player app I have setup an AVVideotoolboxContext like described in the headers.<br class="">
<br class="">
if (self.codecContext->codec_id == AV_CODEC_ID_H264) {<br class="">
        _videoToolboxContext = av_videotoolbox_alloc_context();<br class="">
        int result = av_videotoolbox_default_init2(self.codecContext, self.videoToolboxContext);<br class="">
        if (result != 0) {<br class="">
            NSLog(@"Failed to init video toolbox");<br class="">
            _videoToolboxContext = NULL;<br class="">
        }<br class="">
 }<br class="">
<br class="">
_codec = avcodec_find_decoder(self.codecContext->codec_id);<br class="">
<br class="">
Everything seems to work fine and the _videoToolboxContext is properly allocated.<br class="">
<br class="">
But how do I go about actually decoding using it?<br class="">
<br class="">
Anyone with any experience from this?<br class=""><br class="">
</blockquote><div class="">VideoToolbox is for decoding only, just like VDA </div><div class=""><br class=""></div><div class="">From 10.9; to get HW decoding the only thing that needs to be set is a constant. And this is just a hint. Vat won't use HW for vertical resolution < 300 typically.</div><div class=""><br class=""></div><div class="">Note that ffmpeg doesn't enable async decoding, so the performance are poor, nowhere near as fast as what it could be.</div></div></blockquote><br class=""></div><div>And what is the constant that needs to be set and where?</div><div>Do you know if it’s still worth using it?</div><div>Will the decoding be faster than FFmpeg’s standard software decoding?</div><div><br class=""></div><div><br class=""></div><div>Thanks!</div><br class=""></body></html>