Created
September 2, 2021 19:18
-
-
Save geoder101/f077b023f3e310b9eeb89689bd6360a3 to your computer and use it in GitHub Desktop.
[ffmpeg] Create video from a still image and an audio file
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
function create_image_audio() { | |
local -r image="$1" | |
local -r audio="$2" | |
echo DEBUG: $(pwd) | |
echo DEBUG: $(file "$image") | |
echo DEBUG: $(file "$audio") | |
ffmpeg -loop 1 -i "$image" -i "$audio" -c:v libx264 -c:a copy -shortest "${audio}.mp4" | |
} | |
create_image_audio "$1" "$2" | |
# example: | |
# find . -name '*.mp3' -print0 | tr -d '\012' | xargs -0 -I {} ./create_image_audio.sh <IMAGE> {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment