如何在 bash 中使用 ffmpeg 从一堆单声道文件制作一堆立体声文件?
我有两个文件夹“左通道”和“右通道”。每个文件夹都包含具有相同名称的单声道文件。示例:“左声道”包含“A.wav”、“B.wav”、“C.wav”,“右声道”包含“A.wav”、“B.wav”、“C.wav”。我需要为每个单声道文件制作立体声文件。
所以我必须结合起来
ffmpeg -i left.mp3 -i right.mp3 -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" output.mp3
,
for file in /dir/* do ffmpeg -i ...; done
如何在 bash 中使用 ffmpeg 遍历所有单声道文件并从这些单声道文件中制作一堆立体声文件?
I have two folders "Left channel" and "Right channel". Each folder contains mono files with same names. Example: "Left channel" contains "A.wav", "B.wav", "C.wav" and "Right channel" contains "A.wav", "B.wav", "C.wav". I need to make stereo files for each mono files.
So I have to combine
ffmpeg -i left.mp3 -i right.mp3 -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" output.mp3
and
for file in /dir/* do ffmpeg -i ...; done
How can I go through all mono files and make bunch of stereo files from these mono files with ffmpeg in bash?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请您尝试以下操作:
它只是将命令行输出为空运行。如果输出看起来不错,请删除
echo
并再次运行。请注意
echo
的输出删除了文件名周围的双引号。如果复制echo
的输出并在命令行上执行它,则效果不佳。Would you please try the following:
It just outputs the command line as a dry run. If the output looks good, drop
echo
and run again.Please note the output of
echo
removes the double quotes around the filenames. If you copy the output ofecho
and execute it on the command line, it will not work well.