When doing 2 pass video encoding with FFmpeg, how to find the optimal bitrate?

0

When doing 2 pass video encoding with VP8 (libvpx), is there a way to figure out the optimal bitrate, so I don't have to guess?

Something like a small compression test, or some ffmpeg command, that will help me determine the appropriate bitrate?

I tried reading the VP8 1st pass stats file in notepad, but it's all garbled.

I'm using Windows 7 with the latest FFmpeg build.

ClearSky

Posted 2015-09-15T18:38:22.900

Reputation: 39

Answers

3

Why not use a constant quality rate control (CRF) that will let the encoder choose an optimal bitrate ?

ffmpeg -i input.mp4 -c:v libvpx -crf 10 -b:v 20M -c:a libvorbis output.webm

The CRF value can be set within [4 ; 63], 4 being the best quality. 10 is a well accepted value. The specified -b:v 20M becomes the maximum allowed bitrate.

Two-pass encoding should only be used when you need a fixed-size file, otherwise, CRF is the preferred method.

More information in the VP8/FFmpeg article.

Ely

Posted 2015-09-15T18:38:22.900

Reputation: 1 378

This CRF value seems low, but maybe the ranges are specific to an encoder? – Tobu – 2015-09-15T23:00:20.923

It's CRF specific to the VP8 encoder which is different from x264's CRF. – Ely – 2015-09-16T11:45:53.910