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 3AF5843007 for ; Wed, 18 May 2022 13:43:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9851D68B475; Wed, 18 May 2022 16:43:25 +0300 (EEST) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9A19368B43B for ; Wed, 18 May 2022 16:43:19 +0300 (EEST) Received: by mail-pl1-f180.google.com with SMTP id n18so1808034plg.5 for ; Wed, 18 May 2022 06:43:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=JCA4CzQdS56OkEVadiFD0QY6YnXO0qg0jZUmykJVwzA=; b=e2jGLwSM0ZOgc079oVK/ZGgyBZWSS3NUrYURvP+MCdBkPiGP6rQiabKZ80roz17P2S B8rc8REuHXmgAEdY/dQT6B/xiEEvo4aDw5rlVSl8+K0I65E556zUt7t3LniSHLxXTf1O +TKBJTH03aOzTdyoCpEhXRsFKrECwAljKcrMybE1fjKji29LsFEF2tSr+e84ZJAUTv3e 3V8ToJwLBqovsnd+Q4LaELraQ4GYyQfvuP2732GC8hoyMxIDKapAtyuYnzQOOvyzdG3E FNfAXT4VvMH9qqAiXVdo6NM93fYMytxmKFomPqXZxGoVKhmVQ8uAcnQUoMgGuuNGWX7P I0PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=JCA4CzQdS56OkEVadiFD0QY6YnXO0qg0jZUmykJVwzA=; b=A0EzdNo6Od+h9RYldnfTNdB3PZimAsnLEPzTANktZMxGtdFLhtCy25xBZAwVCXqI+n kDOgxFSfqc8bk1d5q6ndBzeQUwafjrn5OrbOmcE6zbK/MnjQPP+pLn4VXPuYafUPQRj3 EYlaOoyY/0Ygl9DO1TaQv1N2iv9ZwdYvlrvymvOtA5ic12izKzTvnlwm/6ltMGOfh/Xv /DnMFmZOOGUClPXF28BB4H8DigJ7Qvr6K3fg5qTKrjaaQn7veY96UJ9OlNrNoBcekkiD JWdULVk9USzrjdT+n1xn+F0I67lvF6oFk/rBcYvjylGFKX6QY5AHNl5QYU1Vc27LXLDt 1utQ== X-Gm-Message-State: AOAM532OErSckO7XWxXwE/aJnfnzSNUCnlUBddRbCvXlmIph11H4YQBU Wf2EXTwDCe5rd1dz+NsUK0CssaeOBxk= X-Google-Smtp-Source: ABdhPJyTWL2G/pRFPzbvML+4/dnZSsTNf92jN8Hbxwhk8D5bK/CVAx5yCjrYirJXkzF9lJbTvHTDGg== X-Received: by 2002:a17:90a:4b87:b0:1df:591d:e9bc with SMTP id i7-20020a17090a4b8700b001df591de9bcmr74901pjh.74.1652881397256; Wed, 18 May 2022 06:43:17 -0700 (PDT) Received: from gmail.com ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id ix1-20020a170902f80100b0015e8d4eb23esm1699346plb.136.2022.05.18.06.43.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 May 2022 06:43:17 -0700 (PDT) Date: Wed, 18 May 2022 21:43:14 +0800 From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Message-ID: <20220518134314.GB23120@gmail.com> Mail-Followup-To: ffmpeg-devel@ffmpeg.org References: <1651994221-11660-1-git-send-email-lance.lmwang@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1651994221-11660-1-git-send-email-lance.lmwang@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH 1/2] avfilter/src_movie: add dec_opts for the opened file 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 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 Sun, May 08, 2022 at 03:17:00PM +0800, lance.lmwang@gmail.com wrote: > From: Limin Wang > > Signed-off-by: Limin Wang > --- > doc/filters.texi | 9 +++++++++ > libavfilter/src_movie.c | 5 ++++- > 2 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/doc/filters.texi b/doc/filters.texi > index 367614d2f8..6775cf43ba 100644 > --- a/doc/filters.texi > +++ b/doc/filters.texi > @@ -29652,6 +29652,15 @@ shows how to add protocol_whitelist and protocol_blacklist options: > ffplay -f lavfi > "movie=filename='1.sdp':format_opts='protocol_whitelist=file,rtp,udp\:protocol_blacklist=http'" > @end example > + > +@item dec_opts > +Specify decode options for the opened file. Format options can be specified > +as a list of @var{key}=@var{value} pairs separated by ':'. The following example > +shows how to add export_side_data options: > +@example > +./ffmpeg -y -f lavfi > +-i "movie=./input.ts:dec_opts=export_side_data=scte20cc[out0+subcc]" out.srt > +@end example > @end table > > It allows overlaying a second video on top of the main input of > diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c > index 711854c23c..c7dbd90aa9 100644 > --- a/libavfilter/src_movie.c > +++ b/libavfilter/src_movie.c > @@ -70,6 +70,7 @@ typedef struct MovieContext { > int64_t discontinuity_threshold; > int64_t ts_offset; > int dec_threads; > + AVDictionary *dec_opts; > > AVFormatContext *format_ctx; > > @@ -96,6 +97,7 @@ static const AVOption movie_options[]= { > { "discontinuity", "set discontinuity threshold", OFFSET(discontinuity_threshold), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, INT64_MAX, FLAGS }, > { "dec_threads", "set the number of threads for decoding", OFFSET(dec_threads), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS }, > { "format_opts", "set format options for the opened file", OFFSET(format_opts), AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, FLAGS}, > + { "dec_opts", "set decode options for the opened file", OFFSET(dec_opts), AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, FLAGS}, > { NULL }, > }; > > @@ -158,6 +160,7 @@ static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec) > > static int open_stream(AVFilterContext *ctx, MovieStream *st, int dec_threads) > { > + MovieContext *movie = ctx->priv; > const AVCodec *codec; > int ret; > > @@ -179,7 +182,7 @@ static int open_stream(AVFilterContext *ctx, MovieStream *st, int dec_threads) > dec_threads = ff_filter_get_nb_threads(ctx); > st->codec_ctx->thread_count = dec_threads; > > - if ((ret = avcodec_open2(st->codec_ctx, codec, NULL)) < 0) { > + if ((ret = avcodec_open2(st->codec_ctx, codec, &movie->dec_opts)) < 0) { > av_log(ctx, AV_LOG_ERROR, "Failed to open codec\n"); > return ret; > } > -- > 2.35.1 > will apply the patchset tomorrow if no other comments or objection. -- Thanks, Limin Wang _______________________________________________ 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".