dotfiles/dotfiles/bin/transcribe-video-medium

38 lines
937 B
Bash

#!/usr/bin/env bash
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
MAGENTA=""
CYAN=""
BOLD=""
NORMAL=""
fi
if [[ $2 == "" ]]; then
printf "${BOLD}${RED}Usage: transcribe-video-medium <input.mp4> <output name without extension> <optional: start time HH:MM:SS, use 0 for start> <optional: end time HH:MM:SS, use empty string or 0 for no value>${NORMAL}\n"
exit 1
fi
start_time="$3"
end_time="$4"
if [[ $start_time == "" ]]; then start_time="0"; fi
if [[ $end_time == "" ]]; then end_time="0"; fi
transcribe-video "$1" "$2" $start_time $end_time "medium"