-
-
Save waltercruz/8f66c6169cc361159f503f2313f5f498 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
audio_duration=$(ffprobe -i ${1} -show_entries format=duration -v quiet -of csv="p=0") | |
video_duration=$(ffprobe -i ${2} -show_entries format=duration -v quiet -of csv="p=0") | |
n_loops=$(echo "(${audio_duration} / ${video_duration}) + 1"|bc) | |
ffmpeg -i ${1} -f concat -i <(for i in {1..${n_loops}}; do printf "file '%s'\n" ${2}; done) -c:v copy -c:a copy -shortest ${3} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment