<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>hamidi, there are definitely some problems getting it to use the hardware decoder. For us we have such a problem on iOS builds.</div><div><br class=""></div><div>We have to use code something like this to be sure it finds a hardware decoder ...</div><div><br class=""></div><div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22); background-color: rgb(255, 255, 255);" class=""><span style="color: #643820" class="">#include </span><libavcodec/videotoolbox.h></div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="color: #aa0d91" class="">static</span> <span style="color: #aa0d91" class="">enum</span> <span style="color: #3f6e74" class="">AVPixelFormat</span> find_pixel_format(<span style="color: #aa0d91" class="">struct</span> <span style="color: #3f6e74" class="">AVCodecContext</span> *s, <span style="color: #aa0d91" class="">const</span> <span style="color: #aa0d91" class="">enum</span> <span style="color: #3f6e74" class="">AVPixelFormat</span> *fmt) {</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">    <span style="color: #aa0d91" class="">while</span> (*fmt != <span style="color: #26474b" class="">AV_PIX_FMT_NONE</span>) {</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; color: rgb(38, 71, 75); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class="">        </span><span style="color: #aa0d91" class="">if</span><span style="color: #000000" class=""> (*fmt == </span>AV_PIX_FMT_VIDEOTOOLBOX<span style="color: #000000" class="">) {</span></div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">            <span style="color: #aa0d91" class="">if</span> (s-><span style="color: #3f6e74" class="">hwaccel_context</span> == <span style="color: #aa0d91" class="">NULL</span>) {</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">                <span style="color: #aa0d91" class="">int</span> result = <span style="color: #26474b" class="">av_videotoolbox_default_init</span>(s);</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">                <span style="color: #aa0d91" class="">if</span> (result < <span style="color: #1c00cf" class="">0</span>) {</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class="">                <span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #2e0d6e" class="">printf</span><span style="color: #000000" class="">(</span>"       the 'SPS/PPS problem' has happened.\n"<span style="color: #000000" class="">);</span></div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class="">                <span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #2e0d6e" class="">printf</span><span style="color: #000000" class="">(</span>"       you are NOT getting hardware decoding on this stream.\n"<span style="color: #000000" class="">);</span></div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">                    <span style="color: #aa0d91" class="">return</span> s-><span style="color: #3f6e74" class="">pix_fmt</span>;</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">                }</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">                <span style="color: #aa0d91" class="">else</span> {</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; color: rgb(196, 26, 22); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class="">                <span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #2e0d6e" class="">printf</span><span style="color: #000000" class="">(</span>"       the test was OK....\n"<span style="color: #000000" class="">);</span></div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">                }</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">            }</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">            <span style="color: #aa0d91" class="">return</span> *fmt;</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">        }</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">        ++fmt;</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">    }</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">    <span style="color: #aa0d91" class="">return</span> s-><span style="color: #3f6e74" class="">pix_fmt</span>;</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">}</div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 15px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div></div><div>the problem seems to relate to finding the SPS/PPS information on a variety of sources</div><div>see,</div><div><br class=""></div><div><a href="https://stackoverflow.com/q/25787347/294884" class="">https://stackoverflow.com/q/25787347/294884</a></div><div><br class=""></div><div>a couple yrs ago there was a patch on the 264 problem (which I think was not incorporated..)</div><div><br class=""></div><div><a href="https://ffmpeg.org/pipermail/ffmpeg-devel/2016-June/194842.html" class="">https://ffmpeg.org/pipermail/ffmpeg-devel/2016-June/194842.html</a></div><div><br class=""></div><div>we really have not been able to solve the issue in the 265 case.</div><div><br class=""></div><div>If this info is relevant to your case, I hope it helps …</div><div><br class=""></div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 30, 2019, at 7:58 AM, hamidi <<a href="mailto:hamidi@gmail.com" class="">hamidi@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I got the latest version binaries of ffmpeg from <a href="https://ffmpeg.zeranoe.com/builds/" target="_blank" class="">here</a>.
 When I examine CPU and GPU usages when I play a video by its ffplay, I 
see that GPU is used during play. Not much using of CPU also indicates 
it. But when I get the latest version sources from the original site, I 
can't use GPU. ….</div></div></blockquote><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><br class=""></body></html>