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 can convert avi, wmv and other video files easilly, but not this format. I`ve looked for some info how to convert mjpg files with ffmpeg and found nothing.

As this format is widely used in web cameras I need to handle this and think answer how to convert it will be usefull to everybody.

share|improve this question

If you are referring to the m-jpeg format.
It might be a good idea to convert it to a regular mpg file and then to FLV.

This HOWTO is a good read if you are playing with ffmpeg.

share|improve this answer
really thanks for your answer! I knew a lot of information from that link. But still need to know hot to convert video from mjpg to mpg with ffmpeg? I dont mind to convert in two steps, just when I tried to convert it to mpg I got the following error:doesnt support 15/1 fps. my conversion string is the following: ffmpeg -i in.avi -out.mpg. I also tried ffmpeg -in.avi -sameq -r x -y out.mpg where x was from 1 to 15 and it didn`t work. Any ideas? – Yaroslav Yakovlev Aug 26 '09 at 10:42

m-jpeg is not one standard format. It is a group of formats that use a series of jpegs to store the frames of your video. Each implementation of this is propriotary and generally incompatible. So basically you need the codec from manufacturer of the camera (which will likely only be available for windows) and then you can use something like virtualdub to reencode it into a standard format.

ffmpeg won't use windows codecs so is not the ideal tool to use in this case.

I would highly recommend against converting to an mpg and then to an flv as reencoding twice incurs a big loss in quality over recoding directly. If you need to do it in 2 steps then the intermediate format should be uncompressed or a lossless format such as huffyuv.

share|improve this answer

I had the same issue but wanted .mp4 instead of .flv. Was able to get it working using ffmpeg (v1.1.2-tessus).

ffmpeg -i input_movie.mjpg -c:v libx264 output_movie.mp4

Once you have it in .mp4 you can easily convert it to other formats. Play around with using different codecs if you're looking for lossless quality conversion.

share|improve this answer

You must log in to answer this question.

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