[Libav-user] Forced to use force-cfr param in order to get fair bit rate on x264

Leandro Moreira leandro.ribeiro.moreira at gmail.com
Sun Jan 5 04:10:54 EET 2020


Hi,

I wrote a simple video transmuxer/transcoder minimalist
<https://github.com/leandromoreira/ffmpeg-libav-tutorial/blob/60608711f0d343f0f3f8110c0a6b304780d40755/3_transcoding.c#L173>
to teach people how to use ffmpeg/libav. The goal of this program is to
enable its users to do transmuxing (mp4 -> fmp4) and transcoding (h264 ->
h264 fixed gop/CBR, h264 -> h265) with the minimum required code.

It's working but I think I'm missing something because I had to use
*force-cfr=1* for x264 but not for x265, when I remove this force-cfr
parameter from x264 the encoded final gets a huge bitrate (27Mbps) and I
don't know why, it's frustrating.

The code was inspired by the doc/examples and ffmpeg command line itself I
set the TB and duration and also checked the pkt.dts and pkt.pts all seems
fine =(

Do you have any ideas what I missing? (on x264's case) I detail these
issues better in a PR if you want to see
<https://github.com/leandromoreira/ffmpeg-libav-tutorial/pull/54> it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200104/fdc860db/attachment.html>


More information about the Libav-user mailing list