title: GStreamer - MJPEG stream to file
body: <p>I have problem with saving <code>MJPEG</code> stream to file.
   When I stream <code>MJPEG</code> using such pipeline: </p>
  
  <pre><code>gst-launch filesrc location=thirdmovie640x360.mp4 ! decodebin2 name=dec \
      ! queue ! ffmpegcolorspace ! jpegenc ! queue ! avimux name=mux \
      ! udpsink host=192.168.0.2 port=5000
  </code></pre>
  
  <p>I am able to play this stream on my second machine using such pipeline:</p>
  
  <pre><code>gst-launch -v udpsrc port=5000 ! jpegdec ! autovideosink
  </code></pre>
  
  <p>However, how can I save such <code>MJPEG</code> stream to file (without transcoding!) which will be able to be played in some media player? Could you recommend some pipeline?</p>
  
  <hr>
  
  <p>I found such pipeline to save output stream as matroska file: </p>
  
  <pre><code>gst-launch udpsrc port=5000 ! multipartdemux ! jpegparse ! jpegdec \
      ! ffmpegcolorspace ! matroskamux ! filesink location=output.mkv
  </code></pre>
  
  <p>How to change it to save mp4 file? Such pipeline:</p>
  
  <pre><code>gst-launch udpsrc port=5000 ! multipartdemux ! jpegparse ! jpegdec \
      ! ffmpegcolorspace ! mp4mux ! filesink location=output.mp4
  </code></pre>
  
  <p>does not work. Could you help me save it as mp4 contener (or avi contener) without transcoding MJPEG video.</p>