[Libav-user] Questions about transcoding h264 and h265

Leandro Moreira leandro.ribeiro.moreira at gmail.com
Sun Dec 29 02:01:50 EET 2019

Hello there,

I'm writing this tutorial
<https://github.com/leandromoreira/ffmpeg-libav-tutorial> and right now I'm
attempting to create a section for transcoding

1) Is there a single way to setup GOP and scenecut for h264 and h265?

> I tried to use avcodectxt->gop_size, avcodectxt->keyint_min,
> av_opt_set(avcodecctxt->priv_data, "sc_threshold", "0", 0) but it seemed to
> work only for h264... to make it work I forced the priv_data x264 and
> x265-params while looking at the source code of both plugins I saw h264
> uses gop_size but not h265 (both x___ libs)
2) Is there a single way to setup "CBR" for h264 and h265?

> I could get the expected results while using x264 but no x265 using
> |encoder_codec_context->bit_rate = 1200 * 1000;
> |encoder_codec_context->rc_max_rate = 1200 * 1000;
> |encoder_codec_context->rc_min_rate = 1200 * 1000;
> |encoder_codec_context->rc_buffer_size = 2 * 1200 * 1000;
> here it's weird because at source code level both libs seems to use rc_max_rate
> and rc_buffer_size
3) After I transcoded with my code
I'm getting a 60.11 fps while the original video has fixed 60fps, why this
usually happens?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20191228/e586dc36/attachment.html>

More information about the Libav-user mailing list