On Tue, Apr 04, 2017 at 06:04:37AM +0200, wm4 wrote: > On Mon, 3 Apr 2017 19:50:07 +0000 > Ben Chang <b...@nvidia.com> wrote: > > > From c8092bc538ba7ae32357ca166e67809eb3705f60 Mon Sep 17 00:00:00 2001 > > From: Ben Chang <b...@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; > > } else { > > for (j = 0; j < oc->nb_streams; j++) { > > AVStream *st = oc->streams[j]; > > The line you base those on isn't really correct. This should go > through libavfilter, i.e. using the first AVFrame's parameters. > The reason is that libavfilter might change the colorspace parameters. > So you need to somehow grab the queued AVFrame, and use its fields > instead of the dec_ctx.
It would be better to add the parameters alognside sample_aspect_ratio in AVFilterLink. That way user apps can get such parameters through at init time much simpler. Iternally avfilter could use a AVFrame maybe to obtain these The first AVFrame might not represent the parameters which are most correct for the whole movie or it may occur long after other streams start > > (Although maybe I'm asking too much - the required change isn't that > simple, and more work than just logically extending something that > already exists.) yes [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have often repented speaking, but never of holding my tongue. -- Xenocrates
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel