Commit d4093e9eb17e460fe9c4cfc6109b10a63ec8796e

Authored by Georg Hopp
1 parent 30c94601

Add some first video backup helper

Showing 1 changed file with 90 additions and 0 deletions
  1 +function dvdinfo() {
  2 + local TRACK="${1:-1,-1,1}"
  3 + tccat -i /dev/cdrom -T "${TRACK}" |ffprobe -i -
  4 +}
  5 +
  6 +function dvdrip() {
  7 + local OPT OPTARG OPTIND
  8 + local OPTEND=0
  9 +
  10 + local TRACK="1,-1,1"
  11 + local PRESET="veryslow"
  12 + local TUNE="film"
  13 + local OUTFILE="/home/ghopp/data/dvdrip.mp4"
  14 +
  15 + local USAGE="$(cat <<-EOT
  16 + Usage: $0 [-T track] [-p preset] [-t tune] [-o outfile] [MAP]...
  17 + EOT
  18 + )"
  19 +
  20 + while getopts T:p:t:o:h- OPT
  21 + do
  22 + case $OPT in
  23 + T) TRACK="${OPTARG:-${TRACK}}";;
  24 + p) PRESET="${OPTARG:-${PRESET}}";;
  25 + t) TUNE="${OPTARG:-${TUNE}}";;
  26 + o) OUTFILE="${OPTARG:-${OUTFILE}}";;
  27 + -) OPTEND=1;;
  28 + h) echo ${USAGE} && return 0;;
  29 + ?) echo ${USAGE} && return 1;;
  30 + esac
  31 + [[ $OPTEND -eq 1 ]] && break
  32 + done
  33 + shift $((OPTIND - 1))
  34 +
  35 + tccat -i /dev/cdrom -T "${TRACK}" |\
  36 + ffmpeg -i - -map "${*// / -map }" -c:v libx264 -vf format=yuv420p \
  37 + -preset ${PRESET} -tune ${TUNE} -c:a mp3 -ac 1 ${OUTFILE}
  38 +}
  39 +
  40 +function filmrip() {
  41 + local OPT OPTARG OPTIND
  42 + local OPTEND=0
  43 +
  44 + local USAGE="$(cat <<-EOT
  45 + Usage: $0 [-T track] [-o outfile] [MAP]...
  46 + EOT
  47 + )"
  48 +
  49 + while getopts T:p:t:o:h- OPT
  50 + do
  51 + case $OPT in
  52 + T) TRACK="${OPTARG}";;
  53 + o) OUTFILE="${OPTARG}";;
  54 + -) OPTEND=1;;
  55 + h) echo ${USAGE} && return 0;;
  56 + ?) echo ${USAGE} && return 1;;
  57 + esac
  58 + [[ $OPTEND -eq 1 ]] && break
  59 + done
  60 + shift $((OPTIND - 1))
  61 +
  62 + dvdrip -T "${TRACK}" -o "${OUTFILE}" $@
  63 +}
  64 +
  65 +function animationrip() {
  66 + local OPT OPTARG OPTIND
  67 + local OPTEND=0
  68 +
  69 + local USAGE="$(cat <<-EOT
  70 + Usage: $0 [-T track] [-o outfile] [MAP]...
  71 + EOT
  72 + )"
  73 +
  74 + while getopts T:p:t:o:h- OPT
  75 + do
  76 + case $OPT in
  77 + T) TRACK="${OPTARG}";;
  78 + o) OUTFILE="${OPTARG}";;
  79 + -) OPTEND=1;;
  80 + h) echo ${USAGE} && return 0;;
  81 + ?) echo ${USAGE} && return 1;;
  82 + esac
  83 + [[ $OPTEND -eq 1 ]] && break
  84 + done
  85 + shift $((OPTIND - 1))
  86 +
  87 + dvdrip -T "${TRACK}" -o "${OUTFILE}" -t animation $@
  88 +}
  89 +
  90 +# vim: set ts=4 sw=4:
... ...
Please register or login to post a comment