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 798BD48198 for ; Sat, 11 Nov 2023 20:10:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 30F8268CBA0; Sat, 11 Nov 2023 22:10:43 +0200 (EET) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 92BEF68C8A5 for ; Sat, 11 Nov 2023 22:10:36 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id 121721BF206 for ; Sat, 11 Nov 2023 20:10:34 +0000 (UTC) Date: Sat, 11 Nov 2023 21:10:34 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20231111201034.GB3543730@pb2> References: <20231104092125.10213-1-anton@khirnov.net> MIME-Version: 1.0 In-Reply-To: <20231104092125.10213-1-anton@khirnov.net> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] ffmpeg CLI multithreading 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="===============3044943006115981506==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3044943006115981506== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KzwSLkfhW7eR0gU3" Content-Disposition: inline --KzwSLkfhW7eR0gU3 Content-Type: multipart/mixed; boundary="5GqOhNs19kbVxOUK" Content-Disposition: inline --5GqOhNs19kbVxOUK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 04, 2023 at 08:56:09AM +0100, Anton Khirnov wrote: > Hi, > after ~2 years of work and ~700+ preparatory commits, here is finally > the first "fully functional" version of multithreaded ffmpeg CLI. In > quotes because due to the scale of the changes I'm sure some things got > broken and I didn't notice - more testing very much welcome. >=20 > One thing which is most definitely broken is the > -fix_sub_duration_heartbeat option, which in its current form makes > assumptions about synchronization between distant components > (encoders/muxers -> decoders), which makes it fundamentally > non-deterministic when each of these components runs asynchronously > (note that its behaviour is unpredictable even now, it's just > deterministic across runs with the same options). I'm currently > disabling the option in 16/24, better suggestions on what to do with it > are welcome. >=20 > Runtime overhead of the threading seems to be negligible in typical > cases, though it may become significant when there is very little work > per packet. You should see significantly better CPU > utilization/wallclock speedup on multicore systems whenever transcoding > isn't dominated by a a single component and the components aren't > themselves already multithreaded. >=20 > The set is structured similarly to the previous RFC: > * 01-09/24 are preparatory fixes and could be pushed on their own well > before the rest of the series; thanks to Paul for writing 02/24 > * 10-17/24 move the two remaining components (encoding and filtering) > into threads (as before it's "fake" threading where the main thread > waits for the other thread to be done, and is thus not truly parallel) > and do other preparatory changes - these may introduce significant > temporary overhead and/or break some corner cases, so should be pushed > when the whole set is ready; > * 18/24, the biggest individual patch, adds the transcode scheduler; as > of that patch it does not yet do anything; > * 19-24/24 convert the individual components to use the scheduler; the > conversion is split for review purposes, but will have to be squashed > for the final push. >=20 > Some more information is in my recent VDD talk [1]. You can also fetch > the code from the 'ffmpeg_threading' branch in [2]. >=20 > Reviews, testing, and constructive comments are all very much welcome. >=20 > [1] https://youtu.be/Z4DS3jiZhfo?t=3D1221 > [2] git://git.khirnov.net/libav This one infinite loops: =2E/ffmpeg -i tickets//383/ranft.m2v -itsoffset -00:00:00.775 -itickets//38= 3/ranft.ac3 -bitexact -target pal-vcd /tmp/vcd.mpg (file should be here: https://trac.ffmpeg.org/raw-attachment/ticket/383/sma= llfiles.zip) so does this: (files attached just 320bytes) =2E/ffmpeg -f u8 -ar 8000 -ac 1 -i sync_audio.raw -f rawvideo -framerate 2 = -s 192x144 -pix_fmt gray -i sync_video.raw -vcodec mpeg2video -acodec mp2 -= y -r 2 /tmp/mpeg2_mp2.mpg These are with your branch merged into master thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No snowflake in an avalanche ever feels responsible. -- Voltaire --5GqOhNs19kbVxOUK Content-Type: application/x-xz Content-Disposition: attachment; filename="sync.tar.xz" Content-Transfer-Encoding: base64 /Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4+f/AOtdADmeSf+oST4k3Ax4VtgFb6yIJX7OqDlr CjakOpRTItzs2VXDFv0oQLNVbIRbuVVv+SXaX2VzRun+BYMFVyL/KypiHbapNY8L+PP2Y5SN BIcfLmbU+1T9w9LLGikW1IpO7qjGJlid/KTeVkr3L95zJIjoepKBVh2Sw3tSyc1mW6tuqKq9 4uwZEdajVpldyYD5xPRNeuT5IUSv7HBmSoZEIKMqtcycY3cDsaz86FWXXn/AsgWXnRAFnyMc iL4TShioVzqhrlC40YIEQJfCGMgEP4wfMyRZUEUg78sGV0SQyhKUL8wC3T3pjEFhwAAAAMxl fzoRcoO1AAGHAoDQDwAZPGhdscRn+wIAAAAABFla --5GqOhNs19kbVxOUK-- --KzwSLkfhW7eR0gU3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZU/ftgAKCRBhHseHBAsP q6LfAJ9BCcb82S9iAQT8PIHRDRFM/G+1CACfVDkK/FVDfIZtWq/CEF6rP8KRDe0= =gZdU -----END PGP SIGNATURE----- --KzwSLkfhW7eR0gU3-- --===============3044943006115981506== 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". --===============3044943006115981506==--