fftools/ffmpeg_mux: set stream duration after the timebase is certainly known

Stop assuming the encoder knows the muxing timebase, which does not
always have to hold (e.g. due to bitstream filters).
This commit is contained in:
Anton Khirnov
2023-05-28 10:43:36 +02:00
parent ba1141d8a9
commit 57021a68d9
4 changed files with 14 additions and 8 deletions

View File

@@ -666,6 +666,11 @@ int of_stream_init(OutputFile *of, OutputStream *ost)
if (ret < 0)
return ret;
if (ms->stream_duration) {
ost->st->duration = av_rescale_q(ms->stream_duration, ms->stream_duration_tb,
ost->st->time_base);
}
ost->initialized = 1;
return mux_check_init(mux);