加入与ffmpeg的重复背景音乐 [英] adding repeated background audio with ffmpeg
本文介绍了加入与ffmpeg的重复背景音乐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用的ffmpeg,我看怎么添加音乐文件作为背景的视频,但问题是如何使音频循环/重复。有什么办法呢?
With ffmpeg, I see how to add music file as background for a video, but the problem is how to make the audio loop/repeat. Is there a way out?
推荐答案
的ffmpeg
有前途的 -loop_input
标志的,但它不支持音频输入爱好。
ffmpeg
has the promising -loop_input
flag, but it doesn't support audio inputs yet.
我建议 SOX
和的ffmpeg的
作为解决方案。 -shortest
选项
I'd recommend sox
and the -shortest
option for ffmpeg
as a solution.
sox -i short_audio.mp3 looped_audio.mp3 repeat 1000 # adjust count as necessary
ffmpeg -i input_video.mp4 -i looped_audio.mp3 -shortest output_video.mp4
红袜命令将循环输入,当它运行的视频工艺FFmpeg的命令将使用它的声音,但停下来。
The sox command will loop the input, and the ffmpeg command will use it for the audio, but stop when it runs out of video to process.
这篇关于加入与ffmpeg的重复背景音乐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文