[FFmpeg-devel] [PATCH] nvenc set slice number to 1 to improve encoding quality

Timo Rothenpieler timo at rothenpieler.org
Fri Dec 4 20:26:56 CET 2015


> --- libavcodec/nvenc.c | 3 +++ 1 file changed, 3 insertions(+)
> 
> diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index
> 43b8e78..b8f7f91 100644 --- a/libavcodec/nvenc.c +++
> b/libavcodec/nvenc.c @@ -762,6 +762,9 @@ static av_cold int
> nvenc_encode_init(AVCodecContext *avctx) } }
> 
> +    ctx->encode_config.encodeCodecConfig.h264Config.sliceMode =
> 3; +
> ctx->encode_config.encodeCodecConfig.h264Config.sliceModeData = 1;

It's missing a check if we are encoding h264 or hevc.
Does it have any negative sideeffects, or does it just increase the
image quality?

> /* when there're b frames, set dts offset */ if
> (ctx->encode_config.frameIntervalP >= 2) ctx->last_dts = -2;


More information about the ffmpeg-devel mailing list