[FFmpeg-user] ffmpeg low bitrate with with qulaity

Moritz Barsnick barsnick at gmx.net
Wed Apr 8 09:22:57 EEST 2020

Hi Matthew

On Wed, Apr 08, 2020 at 08:19:59 +0545, Matthew Reus wrote:
> Hello i m using ubuntu 18.04 server with f
> *fmpeg version N-94396-g47b6ca0 Copyright (c) 2000-2019 *
> My question is how can we compress the stream using H264 with high quality
> with lower bit rate , till now i m defining FTA hd channel upto 5 MBps but
> i want it decrease to 2 Mbps without quality loss , Is that possible?

Firstly, technically speaking: no, that is not possible. Any
(re-)encode with a lossy codec results in quality loss.

The question is whether that loss is visible, and whether it's
acceptable. And judging that is totally up to you (or your customers).

So, as a first step, just try reducing your 5 Mb/s to 2 Mb/s and see
what happens.

Secondly, encoding is basically a trade-off between encoding speed,
resulting size (file size or bit rate), and quality. Up to certain
limits, you can sacrifice one for the other. E.g. you can get a higher
compression rate out of some codecs by putting more CPU/GPU (or more
time, if you're no realtime) into encoding.

For the h264_nvenc codec, I'm sure the presets provide some practical
control over this trade-off. Check out that option.

I also found this very long summary on encoding with h264_nvenc:

You may want to check it out.

> yadif_cuda=mode=0:-1:0,scale_npp=1920:1080 -r 25 -b:v 6M -bf 2 -g 150 -c:a
> aac -b:a 128k -ar 48000 -strict -2 -f flv

I don't see how you achieve 5 Mb/s is you encode with "-b:v 6M" and "-b:a
128k", that's more than 6.1 Mb/s.


More information about the ffmpeg-user mailing list