summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-04-05 10:48:43 +0200
committerAnton Khirnov <anton@khirnov.net>2021-04-08 11:03:15 +0200
commitf6ea2ee005740247a446d28174943b3606721967 (patch)
treec7a6a9f5d22f4fcc88c5ff8fa470b7b69e5345aa
parent04feb1c0382104c36d2297a277ffd1450d016d35 (diff)
fftools/ffmpeg: copy average framerate for streamcopy, when known
-rw-r--r--fftools/ffmpeg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 8e6206647f..3ad11452da 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3144,7 +3144,11 @@ static int init_output_stream_streamcopy(OutputStream *ost)
if (!ost->frame_rate.num)
ost->frame_rate = ist->framerate;
- ost->st->avg_frame_rate = ost->frame_rate;
+
+ if (ost->frame_rate.num)
+ ost->st->avg_frame_rate = ost->frame_rate;
+ else
+ ost->st->avg_frame_rate = ist->st->avg_frame_rate;
ret = avformat_transfer_internal_stream_timing_info(of->ctx->oformat, ost->st, ist->st, copy_tb);
if (ret < 0)