[gst-devel] Need to understand MJPEG streams

Wes Miller wmiller at sdr.com
Thu Apr 1 00:04:52 CEST 2010


Hi All,

I am looking to do some work with an Axis camera that supplies me an MJPEG
stream. I am new to gstreamer so I need some startup help understanding
what's going on.

I am using souphttpsrc as my source element.  The detected mime type from
the camera after souphttpsrc is multipart/x-mixed-replace as expected.

   gst-launch-0.10.exe -e souphttpsrc location="...?camera=2,  \
       width=320,height=240,framerate=(fraction)1/25" \
       do-timestamp=true is_live=true


If I now send this stream to a file, is it stored as MJPEG?

   gst-launch-0.10.exe -e souphttpsrc location=... ! filesink
location=soup.mjpg



FWIW, I tried a tool called JPLAYER from the net, a supposed mjpeg player. 
It will play the "live" stream from http://10.xx.yy.zz but it won't play
file:///.../soup.mjpg.

Is MJPG a correct file type? (just in case jplayer is dumb enough to check
the file extension and not the mime-type.)  The divx player can't play the
file either.



However, the stored file will "play" using the same stream I use to see the
live video feed.

   gst-launch-0.10.exe -e souphttpsrc location=... ! multipartdemux \
      ! jpegdec ! ffmpegcolorspace ! autovideosink

   // (swap filesrc for souphttpsrc)

   gst-launch-0.10.exe -e filesrc location=A.mjpg ! multipartdemux \
      ! jpegdec ! ffmpegcolorspace ! autovideosink



Piping from souphttpsrc into multipartdemux yields a mime-type of
image/jpeg.  This is the type of each demuxed frame, right?

If I choose to store the output of the demuxer, does it remain a motion
stream?  What type of file and/or stream is it?  Is there a preferred file
extension for it?



If I attempt to play back the post-demuxer file, time elapses and the pipe
terminates ok, but there is no output video shown.

   gst-launch-0.10.exe -e filesrc location=post-demux.jpg \
      ! jpegdec ! ffmpegcolorspace ! autovideosink



Thanks for the any help.

Wes


-- 
View this message in context: http://n4.nabble.com/Need-to-understand-MJPEG-streams-tp1747445p1747445.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list