0
votes

I am working at a time lapse program that invokes ffmpeg via system() to encode a video from a sequence of JPGs. The user can chose a few options, including the compression codec. I am getting very good results when using libx264 and the mjpeg encoder. I am getting so and so results with VP9, and I am getting some horrible results with VP8.

I am invoking ffmpeg like so: ffmpeg.exe -framerate 12 -i "./output/img_%05d.jpg" -dst_range 1 -color_range 2 -c:v libvpx -b:v 0 -threads 8 -speed 2 -crf 8 "./output/video.webm"

I uploaded a sample to youtube: https://www.youtube.com/watch?v=eG2jxzR3Uxs (you can see the really bad frames after the 9 seconds mark.

Any idea what I am doing wrong?

1

1 Answers

3
votes

Even with CRF (see also the libvpx wiki), you are still recommended to use 2-pass encoding for best results. The 1-pass (which is what you're using here) typically gives pretty poor results with libvpx. I know that's not typical, CRF should not be affected by multi-pass, but unfortunately libvpx is a little bit "different" in that regard. Other encoders will work fine with 1-pass CRF.

Also note that even though CRF indices are the same, you're not necessarily selecting the same effective quantizer or getting anywhere near the same bitrate. So that fact that one encoder or code gives better results than another without taking effective bitrate into account isn't very useful in and by itself, you'd typically analyze quality as a function of bitrate.

This can be somewhat improved by using VBR, but even then, the actual bitrate may be quite far from the target bitrate if the rate control/targetting is poor, so you still need to look at actual bitrate, not just target bitrate.