[FFmpeg-user] ffmpeg bitrate flag

Moritz Barsnick barsnick at gmx.net
Wed Sep 3 13:39:24 CEST 2014

On Wed, Sep 03, 2014 at 12:52:43 +0200, Francois Visagie wrote:
> [A. Semprimožnik wrote:]
> > number of videos is transcoded to MPEG1 and OGG. Those videos are then

MPEG1 video, honestly? Is there any player out there which _doesn't_
support something more effective? Just wondering.

> > My question is, are there any flag in ffmpeg, that sets bitrate dynamically
> > based on video content at transcoding time. What I mean by that, for
> > example, if a video is static, we don’t need high bitrate for new video when
> > decoding (static scene, where just one object is moving a little for example).
> > When video is full of action for example, so it is very dynamic, we need
> > higher bitrate to achieve a good quality of a video.

Most codecs aren't constant bitrate by default anyway, so if you're
specifying "-b" ("-b:v"), you're forcing the codec to try to retain the
bitrate. Wikipedia even explicitly mentions "Vorbis is inherently
variable-bitrate (VBR)".

By the way, we haven't seen your command line, so we don't know
what you've already been trying.

> If you specify a maximum (reasonable) bitrate and use two-pass
> encoding, the encoder will achieve what you want automatically. It
> will allocate as much bitrate as possible to high-motion or -detail
> sequences, and as little as possible to the opposite. Two-pass
> encoding may not be ideal during live streaming; in that case
> consider "average bitrate encoding".

While I agree with this procedure, I would first try with the "normal"
VBR/ABR tuning parameters, and omit "-b". libx264 takes (among others)
"-crf", which influences the quality. The resulting bitrates varies
according to the video material. ffmpeg's libvorbis documentation
mentions "q":

‘q (-q)’
    Set constant quality setting for VBR. The value should be a float
    number in the range of -1.0 to 10.0. The higher the value, the
    better the quality. The default value is ‘3.0’.

Try playing with these and see if the results are what you expect.


More information about the ffmpeg-user mailing list