From 7d556955f116704072b4718d4b312ead9099ac51 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 23 Oct 2013 20:11:42 +0200 Subject: [PATCH] tc-video-generic: WIP --- .scripts/tc-video-generic | 109 +++++++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 44 deletions(-) diff --git a/.scripts/tc-video-generic b/.scripts/tc-video-generic index 8801a720..f8d628fe 100755 --- a/.scripts/tc-video-generic +++ b/.scripts/tc-video-generic @@ -2,11 +2,6 @@ ## TODO: handle srt encoding. -if [ -z "$(command -v ffmpeg)" ]; then - echo "ffmpeg required." - exit -fi - _printhelp() { cat <&1 &1 &1 &1 0) printf "-c:a:" id " " codec " -b:a:" id " " bitrate "k "; else printf "-c:a:" id " copy "; id++} END {print ""}' fi @@ -186,29 +188,52 @@ _tc_transcode() VIDEO_FILTER="-vf $(_cropvalue "$1")" fi - AUDIO_BITRATE="$(_audiobitrate "$1")" + + ## WARNING: we mix down audio to 2 channels with '-ac 2'. This greatly reduce + ## file size and avoid any confusion for playback, which is often the case when + ## converting DTS to any other format because DTS has embedded channel + ## description which is not available in these formats. + # AUDIO_FILTER="-ac 2" + + ## If AUDIO_FILTER is already set, it means that we copy. + if [ -z "$AUDIO_PARAM" ]; then + AUDIO_PARAM="$(_audiobitrate "$1") -ac 2" + fi cat<