From 14764ff5346e3ce92ef90a45c0f51d1dbe3f476a Mon Sep 17 00:00:00 2001 From: "shuohigh@gmail.com" Date: Wed, 18 Jun 2025 17:27:57 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E4=BF=AE=E5=A4=8Dffmpeg=5Fmedia=5Fco?= =?UTF-8?q?ncat=E4=BD=BF=E7=94=A8=E7=9A=84=E9=9F=B3=E9=A2=91=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=A0=BC=E5=BC=8F=20fltp=20->=20s16=E4=BB=A5=E7=A1=AE?= =?UTF-8?q?=E4=BF=9Daac=E9=9F=B3=E9=A2=91=E7=BC=96=E7=A0=81=E7=9A=84?= =?UTF-8?q?=E5=8F=AF=E7=94=A8=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BowongModalFunctions/utils/VideoUtils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/BowongModalFunctions/utils/VideoUtils.py b/src/BowongModalFunctions/utils/VideoUtils.py index 1860193..5ee2dc4 100644 --- a/src/BowongModalFunctions/utils/VideoUtils.py +++ b/src/BowongModalFunctions/utils/VideoUtils.py @@ -686,7 +686,9 @@ class VideoUtils: f"pad={target_width}:{target_height}:(ow-iw)/2:(oh-ih)/2," f"setsar=1:1," # 新增强制设置SAR f"fps=30,format=yuv420p[v{i}]", - f"[{i}:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[a{i}]", + # 修改音频过滤器,确保输出为AAC兼容格式 + # f"[{i}:a]aformat=sample_fmts=fltp:sample_rates=44100:channel_layouts=stereo[a{i}]", + f"[{i}:a]aformat=sample_fmts=s16:sample_rates=44100:channel_layouts=stereo[a{i}]", ] ) # 3. 准备处理后的视频流和音频流的连接字符串