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 9209941101 for ; Tue, 12 Dec 2023 17:28:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7328E68D0BF; Tue, 12 Dec 2023 19:27:58 +0200 (EET) Received: from out162-62-57-252.mail.qq.com (out162-62-57-252.mail.qq.com [162.62.57.252]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 73A2A68CE33 for ; Tue, 12 Dec 2023 19:27:50 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1702402061; bh=ajjK3VsUTO7/bqo4nD5h+Y0+WYv1/Cqa9pBhzCThjn8=; h=From:To:Cc:Subject:Date; b=lyPhpOxxJWb/M0PEBRYPRElP3f8R6xKMmlPbAnVGGWF7ovH9e9pI9uVswTH1QOA3I XHKf5fAYPE40FjKcB7Ss0AeIvps4kb9VXvA+cHQTtsO09nUXLwbPN4UXq7PU0QdVkW vPT+rty+/AppKgpORlODWfPxbrb7EKlnBWfz56kQ= Received: from homepc ([113.118.114.68]) by newxmesmtplogicsvrszc5-0.qq.com (NewEsmtp) with SMTP id 6E80301F; Wed, 13 Dec 2023 01:27:40 +0800 X-QQ-mid: xmsmtpt1702402060tv945qvau Message-ID: X-QQ-XMAILINFO: ONPzuxsd6iNOx183e16ABBC22lzp+dGd8s+UVOz9EYtm/tuIJ0Qi2LuypaVzkb ALhSx9t3uggmlefuy1QDK4OmIP0591yd1+YIgbb8ehurftJzZx4bziaMvTZ0vaaPFNMq6w2mWm1u ZIGryeOTEHVHlMJyZrnRp+aJHstNWF49HzMlRSj86d4BcOeKBJA7tiUpUW9utMEdSGTlkSW1nPw9 GZ1CLPZQYl29eB41hlk9vdKPCGWeWeT5IFcTz54R/8rMoS1vw6/X78ErNQtKkzxCtDTEBnl6JChx t8Hb4DhzMyjY2T9EX9bLDmMr83e0zDLwoV1kPnJ+XyRQ30QFurSwF03rlpJESsUedXDAmBTMlgYa o7prY2duc+Vrj/3Jilpj11uAszu94j+TOfBMdzjAfrXq2hp89Hfac902EE3TdsFi72PjsFKcEq1d pyY9ek2SLDlLjtBlSm/Cj6rSOC8Wlm9PeBYqRkQkHedeXBgOLCSi1ao4l89jF5TAbKCsTKKpgW3o jUJvbvYciNIh/epDcCKdHlwTbFhFfSDIxO5KP8KBDgPxBMD8TZMqek5o6j8AiLl+OglFX5KGUstt pp0ODc4djfCxmzUyWgVd99rykIgP9tnbflwcknGpZGwhx+qON6LCv+Pos+hodDe/rTi5Gfv8Gl0p x7untk/UqJO5wiJRrqaIbAD26WDntpeO6JUqpckb0xMg46ZMfbE+mAE4i1wLz4eKeiVxC9DJ8qUZ Xqaig869dGmaUfX4Ty6YpVkhYrIUnHBFu3/rBbATINMHduufNWGnmYq2/tW4ZAfLxPV56/HqPP8O FD/MaxpEBcYIf2AwpqD2SNlACPHeVc3sHFKCGcJIdGZyPtok5lNi+fVEzKGGkh9E6sxeAqvc5WYF 8VBTsz0pLAovnQRTzcbttHhSwFRjjR5LWJw4GF+Zbtk3Ly99C1K06NJm9BS2QVU7fsT/9Nu1WsUI hM7i1Y4xOEOMiKqCpBGIiexygl9mIBI8qT0+ye90A= X-QQ-XMRINFO: OWPUhxQsoeAVDbp3OJHYyFg= From: "Zhao Zhili" To: Date: Wed, 13 Dec 2023 01:27:39 +0800 X-OQ-MSGID: <015701da2d20$81f8f1b0$85ead510$@foxmail.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Content-Language: zh-cn Thread-Index: AdotG+MqQWDbENYfSzOwt/Z8e2EEpg== Subject: [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 Cc: 'Anton Khirnov' 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: 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? _______________________________________________ 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".