From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 925484A7BF for ; Tue, 9 Apr 2024 13:01:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AC64668D188; Tue, 9 Apr 2024 16:01:38 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9EE7068D16C for ; Tue, 9 Apr 2024 16:01:32 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1712667692; bh=Z+Lh4KGSILAnWuRN4KNGXcJQD80Ql9Se52iMNM10TBE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=S9oFy4VRmwxbNE2yuEtal/1I809njYX3+FOJe4fN8TXJ2O3rE5ao0ovT5YYse52s3 VWLr/jpUG4EId5wZzXQ+JpMYqMM0KDdiH6RuAsKC5ct9W4rOWzGoJ/qFcgGsbzkVUB pahCc3Pci+lCe2/PDIDKAUOGP8A+6KdulACaYTZM= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 7643E40006; Tue, 9 Apr 2024 15:01:32 +0200 (CEST) Date: Tue, 9 Apr 2024 15:01:32 +0200 Message-ID: <20240409150132.GD62311@haasn.xyz> From: Niklas Haas To: ffmpeg-devel@ffmpeg.org In-Reply-To: <20240408125950.53472-14-ffmpeg@haasn.xyz> References: <20240408125950.53472-1-ffmpeg@haasn.xyz> <20240408125950.53472-14-ffmpeg@haasn.xyz> MIME-Version: 1.0 Content-Disposition: inline Subject: Re: [FFmpeg-devel] [PATCH v2 13/17] fftools/ffmpeg_filter: set strict_std_compliance X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Niklas Haas Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Mon, 08 Apr 2024 14:57:17 +0200 Niklas Haas wrote: > From: Niklas Haas > > For avcodec_get_supported_config(), which requires this value be set on > the actual ost->enc_ctx being queried. > --- > fftools/ffmpeg_filter.c | 16 ++++++---------- > 1 file changed, 6 insertions(+), 10 deletions(-) > > diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c > index ac04841a16c..9ff064f5f68 100644 > --- a/fftools/ffmpeg_filter.c > +++ b/fftools/ffmpeg_filter.c > @@ -770,6 +770,7 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, > FilterGraph *fg = ofilter->graph; > FilterGraphPriv *fgp = fgp_from_fg(fg); > const AVCodec *c = ost->enc_ctx->codec; > + const AVDictionaryEntry *strict = av_dict_get(ost->encoder_opts, "strict", NULL, 0); > int ret; > > av_assert0(!ofilter->ost); > @@ -780,6 +781,10 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, > ofp->ts_offset = of->start_time == AV_NOPTS_VALUE ? 0 : of->start_time; > ofp->enc_timebase = ost->enc_timebase; > > + /* Ensure this is up-to-date for avcodefc_get_supported_config() */ > + if (strict) > + av_opt_set(ost->enc_ctx, strict->key, strict->value, 0); > + > switch (ost->enc_ctx->codec_type) { > case AVMEDIA_TYPE_VIDEO: > ofp->width = ost->enc_ctx->width; > @@ -800,16 +805,7 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost, > { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, > AV_PIX_FMT_NONE }; > > - const AVDictionaryEntry *strict = av_dict_get(ost->encoder_opts, "strict", NULL, 0); > - int strict_val = ost->enc_ctx->strict_std_compliance; > - > - if (strict) { > - const AVOption *o = av_opt_find(ost->enc_ctx, strict->key, NULL, 0, 0); > - av_assert0(o); > - av_opt_eval_int(ost->enc_ctx, o, strict->value, &strict_val); > - } > - > - if (strict_val > FF_COMPLIANCE_UNOFFICIAL) > + if (ost->enc_ctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) > ofp->formats = mjpeg_formats; > } > } > -- > 2.44.0 > Note: Will be no longer needed if elenril's encoder_opts series is merged first, so that would be preferred as this is sort of a hack. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".