Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: lance.lmwang@gmail.com
To: ffmpeg-devel@ffmpeg.org
Cc: Limin Wang <lance.lmwang@gmail.com>
Subject: [FFmpeg-devel] [PATCH 1/2] avfilter/src_movie: add dec_opts for the opened file
Date: Sun,  8 May 2022 15:17:00 +0800
Message-ID: <1651994221-11660-1-git-send-email-lance.lmwang@gmail.com> (raw)

From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 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".

             reply	other threads:[~2022-05-08  7:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-08  7:17 lance.lmwang [this message]
2022-05-08  7:17 ` [FFmpeg-devel] [PATCH 2/2] avcodec: add an AVCodecContext flag to export A53/SCTE20/DVD CC side data on demand lance.lmwang
2022-05-11 12:00   ` Anton Khirnov
2022-05-11 13:30     ` lance.lmwang
2022-05-19  9:12       ` Anton Khirnov
2022-05-19 12:31         ` lance.lmwang
2022-05-18 13:43 ` [FFmpeg-devel] [PATCH 1/2] avfilter/src_movie: add dec_opts for the opened file lance.lmwang
2022-05-18 14:50 ` "zhilizhao(赵志立)"
2022-05-19 12:14   ` lance.lmwang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1651994221-11660-1-git-send-email-lance.lmwang@gmail.com \
    --to=lance.lmwang@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git