From patchwork Mon Apr 5 11:09:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 26762 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 21B2744B387 for ; Mon, 5 Apr 2021 14:14:27 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5535168A987; Mon, 5 Apr 2021 14:12:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5686668A682 for ; Mon, 5 Apr 2021 14:11:50 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 23952240698 for ; Mon, 5 Apr 2021 13:11:48 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 0bKAALi6xQlT for ; Mon, 5 Apr 2021 13:11:47 +0200 (CEST) Received: from libav.khirnov.net (unknown [IPv6:2a00:c500:561:201:b6e1:23d0:924a:11c0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 547AC24069B for ; Mon, 5 Apr 2021 13:11:42 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 92B713A08EC; Mon, 5 Apr 2021 13:11:39 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 5 Apr 2021 13:09:47 +0200 Message-Id: <20210405110952.17679-11-anton@khirnov.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210405110952.17679-1-anton@khirnov.net> References: <20210405110952.17679-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/17] fftools/ffmpeg: copy average framerate for streamcopy, when known X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- fftools/ffmpeg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)