aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_mux_init.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-05-28 17:45:46 +0200
committerAnton Khirnov <anton@khirnov.net>2023-06-05 16:15:04 +0200
commit93e26a4db7784ca1372022ce7fea4a103eaf9a47 (patch)
treedb053899ed32cbade7a9ac4d4c562b06f59c9bc1 /fftools/ffmpeg_mux_init.c
parent58a64e3d544dcedbfeebaabae19bcafce4f8b919 (diff)
downloadffmpeg-93e26a4db7784ca1372022ce7fea4a103eaf9a47.tar.gz
fftools/ffmpeg: handle -enc_time_base -1 during stream creation
There is no reason to postpone it until opening the encoder. Also, abort when the input stream is unknown, rather than disregard an explicit request from the user.
Diffstat (limited to 'fftools/ffmpeg_mux_init.c')
-rw-r--r--fftools/ffmpeg_mux_init.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index d0b89cd188..c49f906dc7 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -1149,6 +1149,15 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o,
av_log(ost, AV_LOG_FATAL, "Invalid time base: %s\n", enc_time_base);
exit_program(1);
}
+ if (q.num < 0) {
+ if (!ost->ist) {
+ av_log(ost, AV_LOG_FATAL,
+ "Cannot use input stream timebase for encoding - "
+ "no input stream available\n");
+ exit_program(1);
+ }
+ q = ost->ist->st->time_base;
+ }
ost->enc_timebase = q;
}
} else {