From 5836eb3586e5a413c224ea76723cf8e91fdca97d Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 23 Oct 2013 20:15:15 +0200 Subject: [PATCH] tc-video-custom: various fixes --- .scripts/.tc-video-custom.in | 95 ++++++++++++++++++++++-------------- .scripts/tc-video-custom | 26 ++++------ 2 files changed, 69 insertions(+), 52 deletions(-) diff --git a/.scripts/.tc-video-custom.in b/.scripts/.tc-video-custom.in index 64e0c29d..5a4db61e 100644 --- a/.scripts/.tc-video-custom.in +++ b/.scripts/.tc-video-custom.in @@ -1,51 +1,36 @@ #!/bin/sh -if [ -z "$(command -v ffmpeg)" ]; then - echo "ffmpeg required." - exit -fi - -_transcode () -{ - ## Zsh compatibility. We need it otherwise word splitting of parameter like - ## TC_SAMPLE will not work. - STATUS="$(set -o | grep 'shwordsplit' | awk '{print $2}')" - [ "$STATUS" = "off" ] && set -o shwordsplit - - ffmpeg -i "$@" \ - -c:v libx264 -preset slow -crf 20 \ - -c:a libvorbis -b:a 192k -ac 2 \ - -c:s copy \ - -map 0 \ - $TC_SAMPLE \ - "${1%.*}-$(date '+%F-%H%M%S').mkv" - - ## Restore Zsh previous options. This will not turn off shwordsplit if it - ## was on before calling the function. - [ "$STATUS" = "off" ] && set +o shwordsplit -} - - _printhelp() { cat <