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 719F2481F8 for ; Wed, 13 Dec 2023 10:07:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D864D68D0E7; Wed, 13 Dec 2023 12:07:02 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CDF8C68D0E3 for ; Wed, 13 Dec 2023 12:06:55 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 926632405ED for ; Wed, 13 Dec 2023 11:06:55 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id tOKJ8UKiF_HK for ; Wed, 13 Dec 2023 11:06:53 +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 4001E2400AC for ; Wed, 13 Dec 2023 11:06:53 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id 1B19E1601B9; Wed, 13 Dec 2023 11:06:53 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: <170245852534.8914.12550775596488175101@lain.khirnov.net> Mail-Followup-To: FFmpeg development discussions and patches Date: Wed, 13 Dec 2023 11:06:53 +0100 Message-ID: <170246201308.8914.9236708116049801289@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [RFC] fftools/ffmpeg and libavdevice/sdl issue 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 Zhao Zhili (2023-12-13 10:31:38) > > > On Dec 13, 2023, at 17:08, Anton Khirnov wrote: > > > > Quoting Zhao Zhili (2023-12-12 18:27:39) > >> Now it's time to talk about the libavdevice/sdl issue. > >> > >> SDL output is broken with ffmpeg multithread refactor. SDL 'muxer' write_header > >> and write_packet must be run in the same thread. And to make it work portable > >> and reliable, SDL 'muxer' must be run in main thread. It's a common requirement > >> for render to be run in main thread. > >> > >> There are at least two trac tickets for the same issue: #10644 and #10649. > >> > >> And there are two patches for the issue: > >> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20230918063728.198377-1-haihao.xiang@intel.com/ > >> https://patchwork.ffmpeg.org/project/ffmpeg/patch/20231101090115.10655-1-angus.chen@intel.com/ > >> > >> There patches might work on Linux, but not portable. > >> > >> A simple workaround is pipe the output of ffmpeg to ffplay: > >> > >> ./ffmpeg -re -i /e/video/cctv.mp4 -an -f yuv4mpegpipe - |ffplay - > >> > >> To fix it, another thread can be used to drive transcode rather than main thread. > >> A main loop should be created on main thread, and prepared to handle any special > >> tasks like render. It sounds a lot of work. I'm not sure if it worth for a single use case. > >> However, maybe we can have a libavfilter/vsink_preview after that. > >> > >> What should we do? > > > > Honestly I don't see how this could be done in ffmpeg CLI without > > disgusting hacks, but before that the question is: why is there an SDL > > "muxer" and why would anyone want to use it in ffmpeg CLI? What actual > > use cases does it serve that cannot be better handled otherwise? > > I pasted wrong tickets, they are #10625 and #10649. > https://trac.ffmpeg.org/ticket/10625 > > The use case is realtime preview. The function lavd/sdl2 provides is limited. A vsink_preview > filter is more appropriate. It has the same thread issue with libavfilter. The submitter claims that piping to ffplay suffers from latency, which should not be there and so is either a bug or an improper setup. -- 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".