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 6E1D847C2A for ; Wed, 13 Dec 2023 09:08:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E359768D0AA; Wed, 13 Dec 2023 11:08:51 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 82F1168CF33 for ; Wed, 13 Dec 2023 11:08:46 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 4C6422405ED for ; Wed, 13 Dec 2023 10:08:46 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id S9fYI6dobn7u for ; Wed, 13 Dec 2023 10:08:45 +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 7E7462400AC for ; Wed, 13 Dec 2023 10:08:45 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id 5B7CA1601B9; Wed, 13 Dec 2023 10:08:45 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org In-Reply-To: References: Date: Wed, 13 Dec 2023 10:08:45 +0100 Message-ID: <170245852534.8914.12550775596488175101@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-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? -- 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".