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 is a software, which uses all formats for media you may need – H. 264, H. 265, Apple ProRes, Avid DNxHD etc, even also used for images like PNG and others – support all type of platform you're on. It is a command-line tool, it is quicker than some other tools which are available for transcoding.
ffmpeg
has the promising -loop_input
flag, but it doesn't support audio inputs yet.
I'd recommend sox
and the -shortest
option for ffmpeg
as a solution.
sox 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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With