Skip to content

Instantly share code, notes, and snippets.

@shellus
Last active September 26, 2021 11:51
Show Gist options
  • Save shellus/69fd04c79f35fa875d3390ce2978c7b2 to your computer and use it in GitHub Desktop.
Save shellus/69fd04c79f35fa875d3390ce2978c7b2 to your computer and use it in GitHub Desktop.
ffmpeg multiple processes directory videos
#!/bin/bash
set -e
handler(){
path=$@
filename=$(basename "${path}")
basename=${filename%.*}
dirname=$(dirname "${path}")
newname=$dirname/$basename.mp4
ffmpeg -i "$path" "$newname"
}
export -f handler
find $1 -name '*.avi' -exec bash -c 'handler "{}"' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment