<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Thanks JP May for replying. Your response seems too expert for me. I'm too newbie in FFMpeg and Libav materials. Although I'll try to find the meanings of your text, I've to get close to it step by step. Please accept me to ask more questions in each step.<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">Thanks<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 30, 2019 at 7:22 PM JP May <<a href="mailto:jpm@smhk.com">jpm@smhk.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><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></div><div>We have to use code something like this to be sure it finds a hardware decoder ...</div><div><br></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)"><span style="color:rgb(100,56,32)">#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)"><span style="color:rgb(170,13,145)">static</span> <span style="color:rgb(170,13,145)">enum</span> <span style="color:rgb(63,110,116)">AVPixelFormat</span> find_pixel_format(<span style="color:rgb(170,13,145)">struct</span> <span style="color:rgb(63,110,116)">AVCodecContext</span> *s, <span style="color:rgb(170,13,145)">const</span> <span style="color:rgb(170,13,145)">enum</span> <span style="color:rgb(63,110,116)">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)">    <span style="color:rgb(170,13,145)">while</span> (*fmt != <span style="color:rgb(38,71,75)">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)"><span style="color:rgb(0,0,0)">        </span><span style="color:rgb(170,13,145)">if</span><span style="color:rgb(0,0,0)"> (*fmt == </span>AV_PIX_FMT_VIDEOTOOLBOX<span style="color:rgb(0,0,0)">) {</span></div><div style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">            <span style="color:rgb(170,13,145)">if</span> (s-><span style="color:rgb(63,110,116)">hwaccel_context</span> == <span style="color:rgb(170,13,145)">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)">                <span style="color:rgb(170,13,145)">int</span> result = <span style="color:rgb(38,71,75)">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)">                <span style="color:rgb(170,13,145)">if</span> (result < <span style="color:rgb(28,0,207)">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)"><span style="color:rgb(0,0,0)">                <span class="gmail-m_7213630691655716918Apple-tab-span" style="white-space:pre-wrap">   </span></span><span style="color:rgb(46,13,110)">printf</span><span style="color:rgb(0,0,0)">(</span>"       the 'SPS/PPS problem' has happened.\n"<span style="color:rgb(0,0,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)"><span style="color:rgb(0,0,0)">                <span class="gmail-m_7213630691655716918Apple-tab-span" style="white-space:pre-wrap"> </span></span><span style="color:rgb(46,13,110)">printf</span><span style="color:rgb(0,0,0)">(</span>"       you are NOT getting hardware decoding on this stream.\n"<span style="color:rgb(0,0,0)">);</span></div><div style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">                    <span style="color:rgb(170,13,145)">return</span> s-><span style="color:rgb(63,110,116)">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)">                }</div><div style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">                <span style="color:rgb(170,13,145)">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)"><span style="color:rgb(0,0,0)">                <span class="gmail-m_7213630691655716918Apple-tab-span" style="white-space:pre-wrap">        </span></span><span style="color:rgb(46,13,110)">printf</span><span style="color:rgb(0,0,0)">(</span>"       the test was OK....\n"<span style="color:rgb(0,0,0)">);</span></div><div style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">                }</div><div style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">            }</div><div style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">            <span style="color:rgb(170,13,145)">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)">        }</div><div style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">        ++fmt;</div><div style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">    }</div><div style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)">    <span style="color:rgb(170,13,145)">return</span> s-><span style="color:rgb(63,110,116)">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)">}</div><div style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><br></div><div style="margin:0px;font-stretch:normal;font-size:15px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><br></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></div><div><a href="https://stackoverflow.com/q/25787347/294884" target="_blank">https://stackoverflow.com/q/25787347/294884</a></div><div><br></div><div>a couple yrs ago there was a patch on the 264 problem (which I think was not incorporated..)</div><div><br></div><div><a href="https://ffmpeg.org/pipermail/ffmpeg-devel/2016-June/194842.html" target="_blank">https://ffmpeg.org/pipermail/ffmpeg-devel/2016-June/194842.html</a></div><div><br></div><div>we really have not been able to solve the issue in the 265 case.</div><div><br></div><div>If this info is relevant to your case, I hope it helps …</div><div><br></div><div><br></div><div><br><blockquote type="cite"><div>On Jan 30, 2019, at 7:58 AM, hamidi <<a href="mailto:hamidi@gmail.com" target="_blank">hamidi@gmail.com</a>> wrote:</div><br class="gmail-m_7213630691655716918Apple-interchange-newline"><div><div dir="ltr">I got the latest version binaries of ffmpeg from <a href="https://ffmpeg.zeranoe.com/builds/" target="_blank">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></div><div><br></div><div><br></div><div><br></div><br></div>_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">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>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".</blockquote></div>