Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 23 lines (16 sloc) 492 Bytes
#!/usr/bin/env bash
# ffmonochrome: Convert an input video into a monochromatic output video.
set -eo pipefail
function help {
echo "Usage: ffmonochrome <input> <output>"
exit
}
function installed {
cmd=$(command -v "${1}")
[[ -n "${cmd}" ]] && [[ -f "${cmd}" ]]
return ${?}
}
[[ $# -eq 2 && -f $1 && ! -f $2 ]] || help
installed ffmpeg || { >&2 echo "Missing ffmpeg."; exit 1; }
# format=gray would probably also work
ffmpeg -i "${1}" -vf hue=s=0 -c:a copy "${2}"