<div dir="ltr">set vsync to 0</div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-08 10:51 GMT-03:00 Info || Non-Lethal Applications <span dir="ltr"><<a href="mailto:info@non-lethal-applications.com" target="_blank">info@non-lethal-applications.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">We’re trying to send an x264 encoded RTP stream to an iOS device.<div>While it works in general, we aren’t sure if we have the best settings to achieve our goal.</div><div>We read on a blog from an x264 developer that it should be possible to achieve a latency of x264 encoded RTP streams of around 10 ms from end to end.</div><div><br></div><div>We are nowhere near that in our setup. </div><div>The lowest we can get is > 1 sec.</div><div><br></div><div>Here are the settings we are using (c is the AVCodecContext pointer):</div><div><br></div><div><div style="margin:0px;font-family:Menlo;color:rgb(112,61,170)"><span style="color:#000000">c-></span>bit_rate_tolerance<span style="color:#000000"> = </span><span style="color:#272ad8">0</span><span style="color:#000000">;</span></div><div style="margin:0px;font-family:Menlo">c-><span style="color:#703daa">rc_max_rate</span> = <span style="color:#272ad8">0</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:#703daa">rc_buffer_size</span> = <span style="color:#272ad8">0</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:#703daa">gop_size</span> = <span style="color:#272ad8">5</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:#703daa">max_b_frames</span> = <span style="color:#272ad8">0</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:rgb(112,61,170)">b_frame_strategy</span> = <span style="color:rgb(39,42,216)">1</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:rgb(112,61,170)">coder_type</span> = <span style="color:rgb(39,42,216)">1</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:rgb(112,61,170)">me_cmp</span> = <span style="color:rgb(39,42,216)">1</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:#703daa">me_range</span> = <span style="color:#272ad8">16</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:rgb(112,61,170)">qmin</span> = <span style="color:rgb(39,42,216)">10</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:rgb(112,61,170)">qmax</span> = <span style="color:rgb(39,42,216)">51</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:#703daa">scenechange_threshold</span> = <span style="color:#272ad8">40</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:#703daa">flags</span> |= <span style="color:#78492a">CODEC_FLAG_LOOP_FILTER</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:#703daa">me_method</span> = <span style="color:#3d1d81">ME_HEX</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:#703daa">me_subpel_quality</span> = <span style="color:#272ad8">5</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:#703daa">i_quant_factor</span> = <span style="color:#272ad8">0.71</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:#703daa">qcompress</span> = <span style="color:#272ad8">0.6</span>;</div><div style="margin:0px;font-family:Menlo">c-><span style="color:#703daa">max_qdiff</span> = <span style="color:#272ad8">4</span>;</div></div><div style="margin:0px;font-family:Menlo"><br></div><div style="margin:0px">Additionally, we tried to set some libx264 private settings like so:</div><div style="margin:0px;font-family:Menlo"><br></div><div style="margin:0px"><div style="font-family:Menlo;margin:0px;color:rgb(209,47,27)"><span style="color:#3d1d81">av_opt_set</span><span style="color:#000000">(</span><span style="color:#4f8187">_pVideoCodecCtx</span><span style="color:#000000">-></span><span style="color:#703daa">priv_data</span><span style="color:#000000">, </span>"preset"<span style="color:#000000">, </span>"ultrafast"<span style="color:#000000">, </span><span style="color:#272ad8">0</span><span style="color:#000000">);</span></div><div style="font-family:Menlo;margin:0px;color:rgb(209,47,27)"><span style="color:rgb(61,29,129)">av_opt_set</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(79,129,135)">_pVideoCodecCtx</span><span style="color:rgb(0,0,0)">-></span><span style="color:rgb(112,61,170)">priv_data</span><span style="color:rgb(0,0,0)">, </span>"tune"<span style="color:rgb(0,0,0)">, </span>"zerolatency"<span style="color:rgb(0,0,0)">, </span><span style="color:rgb(39,42,216)">0</span><span style="color:rgb(0,0,0)">);</span></div><div style="margin:0px"><span style="color:rgb(61,29,129);font-family:Menlo">av_opt_set</span><span style="color:rgb(0,0,0);font-family:Menlo">(</span><span style="color:rgb(79,129,135);font-family:Menlo">_pVideoCodecCtx</span><span style="color:rgb(0,0,0);font-family:Menlo">-></span><span style="color:rgb(112,61,170);font-family:Menlo">priv_data</span><span style="color:rgb(0,0,0);font-family:Menlo">, </span><span style="color:rgb(209,47,27);font-family:Menlo">"g"</span><span style="color:rgb(0,0,0);font-family:Menlo">, </span><font color="#d12f1b" face="Menlo">“30"</font><span style="color:rgb(0,0,0);font-family:Menlo">, </span><span style="color:rgb(39,42,216);font-family:Menlo">0</span><span style="color:rgb(0,0,0);font-family:Menlo">);</span></div><div style="margin:0px"><span style="color:rgb(0,0,0);font-family:Menlo"><br></span></div><div style="margin:0px">Does anyone have a hint what we could do to get more speed?</div><div style="margin:0px">Also, is there anything we can set on the decoder side to decrease the delay?</div><div style="margin:0px">We are on the defaults there.</div><div style="margin:0px"><br></div><div style="margin:0px">Thanks!</div><div style="margin:0px"><br></div><div style="margin:0px">Best regards,</div><div style="margin:0px"><br></div><div style="margin:0px">Flo</div></div></div><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" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><img src="https://lh3.googleusercontent.com/-jTO_Hn0p0VY/UUdsZPT_KGI/AAAAAAAAAN4/bpTrpfmgLRc/s389/Rafael.png"></div></div>
</div>