vaapih264dec - latency

Weber, Holger Holger.Weber at telerob.com
Fri Sep 1 11:24:14 UTC 2017


I try to get the vaapih264dec running for low latency streaming. I have good results if I use the avdec_h264 module but if I use the vaapih264dec the latency increases.

Pipeline (software):
gst-launch-1.0 rtspsrc drop-on-latency=true latency=0 location=$SRC ! rtpmp2tdepay ! tsdemux ! h264parse ! avdec_h264 ! glimagesink sync=false

Pipeline (hardware):
gst-launch-1.0 rtspsrc drop-on-latency=true latency=0 location=$SRC ! rtpmp2tdepay ! tsdemux ! h264parse ! vaapih264dec ! glimagesink sync=false

The encoder uses intra refresh and never sends a whole I-frame. So at the beginning vaapih264dec dropped all frames.
I modified gstvaapidecoder_h264.c:
###################################################
priv->decoder_state |= sps_pi->state;
  if (!(priv->decoder_state & GST_H264_VIDEO_STATE_GOT_I_FRAME)) {
/* removed  don't wait for a valid I-Frame (intra refresh problem)
    if (priv->decoder_state & GST_H264_VIDEO_STATE_GOT_P_SLICE)
      goto drop_frame;
*/
###################################################

After that modification the stream started but the latency is still about 150ms higher as with avdec_h264. I guess this has something to do with frame reordering. Some decoders collect some frames and reorder them. In this case the encoder does no reordering because for low latency but the decoder seem to collect the frames.

Does someone have an idea where the behavior can be changed e.g. reduce frame buffer to 0/1?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170901/d8b4b14b/attachment.html>


More information about the gstreamer-devel mailing list