Skip to content

Instantly share code, notes, and snippets.

@geoder101
Created September 2, 2021 19:18
Show Gist options
  • Save geoder101/f077b023f3e310b9eeb89689bd6360a3 to your computer and use it in GitHub Desktop.
Save geoder101/f077b023f3e310b9eeb89689bd6360a3 to your computer and use it in GitHub Desktop.
[ffmpeg] Create video from a still image and an audio file
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