Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to extract jpeg images from an mjpeg stream. I've done a search and found a few sources, but those were extracting jpeg images from a mjpeg file, such as this one here. In my case, I don't have a file, but a live video stream. How can I extract jpeg images from this mjpeg stream? My goal at the end of the day is to recreate the video from a series of jpegs.

I'm looking for a command line answer to use in a terminal, as I'm using Ubuntu Server without GUI. If possible, it'd be great if frame rate and/or quality can be configured. I've looked at ffmpeg, libav and vlc, but I can't quite figure it out. Can anyone help?

share|improve this question
Couldn't you just save the stream and extract it later—or not extract it at all since you only need the video? Do you have an example stream URL? – slhck Sep 17 '13 at 6:17
Apart from recreating the video, I also have use for the images. Also, the stream might be ongoing for extended periods of time (several hours). In this case, I would have an extremely large file which is inconvenient for me. I plan to send this recording of the live stream to a Tomcat server. I'm not so familiar with all this video/media stuff, but I'm guessing that it's easier to send images rather than packets of data of a video. An example of the stream URL would be – Andrew Sep 17 '13 at 7:04
up vote 0 down vote accepted

I found a vlc command that solved my issue:

vlc -I dummy \ \
--video-filter=scene \
--vout=dummy \
--scene-format=jpg \
--scene-ratio=1 \
--scene-prefix=snapshot \
--scene-path=/home/andrew/frames \

This saves every frame from the stream. If I want to capture one frame every 10, The --scene-ratio value can changed to 10: --scene-ratio=10.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .