title: gstreamer's udpsink stops streaming after sending ~1000 packets
body: <p>I'm trying to stream my Raspberry Pi camera with gstreamer. This is my pipeline:</p>
  
  <pre><code>raspivid --nopreview -ih -hf -vf --width 800 --height 600 --framerate 20 --bitrate 2000000 --profile main --timeout 0 -g 4 -o - | gst-launch-1.0 -vvv fdsrc do-timestamp=true \
   ! h264parse ! omxh264dec ! clockoverlay time-format="%A | %d %B %Y | %H:%M:%S" ! omxh264enc target-bitrate=2000000 control-rate=1 ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=targethost port=8004 sync=false
  </code></pre>
  
  <p>And it works... well almost. I can receive stream on my target host for a second or so, then it stops. Gstreamer doesn't output any errors, doesn't quit, it just stops sending out UDP packets.</p>
  
  <p>I installed <code>iptraf</code> on my Pi and I can see that UDP packet sending stops after about ~1000 packets. It might stop at ~800 packets, or ~1500 packets, it's around these numbers.</p>
  
  <p>Now interesting thing is that SOMETIMES it works longer, like for a few hours. But sometimes it just stops almost instantly. I'm observing this for about two days now, and it might be that it works better at night, maybe because the stream is pitch black then, so with better compression, it has less packets to send? I don't know. What can stop packet sending without any error like that? Anyone have any idea what's going on here?</p>
  
  <p><strong>Added #1:</strong>
  Also in case it's an infrastructure issue, Pi is connected with local network through its wi-fi interface, and it's actually connected to the wi-fi extender. So it's not a very clean setup, but it seems to work at night, at least judging from the last two days, but even if there would be some bandwidth bottleneck, could it stop UDP stream like that? It doesn't make sense to me.</p>
  
  <p><strong>Added #2:</strong></p>
  
  <pre><code>$ gst-launch-1.0 --version
  gst-launch-1.0 version 1.14.4
  GStreamer 1.14.4
  </code></pre>
  
  <p><strong>Added #3:</strong></p>
  
  <p>I run this with <code>GST_DEBUG=3</code>. when it stops it doesn't show anything new, just any new messages stop appearing.</p>
  
  <p>Here is full output until stream dies without any further message: <a href="https://pastebin.com/raw/kTfbCW37" rel="noreferrer">https://pastebin.com/raw/kTfbCW37</a> (these warnings happen even if stream works without a problem for a long time in some configurations described below).</p>
  
  <p>I discovered also that bandwidth is not a problem. I measured it with <code>iperf</code> and the stream is using only about 1/10th of available bandwidth at most.</p>
  
  <p>I also discovered that if I'll increase the resolution to <code>--width 1920 --height 1080</code> then stream seems to work longer... (it stopped at one point at night). So there is something very strange going on. Any ideas what may it be or what else can I do to figure out what is going on?</p>
  
  <p><strong>Added #4:</strong>
  I installed <code>pv</code> and put it between <code>raspivid</code> and <code>gstreamer</code>. It turns out that it might not be an issue with gstreamer in the end, because it looks like the stream from raspivid just stops at one point. Once it stopped at 1.99GiB of data sent (this made me think that's related to old, known 2GB limit of raspivid), but second time it stopped at 775MiB of data sent.</p>