ffmpeg encoding with VP8 producing bad looking video

General Tech Bugs & Fixes 2 years ago

0 3 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (3)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

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?

profilepic.png
manpreet 2 years ago

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.


0 views   0 shares

profilepic.png
manpreet 2 years ago

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.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.