poor playback of MPEG-TS-over-UDP stream

Mark Howell mark-sub1 at hypgnosys.org
Thu Feb 4 21:16:28 UTC 2016


Esteemed gurus,

I'm working with a network video widget that provides 
H.264-on-MPEG-TS-on-UDP. I'm having a hard time getting reliable clean 
decode and display of the video with low latency.

Using GStreamer 1.6.3 on Linux.

This pipeline works fine, plays back with reasonable latency and without 
drops or glitches at 30 fps:

$ gst-launch-1.0 -v udpsrc port=15004 ! video/mpegts ! tsdemux ! 
h264parse ! avdec_h264 ! fpsdisplaysink sync=false

This doesn't work well, showing mangled frames occasionally, at 1-3 fps:

$ gst-launch-1.0 -v udpsrc port=15004 ! video/mpegts ! tsdemux ! 
h264parse ! avdec_h264 ! fpsdisplaysink sync=true

I can make it better (but not perfect) by adding a queue, but that adds 
1 s or so of latency:

$ gst-launch-1.0 -v udpsrc port=15004 ! video/mpegts ! tsdemux ! 
h264parse ! queue ! avdec_h264 ! fpsdisplaysink sync=true

I suspect this is related to latency/timestamp handling in or near 
tsdemux. I've seen commentary on bugzilla suggesting some 
dissatisfaction with the state of that in tsdemux 
(https://bugzilla.gnome.org/show_bug.cgi?id=608148) but don't understand 
it well enough atm to know what to try.

I made it behave *better* by changing the default latency from 700 ms to 
50 ms in tsdemux.c (see attached patch). But again I don't understand it 
well enough to be clear *why*, or how to make it *right*.

Plays OK (but not without debug complaints; perhaps they are relevant) 
with vlc and libav:

$ cvlc udp://@:15004

and

$ avplay udp://*:15004

I'd appreciate some clues on how to proceed... I can run tests and grab 
logs with some direction.

Cheers,

Mark.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-tsdemux-change-default-latency-from-700-ms-to-50-ms-.patch
Type: text/x-patch
Size: 824 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160204/9b7d66a3/attachment.bin>


More information about the gstreamer-devel mailing list