[FFmpeg-cvslog] ffmpeg: allow disabling streams by type for inputs
Gyan Doshi
git at videolan.org
Thu Jan 3 12:44:52 EET 2019
ffmpeg | branch: master | Gyan Doshi <ffmpeg at gyani.pro> | Sat Dec 29 16:37:09 2018 +0530| [3ba5eef2c7b21a1af48d8d9ccb58f2ed4ebc874a] | committer: Gyan Doshi
ffmpeg: allow disabling streams by type for inputs
-vn/-an/-sn/-dn now works for input. Streams are still registered in
input_streams but they can't be automatically selected or mapped or
filtered.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ba5eef2c7b21a1af48d8d9ccb58f2ed4ebc874a
---
fftools/ffmpeg_opt.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 050a65c2c1..a99e762dc6 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -760,6 +760,13 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
MATCH_PER_STREAM_OPT(discard, str, discard_str, ic, st);
ist->user_set_discard = AVDISCARD_NONE;
+
+ if ((o->video_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) ||
+ (o->audio_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) ||
+ (o->subtitle_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) ||
+ (o->data_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA))
+ ist->user_set_discard = AVDISCARD_ALL;
+
if (discard_str && av_opt_eval_int(&cc, discard_opt, discard_str, &ist->user_set_discard) < 0) {
av_log(NULL, AV_LOG_ERROR, "Error parsing discard %s.\n",
discard_str);
More information about the ffmpeg-cvslog
mailing list