Working of UDP source timeout feature

Nicolas Dufresne nicolas at ndufresne.ca
Sat Oct 6 13:32:56 UTC 2018


Le ven. 5 oct. 2018 07 h 11, vk_gst <venkateshkuppan26 at gmail.com> a écrit :

> Hello,
>
>
> I am trying to simulate the delay in UDP streaming using the linux tool -
> netem.  netem <https://wiki.linuxfoundation.org/networking/netem>
>
> I use the following command to induce a latency of 1000ms (at iMX6 side) :
> tc qdisc add dev eth0 root netem delay 1000ms
>
> Now this delay is observed, when I ping between 2 devices, connected via
> LAN
> cable. My devices are iMX6(server) and Ubuntu PC(client)
>
> I am transmitting video packets from iMX6 to PC, where I have configured
> delay of 1000 ms for the eth0 port of iMX6.
> gst-launch-1.0 -v imxv4l2videosrc device=/dev/video1 ! imxvpuenc_h264
> bitrate=500  ! h264parse ! rtph264pay ! udpsink host=192.168.1.11
> port=xxxx
>
> At Ubuntu PC:
> I have configured a timeout of 10ms for the udp source :
> udpsrc port = xxxx  timeout=10000000 ! rtph264depay ! h264parse !
> avdec_h264
> ! autovideosink
>
>
> I install a message callback on the bus for element "udpsrc", that drives a
> callback on detection of the timeout message. Pseudo code(Python-GStreamer)
> as follows:
>
> bus = self.pipeline.get_bus()
> bus.connect('message::element',self.on_timeout)
>
>
> def on_timeout(self,bus,msg)
>   strct = msg.get_structure()
>   if strct.has_name("GstUDPSrcTimeout"):
>      print("udp source timeout detected")
>
>
>
>
> However, when I transmit video data over UDP from imx6 to PC, I observe a
> delay of 1000ms in the video rendered at PC.  When I completely stop
> sending
> packets from iMX6, I can see the timeout
> occurring and the callback called. So the timeout is called, when there
> are
> no packets at all, and not when there is a delay in receiving the packets.
> I was expecting to receive a notification every 100ms when the packets are
> received with delay, i.e. the imx6 board transmits video packets only every
> 1000ms.
> I understand right now there is a continous stream of packets at UDP and
> hence perhaps the timeout function does not work.
> Is there a way to make UDP source work, for not receiving packets every
> 100ms?
>
>
> To sum up the observations:
> 1. the timeout is called when the iMX6 completely stops sending udp
> packets,
> i.e. when I exit the pipeline using ctrl+c on imx6 side.
> 2. the timeout is not called when the iMX6 sends delayed udp packets.
>

The kernel driver will keep a small backlog of packets, even if your app is
not running. So if your sender was started over a second before the
receiver, this behaviour make sense. During streaming, only a 10ms gap
between two packets can cause a timeout. Note that the timeout is
programmed on the recv call, so it excludes the time spent pushing (delay,
parse, decode). This can easily double your configured timeout.


>
> My further tests will include packet losses, delays, jitter combined, and
> in
> such a case when there is no packet received every 100ms or some X ms, I
> want a callback to be invoked.
>
> Does anyone have any pointers on this issue?
>
> Regards.
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> 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/20181006/c4ea49d7/attachment.html>


More information about the gstreamer-devel mailing list