ffmpeg: Fix shortest with libx264
Encoders that buffer a significant number of frames where a "few" frames off with -shortest Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
1b9ced685a
commit
c4a32d92fe
5
ffmpeg.c
5
ffmpeg.c
@ -597,9 +597,8 @@ static void close_output_stream(OutputStream *ost)
|
|||||||
|
|
||||||
ost->finished = 1;
|
ost->finished = 1;
|
||||||
if (of->shortest) {
|
if (of->shortest) {
|
||||||
int i;
|
int64_t end = av_rescale_q(ost->sync_opts - ost->first_pts, ost->st->codec->time_base, AV_TIME_BASE_Q);
|
||||||
for (i = 0; i < of->ctx->nb_streams; i++)
|
of->recording_time = FFMIN(of->recording_time, end);
|
||||||
output_streams[of->ost_index + i]->finished = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user