You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
fftools/ffmpeg_mux_init: only process -enc_time_base if the stream is encoded
It has no effect otherwise.
This commit is contained in:
@@ -1073,6 +1073,7 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o,
|
|||||||
AVIOContext *s = NULL;
|
AVIOContext *s = NULL;
|
||||||
char *buf = NULL, *arg = NULL, *preset = NULL;
|
char *buf = NULL, *arg = NULL, *preset = NULL;
|
||||||
const char *enc_stats_pre = NULL, *enc_stats_post = NULL, *mux_stats = NULL;
|
const char *enc_stats_pre = NULL, *enc_stats_post = NULL, *mux_stats = NULL;
|
||||||
|
const char *enc_time_base = NULL;
|
||||||
|
|
||||||
ost->encoder_opts = filter_codec_opts(o->g->codec_opts, enc->codec_id,
|
ost->encoder_opts = filter_codec_opts(o->g->codec_opts, enc->codec_id,
|
||||||
oc, st, enc->codec);
|
oc, st, enc->codec);
|
||||||
@@ -1139,6 +1140,17 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
exit_program(1);
|
exit_program(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MATCH_PER_STREAM_OPT(enc_time_bases, str, enc_time_base, oc, st);
|
||||||
|
if (enc_time_base) {
|
||||||
|
AVRational q;
|
||||||
|
if (av_parse_ratio(&q, enc_time_base, INT_MAX, 0, NULL) < 0 ||
|
||||||
|
q.den <= 0) {
|
||||||
|
av_log(ost, AV_LOG_FATAL, "Invalid time base: %s\n", enc_time_base);
|
||||||
|
exit_program(1);
|
||||||
|
}
|
||||||
|
ost->enc_timebase = q;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ost->encoder_opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
|
ost->encoder_opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
|
||||||
}
|
}
|
||||||
@@ -1162,17 +1174,6 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o,
|
|||||||
st->time_base = q;
|
st->time_base = q;
|
||||||
}
|
}
|
||||||
|
|
||||||
MATCH_PER_STREAM_OPT(enc_time_bases, str, time_base, oc, st);
|
|
||||||
if (time_base) {
|
|
||||||
AVRational q;
|
|
||||||
if (av_parse_ratio(&q, time_base, INT_MAX, 0, NULL) < 0 ||
|
|
||||||
q.den <= 0) {
|
|
||||||
av_log(ost, AV_LOG_FATAL, "Invalid time base: %s\n", time_base);
|
|
||||||
exit_program(1);
|
|
||||||
}
|
|
||||||
ost->enc_timebase = q;
|
|
||||||
}
|
|
||||||
|
|
||||||
ms->max_frames = INT64_MAX;
|
ms->max_frames = INT64_MAX;
|
||||||
MATCH_PER_STREAM_OPT(max_frames, i64, ms->max_frames, oc, st);
|
MATCH_PER_STREAM_OPT(max_frames, i64, ms->max_frames, oc, st);
|
||||||
for (i = 0; i<o->nb_max_frames; i++) {
|
for (i = 0; i<o->nb_max_frames; i++) {
|
||||||
|
Reference in New Issue
Block a user