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 3381F4453A for ; Wed, 14 Sep 2022 18:15:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C45D468B9F9; Wed, 14 Sep 2022 21:15:02 +0300 (EEST) Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6E8BC68B9F9 for ; Wed, 14 Sep 2022 21:14:56 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 28EIEtdm021394 for ; Wed, 14 Sep 2022 20:14:55 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 87787EB5B9; Wed, 14 Sep 2022 20:14:55 +0200 (CEST) Date: Wed, 14 Sep 2022 20:14:55 +0200 From: Nicolas George To: FFmpeg development discussions and patches Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Wed, 14 Sep 2022 20:14:55 +0200 (CEST) Subject: Re: [FFmpeg-devel] [PATCH] libavfilter/f_select: switch to activate and properly handle EOF pts 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="===============6520362541772802078==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6520362541772802078== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Y6ANzuhP1zKVwiD6" Content-Disposition: inline --Y6ANzuhP1zKVwiD6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Li-Heng Chen (12022-09-14): > Thanks for the comment, Nicolas! I've attached a new patch file which > should address the comments. I also want to mention that this patch is > similar to another one Paul had done for setpts filter: > http://git.videolan.org/?p=3Dffmpeg.git;a=3Dcommitdiff;h=3D2a546fb7d5722c= 306dd42c715137e5e493b0d5be It is similar in its form, but the logic is very different: Paul's commit has the function evaluated for the final timestamps. > The attached patch should have the commit message wrapped, and I > have also added a comment in the code to explain the logic: > /* Two conditions that current pts could be the EOF pts: > * - If the current frame N is not selected while the previous > * frame (N-1) is selected, frame N-1 could be the last frame, > * hence we update select->eof_pts. > * - Last input frame: we have EOF status, and the current (last) > * frame is selected */ Thanks for explaining. Unfortunately, it confirms my analysis that your logic is slightly flawed. Consider a select filter that keeps only the frames with a PTS that is a prime number. The frame with PTS 13 used to extend in the timeline of the stream from 13 inclusive to 14 exclusive. Now it extends from 13 inclusive to 17 exclusive; the timestamp 14 was completely skipped. There is no reason that a EOF arriving a little after that would change that and make the filter re-consider 14: the frame 14 was skipped, its PTS should not be considered. > This patch does not change the frame timestamps. Instead, we added > another variable select->eof_pts to track possible EOF pts. It sets the > EOF pts as the pts *after* the last selected frame (e.g. if the last frame > selected by the filter is frame 20, EOF pts is set as the pts of frame 21) Which means it sets the EOF PTS at the timestamp of a frame that was dropped. This is not logical. > I have also tested the trim filter, which does not present this bug. Howe= ver, > if you do -vf select=3D'eq(n\,24)',fps=3D25/1 on the above example, this = selected > frame will also be duplicated 21 times, which is also not an expected beh= avior > for the select filter. I consider it the correct behavior. Regards, --=20 Nicolas George --Y6ANzuhP1zKVwiD6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIyBAEBCgAdFiEE6ooRQGBoNzw0KnwPcZVLI8pNxgwFAmMiGh0ACgkQcZVLI8pN xgxKEg/41OUQxXx76wwyWQrKnLLwaxOEl3PchGduWjUqpRA0KqgSRPYYF5bp3tvB BqV1MKGmvLjCUcAZVRj4kqIX1qsduQVsB6GHhkWn/70u4GprNnCLfz5h0lLGabJK CkFducmGd4iagvBW5TY9Q8nBQBPPuYQzSrqoyCUDBVrL++MFzP7bU69GLgrDIFNk YH2nZXstv282NVQXzYWBnB8SRmbWKv71uJ3zC5WebmhEt+QsSGT/PFXY2Wc8QnWB 1+UJESoTs2+y8ACrInc+AzCabUTIuBqj6NuVe7mAFkJwenORTqWt//hXo0Z8A2UC SZcDjfZbQw//2fn9mpAZPTEcQg8kcKDsM3nFMFv6ErFTif/eXOAGSUnbY1WBxr1t 1AFH4OEaHQdXDk+qTHlxgHW5M7t5OEeX36prirkY22dokToGeXveewqZHZUOuBax +QDps19/zWHqZ1TUgpm7pmCQsG07iDhUbzzlOqlxT64lLfvm4dtSLy+pPv2VVDSw 2dLnWu9x5RwJsJuCzXyeU2A8e+YdYMF0vgbUN0+x1L1jnG10LnQVxgZO1UEFU/qM bDRs57/cXaycEsx0bSeMU5HQV48gOYHPqBGUccDx6hmy61P3bZ6qk/dvCSz9n2eu 0qBGyHssAMUkLuBV6mvBoooOyH9ZXle+wCgHTF2F6jqWNQ9dxg== =P/pL -----END PGP SIGNATURE----- --Y6ANzuhP1zKVwiD6-- --===============6520362541772802078== 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". --===============6520362541772802078==--