]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/nvenc: Generate bufferingPeriod/pictureTiming SEI
authorTimo Rothenpieler <timo@rothenpieler.org>
Wed, 11 May 2016 08:34:31 +0000 (10:34 +0200)
committerTimo Rothenpieler <timo@rothenpieler.org>
Wed, 11 May 2016 08:34:31 +0000 (10:34 +0200)
For some unknown reason enabling these causes propper CBR padding,
so as there are no known downsides just always enable them in CBR mode.

libavcodec/nvenc.c

index bcafc20c033e612a892b797435b32d3aae8251a1..4d4a647bb75b971724fb5ebb1088c7fbc4c11979 100644 (file)
@@ -796,6 +796,11 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
             if (avctx->codec->id == AV_CODEC_ID_H264) {
                 ctx->encode_config.encodeCodecConfig.h264Config.adaptiveTransformMode = NV_ENC_H264_ADAPTIVE_TRANSFORM_ENABLE;
                 ctx->encode_config.encodeCodecConfig.h264Config.fmoMode = NV_ENC_H264_FMO_DISABLE;
+                ctx->encode_config.encodeCodecConfig.h264Config.outputBufferingPeriodSEI = 1;
+                ctx->encode_config.encodeCodecConfig.h264Config.outputPictureTimingSEI = 1;
+            } else if(avctx->codec->id == AV_CODEC_ID_H265) {
+                ctx->encode_config.encodeCodecConfig.hevcConfig.outputBufferingPeriodSEI = 1;
+                ctx->encode_config.encodeCodecConfig.hevcConfig.outputPictureTimingSEI = 1;
             }
         }
     } else if (avctx->global_quality > 0) {