[FFmpeg-devel] [PATCH] HDR Transcode VUI Info Copy

wm4 nfxjfg at googlemail.com
Tue Apr 4 18:14:30 EEST 2017


On Tue, 4 Apr 2017 17:01:15 +0200
Michael Niedermayer <michael at niedermayer.cc> wrote:

> On Mon, Apr 03, 2017 at 07:50:07PM +0000, Ben Chang wrote:
> > Hi,
> > 
> > This patch adds copy of HDR  VUI info from decode ctx to encode ctx. Currently, information under colour_description_present_flag (eg. colour primaries, transfer_characteristics, matrix_coeffs) do not get copied to output stream when trancode happens.
> > 
> > Testing performed:
> > ffmpeg.exe -y -hwaccel cuvid -vcodec hevc_cuvid -i input.h265 -vcodec hevc_nvenc output.h265
> > Ensure the output bitstream contains the same colour_description_present_flag fields as input.
> > 
> > Also attaching previous discussion on this subject.
> > 
> > Thanks,
> > Ben
> > 
> > -----------------------------------------------------------------------------------
> > This email message is for the sole use of the intended recipient(s) and may contain
> > confidential information.  Any unauthorized review, use, disclosure or distribution
> > is prohibited.  If you are not the intended recipient, please contact the sender by
> > reply email and destroy all copies of the original message.
> > -----------------------------------------------------------------------------------  
> 
> >  ffmpeg.c |    3 +++
> >  1 file changed, 3 insertions(+)
> > 8a8befe4fc47b7279b15d655e39b12ca36be4bc2  HDR_transcode_VUI_copy.patch
> > From c8092bc538ba7ae32357ca166e67809eb3705f60 Mon Sep 17 00:00:00 2001
> > From: Ben Chang <benc at nvidia.com>
> > Date: Mon, 27 Mar 2017 17:00:19 -0700
> > Subject: [PATCH] Allow transfer of HDR-required VUI info from dec ctx to enc
> >  ctx
> > 
> > ---
> >  ffmpeg.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/ffmpeg.c b/ffmpeg.c
> > index 532db80..1ef2906 100644
> > --- a/ffmpeg.c
> > +++ b/ffmpeg.c
> > @@ -3239,6 +3239,9 @@ static int init_output_stream_encode(OutputStream *ost)
> >          dec_ctx = ist->dec_ctx;
> >  
> >          enc_ctx->chroma_sample_location = dec_ctx->chroma_sample_location;
> > +        enc_ctx->color_primaries = dec_ctx->color_primaries;
> > +        enc_ctx->color_trc = dec_ctx->color_trc;
> > +        enc_ctx->colorspace = dec_ctx->colorspace;  
> 
> These should at a minimum check the encoder and decoder use the same
> pixel format, otherwise these details are more likley wrong than right
> if they arent passed through avfilter in some form

The pixel format is entirely meaningless here.


More information about the ffmpeg-devel mailing list