<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">Le ven. 5 oct. 2018 07 h 11, vk_gst <<a href="mailto:venkateshkuppan26@gmail.com" target="_blank" rel="noreferrer">venkateshkuppan26@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, <br>
<br>
<br>
I am trying to simulate the delay in UDP streaming using the linux tool - <br>
netem.  netem <<a href="https://wiki.linuxfoundation.org/networking/netem" rel="noreferrer noreferrer noreferrer" target="_blank">https://wiki.linuxfoundation.org/networking/netem</a>>   <br>
<br>
I use the following command to induce a latency of 1000ms (at iMX6 side) : <br>
tc qdisc add dev eth0 root netem delay 1000ms <br>
<br>
Now this delay is observed, when I ping between 2 devices, connected via LAN <br>
cable. My devices are iMX6(server) and Ubuntu PC(client)<br>
<br>
I am transmitting video packets from iMX6 to PC, where I have configured <br>
delay of 1000 ms for the eth0 port of iMX6. <br>
gst-launch-1.0 -v imxv4l2videosrc device=/dev/video1 ! imxvpuenc_h264 <br>
bitrate=500  ! h264parse ! rtph264pay ! udpsink host=192.168.1.11 port=xxxx <br>
<br>
At Ubuntu PC: <br>
I have configured a timeout of 10ms for the udp source : <br>
udpsrc port = xxxx  timeout=10000000 ! rtph264depay ! h264parse ! avdec_h264 <br>
! autovideosink <br>
<br>
<br>
I install a message callback on the bus for element "udpsrc", that drives a<br>
callback on detection of the timeout message. Pseudo code(Python-GStreamer)<br>
as follows:<br>
<br>
bus = self.pipeline.get_bus()<br>
bus.connect('message::element',self.on_timeout)<br>
<br>
<br>
def on_timeout(self,bus,msg)<br>
  strct = msg.get_structure()<br>
  if strct.has_name("GstUDPSrcTimeout"):<br>
     print("udp source timeout detected")<br>
<br>
<br>
<br>
<br>
However, when I transmit video data over UDP from imx6 to PC, I observe a<br>
delay of 1000ms in the video rendered at PC.  When I completely stop sending<br>
packets from iMX6, I can see the timeout <br>
occurring and the callback called. So the timeout is called, when there are <br>
no packets at all, and not when there is a delay in receiving the packets. <br>
I was expecting to receive a notification every 100ms when the packets are<br>
received with delay, i.e. the imx6 board transmits video packets only every<br>
1000ms. <br>
I understand right now there is a continous stream of packets at UDP and<br>
hence perhaps the timeout function does not work. <br>
Is there a way to make UDP source work, for not receiving packets every<br>
100ms?  <br>
<br>
<br>
To sum up the observations: <br>
1. the timeout is called when the iMX6 completely stops sending udp packets,<br>
i.e. when I exit the pipeline using ctrl+c on imx6 side. <br>
2. the timeout is not called when the iMX6 sends delayed udp packets. <br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
My further tests will include packet losses, delays, jitter combined, and in<br>
such a case when there is no packet received every 100ms or some X ms, I<br>
want a callback to be invoked. <br>
<br>
Does anyone have any pointers on this issue? <br>
<br>
Regards.   <br>
<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://gstreamer-devel.966125.n4.nabble.com/" rel="noreferrer noreferrer noreferrer" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" rel="noreferrer noreferrer" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div></div></div>