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 E775540780 for ; Wed, 22 Dec 2021 22:04:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9C41868B0D7; Thu, 23 Dec 2021 00:04:10 +0200 (EET) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1AB4168A8FD for ; Thu, 23 Dec 2021 00:04:04 +0200 (EET) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 70539E0006 for ; Wed, 22 Dec 2021 22:04:03 +0000 (UTC) Date: Wed, 22 Dec 2021 23:04:02 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20211222220402.GF2829255@pb2> References: <837ff72bd80c351924dc4cf0d96c003f082681f3.camel@kepstin.ca> MIME-Version: 1.0 In-Reply-To: <837ff72bd80c351924dc4cf0d96c003f082681f3.camel@kepstin.ca> Subject: Re: [FFmpeg-devel] [RFC PATCH] vf_fps: Requantize pts of CFR videos 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: multipart/mixed; boundary="===============5860591490467932888==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5860591490467932888== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="paUsNmnSj6sSerQY" Content-Disposition: inline --paUsNmnSj6sSerQY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 22, 2021 at 11:20:26AM -0500, Calvin Walton wrote: > This is mostly to avoid oddities in small framerate adjustments when you > have input videos from containers such as matroska, where the pts values > are quantized with a large enough error to cause issues. >=20 > An example, when converting from 24/1.001 fps to 24 fps with round=3Ddown > from an mkv source (inlink time base is 1/1000, outlink is 1001/24000): >=20 > In PTS | Out PTS | Rounded Out PTS > 69292 | 1663.008 | 1663 > 69333 | 1663.992 | 1663 > 69375 | 1665.000 | 1665 >=20 > In this example, the fps filter would drop the frame with pts 69292, > then duplicate the frame with pts 69333, an undesirable result. >=20 > By first requantizing the input pts to the inlink frame rate, the result > looks much nicer: >=20 > In PTS | Req. PTS | Out PTS > 69292 | 1661 | 1662 > 69333 | 1662 | 1663 > 69375 | 1663 | 1664 >=20 > (Note that the same rounding mode is used for both conversions, > resulting in the final out pts being a bit lower in this case. With the > normal nearest mode, it would be closer.) >=20 > I've verified that in conversions of longer mkv files to "close" > framerates that previously had issues due to quantization, this > significantly reduces the number of incorrectly dropped or duplicated > frames. >=20 > The potential downside of this change is that if an input file is > probed as CFR but is actually VFR, then the results will be poor > (you'll get unnecessarily dropped frames or added judder). A new > option, "requantize", is added to allow disabling this behaviour in > those cases. >=20 > Signed-off-by: Calvin Walton >=20 > --- > libavfilter/vf_fps.c | 48 +++++++++++++++++++++++++++++++++++++------- > 1 file changed, 41 insertions(+), 7 deletions(-) breaks a 60fps 1/60000 timebase input downconverted with -vf fps=3D30:-0.01 the expected result is identical to -vf fps=3D30 but -i 60fps.mov -bitexact -vf fps=3D30:-0.01 -t 2 -v 99 fps.flv the expected output is that either all odd or all even frames are returned = but its a mix after this patch I cannot share the input file but this should reproduce with any 60fps input i hope. If not say so and ill try to find some other file that shows = this thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Republics decline into democracies and democracies degenerate into despotisms. -- Aristotle --paUsNmnSj6sSerQY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYcOgzgAKCRBhHseHBAsP q9taAJ9zAvJh8OJMdWHrWIhaFvqEa76UmwCeN5Yn+SuZ6AzZqu8olbcKR8BaPyM= =1Xp8 -----END PGP SIGNATURE----- --paUsNmnSj6sSerQY-- --===============5860591490467932888== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============5860591490467932888==--