I have a set of video frames saved as images in a directory, and I'm trying to encode these to a good quality video, however every setting and every format I try produces very noticeable artifacts.
The basic command is this:
ffmpeg -r 25 -i %4d.png myvideo.mpg
and I've tried the minrate and maxrate flags. Any of {mpg, avi, mov, flv} formats will do.
Any suggestions for settings? Final file size is not an issue.
You need to specify the -vb option to increase the video bitrate, otherwise you get the default which produces smaller videos but with more artifacts.
Try something like this:
ffmpeg -r 25 -i %4d.png -vb 20M myvideo.mpg
Make sure the PNGs are fully opaque before creating the video
e.g. with imagemagick, give them a black background:
convert 0.png -background black -flatten +matte 0_opaque.png
From my tests, no bitrate or codec is sufficient to make the video look good if you feed ffmpeg PNGs with transparency
Unless you do some kind of post-processing work, the video will never be better than the original frames. Also just like a flip-book, if you have a big "jump" between keyframes it will look funny. You generally need enough "tweens" in between the keyframes to give smooth animation. HTH