title: Gstreamer udpsrc error "reason error (-5)" due to "Invalid JPEG file structure: two SOF markers"
body: <p>I am using the following command to receive a UDP stream from a camera over the network: </p>
  
  <p><code>gst-launch-1.0 udpsrc port=53247 ! jpegdec ! xvimagesink sync=false</code></p>
  
  <p>I am able to receive correctly the video stream from the camera during some seconds but then the video stops with the following error message:</p>
  
  <pre><code>** (gst-launch-1.0:7888): CRITICAL **: gst_adapter_push: assertion 'GST_IS_BUFFER (buf)' failed
  ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data flow error.
  Additional debug info:
  gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
  streaming task paused, reason error (-5)
  Execution ended after 0:00:08.152866431
  Setting pipeline to PAUSED ...
  Setting pipeline to READY ...
  Setting pipeline to NULL ...
  Freeing pipeline ...
  </code></pre>
  
  <p>The only informations available about the stream are the following:</p>
  
  <p>Data format: UDP packages / JPEG</p>
  
  <p>Picture resolution: VGA (640 x 480)</p>
  
  <p>Frame rate: 30 fps</p>
  
  <p>I managed to get more informations about my error adding the <code>--gst-debug-level=2</code>parameter to my command.</p>
  
  <p>The additional warning message displayed is the following:</p>
  
  <pre><code>0:00:11.518477156  6569      0x2577940 WARN            videodecoder gstvideodecoder.c:3443:_gst_video_decoder_error:&lt;jpegdec0&gt; error: Failed to decode JPEG image
  0:00:11.518555417  6569      0x2577940 WARN            videodecoder gstvideodecoder.c:3445:_gst_video_decoder_error:&lt;jpegdec0&gt; error: Decode error #60: Invalid JPEG file structure: two SOF markers
  0:00:11.519470502  6569      0x2577990 WARN                 basesrc gstbasesrc.c:2865:gst_base_src_loop:&lt;udpsrc0&gt; error: Internal data flow error.
  0:00:11.519569256  6569      0x2577990 WARN                 basesrc gstbasesrc.c:2865:gst_base_src_loop:&lt;udpsrc0&gt; error: streaming task paused, reason error (-5)
  </code></pre>
  
  <p>What is the problem with my command?</p>