Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 25 lines (17 sloc) 592 Bytes
#!/usr/bin/env bash
# fftitle: Give a video a nice, centered title.
set -eo pipefail
function help {
echo "Usage: fftitle <input> <title> <output>"
exit
}
function installed {
cmd=$(command -v "${1}")
[[ -n "${cmd}" ]] && [[ -f "${cmd}" ]]
return ${?}
}
[[ $# -eq 3 && -f $1 && -n $2 && ! -f $3 ]] || help
installed ffmpeg || { >&2 echo "Missing ffmpeg."; exit 1; }
ffmpeg -i "${1}" -vf "drawtext=enable='between(t, 0, 10)':font=Sans:text='${2}': \
fontcolor=white:fontsize=48:box=1:boxcolor=black@0.5:boxborderw=10: \
x=(w-text_w)/2:y=(h-text_h)/2" -an "${3}"