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 06A7347BEF for ; Sat, 4 Nov 2023 14:19:10 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1489B68CE63; Sat, 4 Nov 2023 16:19:08 +0200 (EET) Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8115468CD8C for ; Sat, 4 Nov 2023 16:19:01 +0200 (EET) 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 3A4EJ0HG012156 for ; Sat, 4 Nov 2023 15:19:00 +0100 Received: by phare.normalesup.org (Postfix, from userid 1001) id A9D8BEB5B7; Sat, 4 Nov 2023 15:19:00 +0100 (CET) Date: Sat, 4 Nov 2023 15:19:00 +0100 From: Nicolas George To: FFmpeg development discussions and patches Message-ID: References: <20231104092125.10213-1-anton@khirnov.net> <20231104092125.10213-9-anton@khirnov.net> MIME-Version: 1.0 In-Reply-To: <20231104092125.10213-9-anton@khirnov.net> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Sat, 04 Nov 2023 15:19:01 +0100 (CET) Subject: Re: [FFmpeg-devel] [PATCH 08/24] fftools/ffmpeg_filter: remove an unnecessary sub2video_push_ref() call 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="===============4392710120832108853==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4392710120832108853== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0NGIw+cppfV+jZXa" Content-Disposition: inline --0NGIw+cppfV+jZXa Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Anton Khirnov (12023-11-04): > It only seems to produce duplicate frames. Yes it does, that is the point of it. Without the duplicated frame, a filter with synchronized inputs (like overlay) will accumulate video frames while waiting for the next sub2video frame. It is actually super easy to test: any file with both video and bitmap subtitles will cause a huge memory consumption if there is a long enough time without subtitles. Since I am feeling super helpful, here is how I just tested: =2E/ffmpeg_g -lavfi testsrc2=3Ds=3D720x480:d=3D150 -preset ultrafast -y /tm= p/dummy.mkv mkvmerge -o /tmp/dummy_with_sub.mkv /tmp/dummy.mkv $ffmpeg_fate/sub/vobsub.= idx limit addressspace 2G =2E/ffmpeg_g -xerror -i /tmp/dummy_with_sub.mkv -preset ultrafast -lavfi '[= 0:v][0:s]overlay' -y /tmp/dummy_with_hardsub.mkv mplayer /tmp/dummy_with_hardsub.mkv -ss 2:05 The limit addressspace 2G is there so that the huge memory consumption will hit something. Another way is to log the number of queued frames: --- a/libavfilter/framequeue.c +++ b/libavfilter/framequeue.c @@ -90,2 +90,3 @@ int ff_framequeue_add(FFFrameQueue *fq, AVFrame *frame) fq->queued++; + av_log(0, 16, "queued =3D %zd\n", fq->queued); fq->total_frames_head++; ffmpeg version N-112710-g86e0dea620 Copyright (c) 2000-2023 the FFmpeg deve= lopers built with gcc 13 (Debian 13.2.0-5) configuration: --enable-shared --disable-static --enable-gpl --enable-lib= x264 --enable-libopus --enable-libass --enable-libfreetype --enable-opengl = --assert-level=3D2 libavutil 58. 31.100 / 58. 31.100 libavcodec 60. 32.102 / 60. 32.102 libavformat 60. 17.100 / 60. 17.100 libavdevice 60. 4.100 / 60. 4.100 libavfilter 9. 13.100 / 9. 13.100 libswscale 7. 6.100 / 7. 6.100 libswresample 4. 13.100 / 4. 13.100 libpostproc 57. 4.100 / 57. 4.100 Input #0, matroska,webm, from '/tmp/dummy_with_sub.mkv': [=E2=80=A6] queued =3D 2210 queued =3D 2211 queued =3D 2212 queued =3D 2213 [h264 @ 0x562874ac4f40] get_buffer() failed [h264 @ 0x562874ac4f40] thread_get_buffer() failed [h264 @ 0x562874ac4f40] decode_slice_header error [h264 @ 0x562874ac4f40] no frame! [=E2=80=A6] --=20 Nicolas George --0NGIw+cppfV+jZXa Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE6ooRQGBoNzw0KnwPcZVLI8pNxgwFAmVGUtIACgkQcZVLI8pN xgyEcA/+MwNbvioa7leKi2+TCvVcLaDEqonLOSmvJra7PX5GWXQStHQPOwOKQOlR Y6UDKlwyeJQZwD+QLi0g7vqSXtREwf9kufP6MYIZjCvrkhY7E4ssbuqX+I/xGOkw zN3tyudDLV1eLlhuD6K9iOqeTK2tzhw6YTerlmwQ8Lc53TtW3pi4qmPGT+rKzA5+ sH+xhtPZky8hxeiiVoczJiscn/lkGJYpLP4/TzApkfftI8p+2d1Ngyydk97AZFgB ZrDx3appSwban8XPCCeHoXP8lfgYPmWwnjFYlaO4WTjtUksAQ7n/3pb6aaFOBybj hYjHriNSAdzWDBMRaGLhOc9DhCgUyV8JjVzcw5nJebbvQpbQrC29UH4RNVu0jfr1 1KUC5dFdTv5neerqiCcic5QcjGrf+Jl1CJJVMU3T7hTlVy7AAHtvffj9YC59BI7t u3ntFr3g713KpXicr0Yos4kJqHg5sSZHTZdKwppjvZLzWkZ/nEGjh4MPv7natTXx msOngYTdTzefPp1jlIPcGbzN0QDkny3aXKLWiNHwmTmKTHsjEGstsUodDBdE98Sq TdjEqH+wLlBkh7iUBf09ZGOQrmPZQHS6sZ38WnCgZLvbCXtGZRVE5wnjfiMkCuYf uXR85V4i/dzidRePEouS15ptbOKp45egA9qGwChZeVwzNgiqD5c= =AN3d -----END PGP SIGNATURE----- --0NGIw+cppfV+jZXa-- --===============4392710120832108853== 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". --===============4392710120832108853==--