0

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?

2
  • 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, 2013 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 http://192.168.254.102:8080/stream?topic=/camera/rgb/image_color.
    – Andrew
    Sep 17, 2013 at 7:04

1 Answer 1

0

I found a vlc command that solved my issue:

vlc -I dummy \
http://192.168.254.102:8080/stream?topic=/camera/rgb/image_color/ \
--video-filter=scene \
--vout=dummy \
--scene-format=jpg \
--scene-ratio=1 \
--scene-prefix=snapshot \
--scene-path=/home/andrew/frames \
vlc://quit

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.

You must log in to answer this question.

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