Re: 答复: 答复: How to reduce avdec_h264 latency

paolo perotinus paoloperot at yahoo.it
Tue Jul 11 13:02:35 UTC 2017


More precisely, in gstavviddec.c there are the following lines:
    query = gst_query_new_latency ();    is_live = FALSE;    /* Check if upstream is live. If it isn't we can enable frame based     * threading, which is adding latency */    if (gst_pad_peer_query (GST_VIDEO_DECODER_SINK_PAD (ffmpegdec), query)) {      gst_query_parse_latency (query, &is_live, NULL, NULL);    }    gst_query_unref (query);
    if (is_live)      ffmpegdec->context->thread_type = FF_THREAD_SLICE;    else      ffmpegdec->context->thread_type = FF_THREAD_SLICE | FF_THREAD_FRAME;
Then, latency is introduced depending on "is_live" property, checked by the query. Now, I don't understand how to set the "is_live" property in the code of my receiver. I tried with:
  GstPad* pad_decoder_sink = gst_element_get_static_pad (data.video_decoder, "sink");
  GstQuery *query;
  query = gst_query_new_latency ();
  if (gst_pad_peer_query (pad_decoder, query)) {
     gst_query_set_latency (query, TRUE,  0, 0);        
  }gst_object_unref (pad_decoder_sink);  
The  gst_query_set_latency() function is called, but gst_query_parse_latency (query, &is_live, NULL, NULL) inside gstavviddec.c returns FALSE for "is_live".  
Why? How can I set that property?







 

    Il Martedì 11 Luglio 2017 12:57, "Lijia (George Lee, Euler)" <george.lee at huawei.com> ha scritto:
 

 #yiv1838736994 #yiv1838736994 -- _filtered #yiv1838736994 {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv1838736994 {font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;} _filtered #yiv1838736994 {panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv1838736994 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv1838736994 {panose-1:2 1 6 0 3 1 1 1 1 1;} _filtered #yiv1838736994 {panose-1:2 11 5 3 2 2 4 2 2 4;} _filtered #yiv1838736994 {panose-1:2 11 5 3 2 2 4 2 2 4;}#yiv1838736994 #yiv1838736994 p.yiv1838736994MsoNormal, #yiv1838736994 li.yiv1838736994MsoNormal, #yiv1838736994 div.yiv1838736994MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:宋体;}#yiv1838736994 a:link, #yiv1838736994 span.yiv1838736994MsoHyperlink {color:blue;text-decoration:underline;}#yiv1838736994 a:visited, #yiv1838736994 span.yiv1838736994MsoHyperlinkFollowed {color:purple;text-decoration:underline;}#yiv1838736994 p.yiv1838736994msonormal, #yiv1838736994 li.yiv1838736994msonormal, #yiv1838736994 div.yiv1838736994msonormal {margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:宋体;}#yiv1838736994 p.yiv1838736994msochpdefault, #yiv1838736994 li.yiv1838736994msochpdefault, #yiv1838736994 div.yiv1838736994msochpdefault {margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:宋体;}#yiv1838736994 span.yiv1838736994msohyperlink {}#yiv1838736994 span.yiv1838736994msohyperlinkfollowed {}#yiv1838736994 span.yiv1838736994emailstyle17 {}#yiv1838736994 p.yiv1838736994msonormal1, #yiv1838736994 li.yiv1838736994msonormal1, #yiv1838736994 div.yiv1838736994msonormal1 {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:宋体;}#yiv1838736994 span.yiv1838736994msohyperlink1 {color:#0563C1;text-decoration:underline;}#yiv1838736994 span.yiv1838736994msohyperlinkfollowed1 {color:#954F72;text-decoration:underline;}#yiv1838736994 span.yiv1838736994emailstyle171 {color:#1F497D;}#yiv1838736994 p.yiv1838736994msochpdefault1, #yiv1838736994 li.yiv1838736994msochpdefault1, #yiv1838736994 div.yiv1838736994msochpdefault1 {margin-right:0cm;margin-left:0cm;font-size:10.0pt;font-family:宋体;}#yiv1838736994 span.yiv1838736994EmailStyle27 {color:#1F497D;}#yiv1838736994 .yiv1838736994MsoChpDefault {font-size:10.0pt;} _filtered #yiv1838736994 {margin:72.0pt 90.0pt 72.0pt 90.0pt;}#yiv1838736994 div.yiv1838736994WordSection1 {}#yiv1838736994 This option is-live instructs GST h264 decoder element to perform low latency mode for Live event, thus this option takes role of key configuration of pipeline behavior in response to real-time decoding. In my opinion it should not be removed but more elaborate description is also needed to avoid misleading programmer.    George      发件人: gstreamer-devel [mailto:gstreamer-devel-bounces at lists.freedesktop.org]代表 paolo perotinus
发送时间: 2017年7月11日 18:50
收件人: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
主题: Re: 答复: How to reduce avdec_h264 latency    I just solved the problem (thanks to Tim-Philipp Muller) by setting is-live=1 on the receiver. The latency was added  in gstavviddec.c (check the line with: "gst_query_parse_latency (query, &is_live, NULL, NULL);" ). However I think that this option (is-live) can appear too generic and misleading, and should be removed/changed. What do you think about?    Il Martedì 11 Luglio 2017 12:40, "Lijia (George Lee, Euler)" <george.lee at huawei.com> ha scritto:    Pls take a bit of time to delve into system –level thread scheduling in attempt to find clue to long latency in plugin implementation. As per experience excluding bitstream encoding option, in many situations we often can find negative impact brought by threading scheduling over Linux. Even though bitstream has been encoded very well for low-latency use-case such as removal of B-frame/sub-frame processing (parallel pipeline), implicit threading scheduling defect is hard to find.   Best Regards,   George Lee   发件人: gstreamer-devel [mailto:gstreamer-devel-bounces at lists.freedesktop.org]代表paolo perotinus
发送时间: 2017年7月11日 17:45
收件人: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
主题: Re: How to reduce avdec_h264 latency     Il Martedì 11 Luglio 2017 1:06, Olivier Crête <olivier.crete at collabora.com> ha scritto:   > Hi,

> The only way to do that is to create a stream with no B-frames, for example using the H. 264 baseline profile.

> Olivier    Hi Olivier,   The stream is already coded with no B-frames (zerolatency tune in ffmpeg) but I still have that latency in avdec_h264...   _______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel    _______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170711/79f2a5a5/attachment-0001.html>


More information about the gstreamer-devel mailing list