我尝试将多个 mp4 文件(无音频)与位于同一文件夹中的 m4a 文件混合使用,
通用命令是
for %%a in ("*.mp4") do ffmpeg -i "%%~na.mp4" -i "%%~na.m4a" -c copy "%%~na.mp4"
但这有问题,因为它会询问我是否要覆盖。我有这样的文件名要复用
Episode 1 [sometext].m4a
Episode 1 [sometext].mp4
Episode 2 [sometext].m4a
Episode 2 [sometext].mp4
Glory and Pain.m4a
Glory and Pain.mp4
Ghost in 2 episode.m4a
Ghost in 2 episode.mp4
我期望的输出不应该使用相同的名称或要求我覆盖,而只是添加“muxed”后缀
Episode 1 [sometext]_muxed.mp4
Episode 2 [sometext]_muxed.mp4
Glory and Pain_muxed.mp4
Ghost in 2 episode_muxed.mp4
任何想法?
答案1
您可以运行此批处理文件:
@echo off
Title MUX mp4-m4a files with FFmpeg
Set MUX_Folder=%~dp0MUX_Folder
MkDir "%MUX_Folder%">nul 2>&1
@for %%a in ("*.mp4") do ffmpeg -i "%%~na.mp4" -i "%%~na.m4a" -c copy -y "%MUX_Folder%\%%~na_muxed.mp4"
Explorer "%MUX_Folder%"