Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 24 lines (16 sloc) 492 Bytes
#!/usr/bin/env bash
# ffpreclip: Remove the beginning of a video.
set -eo pipefail
function help {
echo "Usage: ffpreclip <input> <timestamp> <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; }
# remove `-c copy` if your format needs re-encoding
ffmpeg -ss "${2}" -i "${1}" -c copy "${3}"