ffmpeg: Add -time_base option to hint the time base

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Bradshaw
2016-12-27 22:05:35 -08:00
committed by Michael Niedermayer
parent 743052ec5b
commit 3ac46a0a62
3 changed files with 21 additions and 3 deletions

View File

@ -2905,7 +2905,8 @@ static int init_output_stream_streamcopy(OutputStream *ost)
return ret;
// copy timebase while removing common factors
ost->st->time_base = av_add_q(av_stream_get_codec_timebase(ost->st), (AVRational){0, 1});
if (ost->st->time_base.num <= 0 || ost->st->time_base.den <= 0)
ost->st->time_base = av_add_q(av_stream_get_codec_timebase(ost->st), (AVRational){0, 1});
// copy disposition
ost->st->disposition = ist->st->disposition;
@ -3330,7 +3331,8 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
}
// copy timebase while removing common factors
ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
if (ost->st->time_base.num <= 0 || ost->st->time_base.den <= 0)
ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
ost->st->codec->codec= ost->enc_ctx->codec;
} else if (ost->stream_copy) {
ret = init_output_stream_streamcopy(ost);