Verwenden von avconv (ffmpeg) zum Verketten einer Reihe von .bmps-Dateien zu einem MKV / AVI-Video

5096
slhck

Versuchen, herauszufinden, wie man avconv dazu bringt, eine Reihe von .bmps in einer Videodatei zusammenzufassen.

Hier ist was ich bis jetzt habe:

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

Während dies funktioniert, ist die Qualität schrecklich - es gibt Unmengen von Artefakten, die sichtbar sind, die Farben sind verzerrt und alles ist verschwommen.

Ich habe die Dokumentation nach avconvund durchsucht ffmpeg, finde aber nichts, was die Qualität erhöht.

Irgendwelche Ideen, wie ich die Qualität so nahe wie möglich an die ursprünglichen Bmps bringen kann?

2
Ich habe es noch nicht einmal geschafft, dass dies funktioniert ... Der Befehl, den ich verwende, scheint das ursprüngliche Bitmap zu überschreiben: Der gleiche Befehl wie der andere, außer dass ich `-i output_ .bmp` verwende user3728501 vor 9 Jahren 0

3 Antworten auf die Frage

4
slhck
-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
Sprunky

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

Versuchen Sie es mit einem anderen Videocodec. Es funktioniert möglicherweise nur in QuickTime-Dateien (nicht in Matroska), qtrleist jedoch ein verlustfreier Videocodec, der jedoch nicht gut komprimiert wird.