diff --git a/bash_scripts/colorizer.sh b/bash_scripts/colorizer.sh new file mode 100755 index 0000000..f7428d2 --- /dev/null +++ b/bash_scripts/colorizer.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash + +# Colorize a video using colorchanelmixer + +_usage(){ +cat <&2 + exit +fi + + # Build filter string +filterString="colorchannelmixer=${colorNums},format=yuv422p10le" + +while getopts "hps" OPT ; do + case "${OPT}" in + h) _usage ; exit 0 + ;; + p) + ffmpeg -hide_banner -i "${2}" -c:v prores -profile:v 3 -vf $filterString -f matroska - | ffplay - + printf "\n\n*******START FFPLAY COMMANDS*******\n" >&2 + printf "ffmpeg -hide_banner -i '$2' -c:v prores -vf '${filterString}' -f matroska - | ffplay - \n" >&2 + printf "********END FFPLAY COMMANDS********\n\n " >&2 + ;; + s) + ffmpeg -hide_banner -i "${2}" -c:v prores -profile:v 3 -vf $filterString "${2%.*}_colorize_$color.mov" + printf "\n\n*******START FFMPEG COMMANDS*******\n" >&2 + printf "ffmpeg -hide_banner -i '$2' -c:v prores -profile:v 3 -vf $filterString '${2%.*}_colorize_$color.mov' \n" >&2 + printf "********END FFMPEG COMMANDS********\n\n " >&2 + ;; + *) echo "bad option -${OPTARG}" ; _usage ; exit 1 ; + esac + done