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 80D9F48294 for ; Fri, 17 Nov 2023 10:46:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8762668CCD8; Fri, 17 Nov 2023 12:46:15 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0D50168C9A4 for ; Fri, 17 Nov 2023 12:46:09 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id B70FC2404B1 for ; Fri, 17 Nov 2023 11:46:08 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id DJ8HXGD7T2F7 for ; Fri, 17 Nov 2023 11:46:04 +0100 (CET) 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 B794324043D for ; Fri, 17 Nov 2023 11:46:04 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id 936571601B9; Fri, 17 Nov 2023 11:46:04 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20231111201034.GB3543730@pb2> References: <20231104092125.10213-1-anton@khirnov.net> <20231111201034.GB3543730@pb2> Mail-Followup-To: FFmpeg development discussions and patches Date: Fri, 17 Nov 2023 11:46:04 +0100 Message-ID: <170021796457.8914.5342829294725378190@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 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: 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 Michael Niedermayer (2023-11-11 21:10:34) > 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. > > > > 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. > > > > 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. > > > > 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. > > > > Some more information is in my recent VDD talk [1]. You can also fetch > > the code from the 'ffmpeg_threading' branch in [2]. > > > > Reviews, testing, and constructive comments are all very much welcome. > > > > [1] https://youtu.be/Z4DS3jiZhfo?t=1221 > > > [2] git://git.khirnov.net/libav > > This one infinite loops: > ./ffmpeg -i tickets//383/ranft.m2v -itsoffset -00:00:00.775 -itickets//383/ranft.ac3 -bitexact -target pal-vcd /tmp/vcd.mpg > (file should be here: https://trac.ffmpeg.org/raw-attachment/ticket/383/smallfiles.zip) > > so does this: (files attached just 320bytes) > ./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 Both were the same issue, fixed in my branch now. I will resubmit the set after dealing with the other comments. Thanks, -- 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".