Skip to content

Instantly share code, notes, and snippets.

@b9AcE
Created April 28, 2022 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save b9AcE/5a5b848291cdbb9b43ba66887e8e6cea to your computer and use it in GitHub Desktop.
Save b9AcE/5a5b848291cdbb9b43ba66887e8e6cea to your computer and use it in GitHub Desktop.
FFmpeg comand bourne shell script
#!/bin/sh
#
# /usr/local/bin/compand
#
# Bourne shell scriptlet that takes all the files with the mp4 suffix in the current working directory and runs
# FFmpeg's "compress and expand"-filter with pre-selected parameters on them with output to a subdirectory named "compand"
# or if there are arguments run the same once per argument.
#
\/bin/mkdir -p compand
if [ "$#" -eq 0 ]; then
for file in *.mp4 ; do
\/usr/bin/ffmpeg -i ${file} -n -filter_complex 'compand=attacks=0:points=-80/-900|-45/-15|-27/-9|0/-7|20/-7' -vcodec copy compand/${file} ;
done
else
for input in "$@" ; do
\/usr/bin/ffmpeg -i ${input} -n -filter_complex 'compand=attacks=0:points=-80/-900|-45/-15|-27/-9|0/-7|20/-7' -vcodec copy compand/${input}
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment