From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id F28E145FDD for ; Thu, 29 Jun 2023 09:44:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D57B968C36B; Thu, 29 Jun 2023 12:44:36 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2200268AB9E for ; Thu, 29 Jun 2023 12:44:31 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id BDE712404EC for ; Thu, 29 Jun 2023 11:44:30 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 5XQjs-_vIefv for ; Thu, 29 Jun 2023 11:44:30 +0200 (CEST) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (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 "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 2681B2404EA for ; Thu, 29 Jun 2023 11:44:30 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id 064291601B2; Thu, 29 Jun 2023 11:44:30 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: =?utf-8?q?=3CDM6PR11MB2681EFA002F158F0E7B28637B125A=40DM6PR11MB?= =?utf-8?q?2681=2Enamprd11=2Eprod=2Eoutlook=2Ecom=3E?= References: =?utf-8?q?=3CDM6PR11MB26814011FF82B8637DF846B7B14DA=40DM6PR11MB2?= =?utf-8?q?681=2Enamprd11=2Eprod=2Eoutlook=2Ecom=3E?= <168796589909.21886.12641050031611059268@lain.khirnov.net> =?utf-8?q?=3CDM6?= =?utf-8?q?PR11MB2681EFA002F158F0E7B28637B125A=40DM6PR11MB2681=2Enamprd11=2E?= =?utf-8?q?prod=2Eoutlook=2Ecom=3E?= Mail-Followup-To: FFmpeg development discussions and patches Date: Thu, 29 Jun 2023 11:44:29 +0200 Message-ID: <168803186999.21886.14291836970349116392@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v2] avformat/ivfenc: Set the "number of frames" in IVF header X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting Dai, Jianhui J (2023-06-29 08:03:18) > > > > -----Original Message----- > > From: ffmpeg-devel On Behalf Of > > Anton Khirnov > > Sent: Wednesday, June 28, 2023 11:25 PM > > To: ffmpeg-devel@ffmpeg.org > > Subject: Re: [FFmpeg-devel] [PATCH v2] avformat/ivfenc: Set the "number of > > frames" in IVF header > > > > Quoting Dai, Jianhui J (2023-06-05 02:53:35) > > > diff --git a/libavformat/ivfdec.c b/libavformat/ivfdec.c index > > > 511f2387ed..01012db948 100644 > > > --- a/libavformat/ivfdec.c > > > +++ b/libavformat/ivfdec.c > > > @@ -53,6 +53,7 @@ static int read_header(AVFormatContext *s) > > > st->codecpar->height = avio_rl16(s->pb); > > > time_base.den = avio_rl32(s->pb); > > > time_base.num = avio_rl32(s->pb); > > > + // Infer duration from "number of frames". > > > st->duration = avio_rl32(s->pb); > > > > This should be setting st->nb_frames then rather than duration. > > And the muxer should be using that field as well instead of its custom version. > > ACK. > Do you suggest letting `duration` unset? > It is interesting that the 'duration' is often right in this way, if > the time_base.den/time_base.num == fps which is the popular > configuration. Yes, but AFAIU there is no way to tell whether the file is CFR, so then the value would be unreliable. So I'd prefer to leave it unset. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".