2

Trying to figure out how to get avconv to concatenate a bunch of .bmps together into a video file.

Here's what I've got so far:

avconv -f image2 -i Capture/%d.bmp -vcodec mpeg4 -r 24 -b:v 20M Capture.mkv

While this does work, the quality is terrible - there are tons of artifacts that are visible, the colours are distorted and everything is blurred.

I've trawled through the documentation for avconv and ffmpeg, but can't find anything that increases the quality.

Any ideas as to how I can get the quality as close to the original bmps as possible?

1
  • I haven't even been able to get this to work... The command I'm using appears to overwrite the original bitmap: Same command as yours except I am using -i output_{0..1023}.bmp Commented Feb 22, 2015 at 14:06

3 Answers 3

4
-vcodec mpeg4

That could be your problem. MPEG-4 is a fairly good codec, but it's easily outperformed by h.264 – x264 being a popular example for an h.264 encoder. I'm not sure how big of a role the bitrate plays here, but it would help to just try x264. Therefore, use

-c:v libx264

to change your encoder.* In order to tune the quality, set the Constant Rate Factor to a level of your choice. Sane values are from 19 to 24, where lower values mean better quality.

avconv -f image2 -i Capture/%d.bmp -c:v libx264 -r 24 -crf 21 Capture.mkv

If you still see artifacts, you might want to give us more info, and update your post with the full, uncut console output from your avconv command.

* -c:v is the new syntax used instead of vcodec, similar to -b:v. Try to keep sticking to that.

0

I had a similar problem. To get the best match to your BMP, I suggest doing what I did: convert to TIF or JPEG since avconv doesn't handle BMP very nicely - no matter many high quality settings I discovered and set.

A visual way to do this is simply get GIMP and BIMP (which is an excellent batch program anyway) and do a batch conversion of your BMPs to JPEGs at 100% quality or TIF (you could use TIF compression).

Now try the same avconv action. I used avconv -f image2 -r 15 -i animation%04d.jpg -r:v 15 -c:v h264 -crf 1 -an "animation_test.mov" but it should be fine with your mkv action now.

-1

Try using a different video codec. It might only work in QuickTime files (not Matroska), but qtrle is a lossless video codec, although it doesn't compress very well.

You must log in to answer this question.