fix : 修复ffmpeg_media_concat使用的音频数据格式 fltp -> s16以确保aac音频编码的可用性

This commit is contained in:
shuohigh@gmail.com 2025-06-18 17:27:57 +08:00
parent 1920b4bd9d
commit 14764ff534
1 changed files with 3 additions and 1 deletions

View File

@ -686,7 +686,9 @@ class VideoUtils:
f"pad={target_width}:{target_height}:(ow-iw)/2:(oh-ih)/2," f"pad={target_width}:{target_height}:(ow-iw)/2:(oh-ih)/2,"
f"setsar=1:1," # 新增强制设置SAR f"setsar=1:1," # 新增强制设置SAR
f"fps=30,format=yuv420p[v{i}]", 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. 准备处理后的视频流和音频流的连接字符串 # 3. 准备处理后的视频流和音频流的连接字符串