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 C668842DDB for ; Sun, 8 May 2022 07:17:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D996C68B104; Sun, 8 May 2022 10:17:16 +0300 (EEST) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EEE1D6881B1 for ; Sun, 8 May 2022 10:17:10 +0300 (EEST) Received: by mail-pj1-f44.google.com with SMTP id e24so10595104pjt.2 for ; Sun, 08 May 2022 00:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=NfljcRiteH3OTQFzZ6mHvyMOAPGGHOL96cR1lVTwwRk=; b=ePrSok8QYPggVWqWhxlrs2hilW0w9cWaDjqPa4T8DcdikXqecMERXpMSLWJF4ylCY5 FtOtZRazyBMcCVNvw+YnoK0cklX9/Q9LYIeV8RZ1kdAtf5m3gjagc/ejtg9TWHuNaTjt BeIVSsRmt5+elh7Ad24HbLQZRXlC8l1b04vVRpB6r2NHTgjAYrpJ5ZyV1CgOgrSefoow Y/NvqNsHpfWQre592J+s2dpsWF6Hy1SagixmkgmWDLflXAUfUmo0POCCf4aH1exYcbF1 0Y72MGDLkPCHGwv+P/xTwhtmwPgWaWy89kMjtH6XjjEIBlIV1KAhaBOTj4ZkwrfjjhLc bdbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NfljcRiteH3OTQFzZ6mHvyMOAPGGHOL96cR1lVTwwRk=; b=kAD5r+S7Drj90GaBw0yUWA+YuJlUxpC6OrTviVejJDYtbzueNfqymTfTHZTBKME5CI zktW69tqOsVYd312CHYKW3Ni2wC+xqLu7eurK3vABMmOdLGzK7Fm8rxBr9loFNRPqaIm WAJBYo9UeXxWWIDHyy1I4aXrbq2sVFGDfctPLqgj8zpdE5dgJQ4LzmXUiKpLUTf1uXSZ j1rzqln9nU+Ggesj9uj9PeH/PCWBkR0iBFuxJlWOXDLvYwYq3uTQorNT4IrGZDP3g1NL dyQalkWzBq4tHOShgFQ2dXQuqLyN8XPg6Ggsqv0Y9w7B399qbbS6/9U/O14I4MGwhmgz ivtA== X-Gm-Message-State: AOAM530kRF6RqXRzj3nc1CGfI9Hja7VDmhhdkJnrd+RE04g96A3YBB2k bxsMoq98fp6pQHa2TqbEfLNBu+EQdlU= X-Google-Smtp-Source: ABdhPJxmm0pG8ZpWtfHoK/4xsPWccLxz86fDy9kEmRaNpVCE6zEEd4O6aR3y1kRIZd2nvsTgHl4qmw== X-Received: by 2002:a17:902:7e06:b0:159:6c1:ea2b with SMTP id b6-20020a1709027e0600b0015906c1ea2bmr10744781plm.105.1651994228049; Sun, 08 May 2022 00:17:08 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id c3-20020a170902b68300b0015eee3ab203sm4239607pls.49.2022.05.08.00.17.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 May 2022 00:17:07 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Sun, 8 May 2022 15:17:00 +0800 Message-Id: <1651994221-11660-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 Subject: [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 Cc: Limin Wang MIME-Version: 1.0 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: 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 _______________________________________________ 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".