Low latency streaming over the network, time sync

Nicolas Dufresne nicolas at ndufresne.ca
Thu Oct 4 15:44:23 UTC 2018


Le jeudi 04 octobre 2018 à 11:09 +0200, Wolfgang Grandegger a écrit :
> Hello,
> 
> I'm looking into low latency real-time streaming of MJPEG videos over
> the network with GStreamer. I wonder what module does the frame
> synchronisation on the receivers side and how. On the sender I start:
> 
> # gst-launch-1.0 filesrc location=output.avi ! avidemux name=demux
> demux.video_0 ! vaapipostproc ! vaapijpegenc quality=50 ! rtpjpegpay
> !
> udpsink host=192.168.178.52 port=50004
> 
> and on the receiver:
> 
> # gst-launch-1.0 udpsrc port=50004 !
> application/x-rtp,encoding-name=JPEG,payload=26 ! queue !
> rtpjpegdepay !
> vaapijpegdec ! vaapipostproc ! vaapisink

To you first question, none in your pipeline. You'll need a
jitterbuffer to handle the time, ideally with do-timestamp=1 on the
udpsrc element.

> 
> I have some basic questions:
> 
> - Are the frames displayed as they arrive (in "udpsrc")?

It will depends on the jitterbuffer "mode" property. By default it will
try to slave to the remote clock. This mode is not extremely accurate
though.

> 
> - Are the timestamps of the RTP packets used to  display the
>   frames at the right time?

Yes, if you use a jitterbuffer.

> 
> If I add "sync=false" to the sender's command, the video is displayed
> faster, even if I replace "queue" with "rtpjitterbuffer" in the
> receiver's command.
> 
> Also, with high quality decoding (90%), the video starts jerking. If
> I
> play the AVI file directly on the receiver side, it looks good.

JPEG are big, you'll have to increase the kernel UDP buffer.

  sysctl net.core.rmem_max=value

And then use buffer-size property on udpsrc.

> 
> What am I missing?
> 
> TIA,
> 
> Wolfgang.
> 
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20181004/92c1c151/attachment.sig>


More information about the gstreamer-devel mailing list