Projects
Multimedia
h264enc
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 388
View file
h264enc.spec
Changed
@@ -1,7 +1,7 @@ # norootforbuild Name: h264enc -Version: 10.4.2 +Version: 10.4.3 Release: 1 License: GPL-2.0+ @@ -58,6 +58,11 @@ %changelog +* Tue Sep 08 2015 Grozdan Nikolov <neutrino8@gmail.com> 10.4.3 + * Removed the $ from the index of array variables + * Be more portable and use eval instead of seq in loops as seq is + too Linux-specific + * Sun Sep 06 2015 Grozdan Nikolov <neutrino8@gmail.com> 10.4.2 * Increased the default audio bitrate/quality value for Vorbis audio * Added mov file extention to the supported formats for chapter dumps
View file
h264enc-10.4.2.tar.gz/doc/ChangeLog -> h264enc-10.4.3.tar.gz/doc/ChangeLog
Changed
@@ -1,3 +1,8 @@ +2015-09-08 - h264enc 10.4.3 + * Removed the $ from the index of array variables + * Be more portable and use eval instead of seq in loops as seq is + too Linux-specific + 2015-09-06 - h264enc 10.4.2 * Increased the default audio bitrate/quality value for Vorbis audio * Added mov file extention to the supported formats for chapter dumps
View file
h264enc-10.4.2.tar.gz/h264enc -> h264enc-10.4.3.tar.gz/h264enc
Changed
@@ -1,5 +1,5 @@ #!/usr/bin/env bash -# $Id: h264enc, v 10.4.2, 2015/09/06, gn Exp $ +# $Id: h264enc, v 10.4.3, 2015/09/08, gn Exp $ # # Encode BDs/DVDs/VCDs/video files to the H.264/AVC/MPEG-4 Part 10 # video format using MEncoder from MPlayer @@ -23,7 +23,7 @@ shopt -u expand_aliases export PATH=$PATH:/usr/local/bin -version=10.4.2 +version=10.4.3 configversion=35 green() { echo -e "\e[1;32m$1\e[0;39;49m"; } @@ -176,11 +176,11 @@ # Amount of audio tracks to support # Any non-zero value will do -MAX_AMOUNT_AUD_TRACKS="3" +MAX_AMOUNT_AUD_TRACKS="2" # Amount of subtitles to support # Any non-zero value will do -MAX_AMOUNT_SUBS="3" +MAX_AMOUNT_SUBS="2" # Containers ALLOW_MKV_MUXING="y" @@ -2827,11 +2827,11 @@ video_subtitles_language_func() { printf "Provide the 2 or 3 letter Language code (sub $i) [press 'Enter' to skip]: " - read sublang[$i] - if [ ! -z "${sublang[$i]}" ]; then - SUBLANG[$i]="${sublang[$i]}" + read sublang[i] + if [ ! -z "${sublang[i]}" ]; then + SUBLANG[i]="${sublang[i]}" else - SUBLANG[$i]=und + SUBLANG[i]=und fi } @@ -2868,18 +2868,18 @@ fi ;; import-external) - for i in $(seq 1 $MAX_AMOUNT_SUBS); do + for i in $(eval echo "{1..$MAX_AMOUNT_SUBS}"); do printf "Provide the Subtitle file (Sub $i) [press 'Enter' to skip]: " - read -e subfile[$i] - if [ ! -z "${subfile[$i]}" ]; then - if [ ! -f "${subfile[$i]}" ]; then + read -e subfile[i] + if [ ! -z "${subfile[i]}" ]; then + if [ ! -f "${subfile[i]}" ]; then echo - error "-> No such file: '${subfile[$i]}'" + error "-> No such file: '${subfile[i]}'" error "-> Skipping subtitle $i" echo else video_subtitles_language_func - EXTSUB[$i]="${subfile[$i]}" + EXTSUB[i]="${subfile[i]}" fi fi done @@ -2978,20 +2978,20 @@ # encoding time, second/third/... one after # encoding has finished get_subtitles_func $source - for i in $(seq 1 $MAX_AMOUNT_SUBS); do + for i in $(eval echo "{1..$MAX_AMOUNT_SUBS}"); do printf "Specify the Subtitle ID number (sub $i) [press 'Enter' to skip]: " - read subid[$i] - if [ ! -z "$(echo ${subid[$i]} | grep '[a-zA-Z]')" ]; then + read subid[i] + if [ ! -z "$(echo ${subid[i]} | grep '[a-zA-Z]')" ]; then echo error "-> You have to specify the Subtitle ID number, not the language code!" error "-> Skipping subtitle $i" echo else - if [ ! -z "${subid[$i]}" ]; then - subtitle[$i]="-sid ${subid[$i]}" - vobsubout[$i]="-vobsubout \"${OUTPUT%.*}_sub$i\" -vobsuboutindex $(($i-1))" - IDXFILE[$i]="${OUTPUT%.*}_sub$i.idx" - SUBFILE[$i]="${OUTPUT%.*}_sub$i.sub" + if [ ! -z "${subid[i]}" ]; then + subtitle[i]="-sid ${subid[i]}" + vobsubout[i]="-vobsubout \"${OUTPUT%.*}_sub$i\" -vobsuboutindex $(($i-1))" + IDXFILE[i]="${OUTPUT%.*}_sub$i.idx" + SUBFILE[i]="${OUTPUT%.*}_sub$i.sub" fi fi done @@ -3344,25 +3344,25 @@ ;; subs) if [ ! -z "${vobsubout[*]}" ]; then - for i in $(seq 1 $MAX_AMOUNT_SUBS); do - if [ -e "${IDXFILE[$i]}" -o -e "${SUBFILE[$i]}" ]; then + for i in $(eval echo "{1..$MAX_AMOUNT_SUBS}"); do + if [ -e "${IDXFILE[i]}" -o -e "${SUBFILE[i]}" ]; then echo break fi done fi counter=1 - for i in $(seq 1 $MAX_AMOUNT_SUBS); do - while [ -e "${IDXFILE[$i]}.$counter.old" -o -e "${SUBFILE[$i]}.$counter.old" ]; do + for i in $(eval echo "{1..$MAX_AMOUNT_SUBS}"); do + while [ -e "${IDXFILE[i]}.$counter.old" -o -e "${SUBFILE[i]}.$counter.old" ]; do counter=$(($counter+1)) done - if [ -e "${IDXFILE[$i]}" ]; then - green "-> Renaming existing file to '$(basename "${IDXFILE[$i]}.$counter.old")'" - mv -f "${IDXFILE[$i]}" "${IDXFILE[$i]}.$counter.old" - fi - if [ -e "${SUBFILE[$i]}" ]; then - green "-> Renaming existing file to '$(basename "${SUBFILE[$i]}.$counter.old")'" - mv -f "${SUBFILE[$i]}" "${SUBFILE[$i]}.$counter.old" + if [ -e "${IDXFILE[i]}" ]; then + green "-> Renaming existing file to '$(basename "${IDXFILE[i]}.$counter.old")'" + mv -f "${IDXFILE[i]}" "${IDXFILE[i]}.$counter.old" + fi + if [ -e "${SUBFILE[i]}" ]; then + green "-> Renaming existing file to '$(basename "${SUBFILE[i]}.$counter.old")'" + mv -f "${SUBFILE[i]}" "${SUBFILE[i]}.$counter.old" fi done ;; @@ -3705,7 +3705,7 @@ if [ ! -z "$BDTITLES" ]; then green "-> Found $BDTITLES titles" echo - for t in $(seq 1 $BDTITLES); do + for t in $(eval echo "{1..$BDTITLES}"); do TITLELENGTH="$($MPLAYER br:// $MPLAYEROPTS $device $MPOPTS 2>/dev/null | grep "^ID_BLURAY_TITLE_${t}_LENGTH" | awk -F= '{print $2}')" if [ ! -z "$TITLELENGTH" -a "$TITLELENGTH" != "0.000" -a "$TITLELENGTH" != "0" ]; then green "-> Title $t: $(($(echo "$TITLELENGTH" | awk -F. '{print $1}')/60)) minutes or $TITLELENGTH seconds" @@ -5144,7 +5144,7 @@ error "-> Could not detect any audio tracks and info!" else TRKID="$(($TRKS-1))" - for i in $(seq 0 $TRKID); do + for i in $(eval echo "{0..$TRKID}"); do AUDINFO="$TEMPDIR/audinfo" $MPLAYER "$sourcetype" $MPLAYEROPTS $device $demuxer $cache -channels 8 -vo null -ao null -aid $i -identify -frames 1 2>/dev/null > "$AUDINFO" AUDCDC="$(grep '^ID_AUDIO_CODEC' "$AUDINFO" | tail -n 1 | awk -F= '{print $2}' | sed 's|ff||g')" @@ -5170,7 +5170,7 @@ AUDCH="?" fi if [ "$AUDCH" != "?" ]; then - MAXAUDCH[$i]="$AUDCH" + MAXAUDCH[i]="$AUDCH" fi if [ -z "$AUDRATE" ]; then AUDRATE="?" @@ -5183,8 +5183,8 @@ fi CDCNAME="$(echo "$AUDCDC" | tr '[:lower:]' '[:upper:]' | sed 's|DCA|DTS|; s|AC3|AC-3|; s|TRUEHD|Dolby TrueHD|; s|MP3FLOAT|MP3|; s|EAC3|E-AC-3|')" green "-> Track $(($i+1)): Audio ID: $i, Codec: $CDCNAME, Bitrate: $AUDBTR, Rate: $AUDRATE, Channels: $AUDCH, Language: $AUDLNG" - if [ ! -z "${MAXAUDCH[$i]}" ]; then - if [ ${MAXAUDCH[$i]} -gt 6 ]; then + if [ ! -z "${MAXAUDCH[i]}" ]; then + if [ ${MAXAUDCH[i]} -gt 6 ]; then error "-> Track $(($i+1)): Warning: track contains more than 6 channels. Max supported by h264enc is 6!" fi fi @@ -5194,7 +5194,7 @@ ;; esac echo - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do if [ "$i" = "1" ]; then case "$source" in file|bd) defdac="default is 0" ;; @@ -5204,8 +5204,8 @@ defdac="press 'Enter' to skip" fi printf "Track $i: Specify the Audio ID number [$defdac]: " - read dac[$i] - if [ ! -z "$(echo ${dac[$i]} | grep '[a-zA-Z]')" ]; then + read dac[i] + if [ ! -z "$(echo ${dac[i]} | grep '[a-zA-Z]')" ]; then error "-> You have to specify the 'Audio ID' number, not the language code!" exit_func 1 fi @@ -5216,32 +5216,32 @@ TRACKID[1]=yes aid[1]="-aid ${dac[1]}" else - if [ ! -z "${dac[$i]}" ]; then - TRACKID[$i]=yes - aid[$i]="-aid ${dac[$i]}" + if [ ! -z "${dac[i]}" ]; then + TRACKID[i]=yes + aid[i]="-aid ${dac[i]}" fi fi case "$source" in dvd) - GETAUDLANG[$i]="$(grep "$(echo ${aid[$i]} | awk '{print $2}')" "$AUDTRKS" | grep -o 'language.*' | awk '{print $2}')" - if [ ! -z "${GETAUDLANG[$i]}" ]; then - if [ "${GETAUDLANG[$i]}" = "unknown" ]; then - AUDLANG[$i]="und" + GETAUDLANG[i]="$(grep "$(echo ${aid[i]} | awk '{print $2}')" "$AUDTRKS" | grep -o 'language.*' | awk '{print $2}')" + if [ ! -z "${GETAUDLANG[i]}" ]; then + if [ "${GETAUDLANG[i]}" = "unknown" ]; then + AUDLANG[i]="und" else - AUDLANG[$i]="${GETAUDLANG[$i]}" + AUDLANG[i]="${GETAUDLANG[i]}" fi else - AUDLANG[$i]="und" + AUDLANG[i]="und" fi ;; file|bd) - if [ "${TRACKID[$i]}" = "yes" ]; then + if [ "${TRACKID[i]}" = "yes" ]; then printf "Track $i: Specify the 2 or 3 letter Language code for Tagging [press 'Enter' to skip]: " - read audlang[$i] - if [ ! -z "${audlang[$i]}" ]; then - AUDLANG[$i]="${audlang[$i]}" + read audlang[i] + if [ ! -z "${audlang[i]}" ]; then + AUDLANG[i]="${audlang[i]}" else - AUDLANG[$i]="und" + AUDLANG[i]="und" fi fi ;; @@ -5257,15 +5257,15 @@ mp3_audio_func() { printf "Track $i: Specify the MP3 Audio Encoding Mode [ABR/CBR/VBR/PRESET - default is ABR]: " - read mp3mode[$i] - case "${mp3mode[$i]}" in + read mp3mode[i] + case "${mp3mode[i]}" in a*|A*|"") printf "Track $i: Specify the MP3 Average Bitrate [default is 140]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - abitrate[$i]="abr:br=140" + read ab[i] + if [ -z "${ab[i]}" ]; then + abitrate[i]="abr:br=140" else - abitrate[$i]="abr:br=${ab[$i]}" + abitrate[i]="abr:br=${ab[i]}" fi ;; c*|C*) @@ -5281,24 +5281,24 @@ echo "6 -> 96 kbps 13 -> 320 kbps" echo printf "Track $i: Select the MP3 Audio Bitrate [default is 10]: " - read ab[$i] - case "${ab[$i]}" in - 0) abitrate[$i]="cbr:br=32" ;; - 1) abitrate[$i]="cbr:br=40" ;; - 2) abitrate[$i]="cbr:br=48" ;; - 3) abitrate[$i]="cbr:br=56" ;; - 4) abitrate[$i]="cbr:br=64" ;; - 5) abitrate[$i]="cbr:br=80" ;; - 6) abitrate[$i]="cbr:br=96" ;; - 7) abitrate[$i]="cbr:br=112" ;; - 8) abitrate[$i]="cbr:br=128" ;; - 9) abitrate[$i]="cbr:br=160" ;; - 10|"") abitrate[$i]="cbr:br=192" ;; - 11) abitrate[$i]="cbr:br=224" ;; - 12) abitrate[$i]="cbr:br=256" ;; - 13) abitrate[$i]="cbr:br=320" ;; + read ab[i] + case "${ab[i]}" in + 0) abitrate[i]="cbr:br=32" ;; + 1) abitrate[i]="cbr:br=40" ;; + 2) abitrate[i]="cbr:br=48" ;; + 3) abitrate[i]="cbr:br=56" ;; + 4) abitrate[i]="cbr:br=64" ;; + 5) abitrate[i]="cbr:br=80" ;; + 6) abitrate[i]="cbr:br=96" ;; + 7) abitrate[i]="cbr:br=112" ;; + 8) abitrate[i]="cbr:br=128" ;; + 9) abitrate[i]="cbr:br=160" ;; + 10|"") abitrate[i]="cbr:br=192" ;; + 11) abitrate[i]="cbr:br=224" ;; + 12) abitrate[i]="cbr:br=256" ;; + 13) abitrate[i]="cbr:br=320" ;; *) - error "-> Track $i: Unknown option: '${ab[$i]}'" + error "-> Track $i: Unknown option: '${ab[i]}'" error "-> Exiting in function: mp3_audio_func()" exit_func 1 ;; @@ -5306,11 +5306,11 @@ ;; v*|V*) printf "Track $i: Specify the desired MP3 Audio Quality [0-9, lower is better - default is 3]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - abitrate[$i]="q=3" + read ab[i] + if [ -z "${ab[i]}" ]; then + abitrate[i]="q=3" else - abitrate[$i]="q=${ab[$i]}" + abitrate[i]="q=${ab[i]}" fi ;; p*|P*) @@ -5323,12 +5323,12 @@ echo "3 -> Insane (CBR: 320 kbps)" echo printf "Track $i: Select an MP3 preset [default is 1]: " - read mp3preset[$i] - case "${mp3preset[$i]}" in - 0) abitrate[$i]="preset=medium" ;; - 1|"") abitrate[$i]="preset=standard" ;; - 2) abitrate[$i]="preset=extreme" ;; - 3) abitrate[$i]="preset=insane" ;; + read mp3preset[i] + case "${mp3preset[i]}" in + 0) abitrate[i]="preset=medium" ;; + 1|"") abitrate[i]="preset=standard" ;; + 2) abitrate[i]="preset=extreme" ;; + 3) abitrate[i]="preset=insane" ;; *) error "-> Track $i: Unknown MP3 preset!" error "-> Exiting in function: mp3_audio_func()" @@ -5337,24 +5337,24 @@ esac ;; *) - error "-> Track $i: Unknown MP3 encoding mode: '${mp3mode[$i]}'" + error "-> Track $i: Unknown MP3 encoding mode: '${mp3mode[i]}'" error "-> Exiting in function: mp3_audio_func()" exit_func 1 ;; esac printf "Track $i: Specify the MP3 Algorithmic Quality [0-9, lower is better - default is 3]: " - read aq[$i] - if [ -z "${aq[$i]}" ]; then - aquality[$i]=":aq=3" + read aq[i] + if [ -z "${aq[i]}" ]; then + aquality[i]=":aq=3" else - aquality[$i]=":aq=${aq[$i]}" + aquality[i]=":aq=${aq[i]}" fi printf "Track $i: Specify the MP3 Audio Input Gain [0.0-10.0 - default is 2.2]: " - read aig[$i] - if [ -z "${aig[$i]}" ]; then - again[$i]=":vol=2.2" + read aig[i] + if [ -z "${aig[i]}" ]; then + again[i]=":vol=2.2" else - again[$i]=":vol=${aig[$i]}" + again[i]=":vol=${aig[i]}" fi echo brown "Track $i: MP3 Channel Modes" @@ -5365,19 +5365,19 @@ echo "3 -> Mono" echo printf "Track $i: Select the MP3 Channel Mode [default is 1]: " - read mp3chan[$i] - case "${mp3chan[$i]}" in - 0) mp3channel[$i]=":mode=0" ;; - 1|"") mp3channel[$i]=":mode=1" ;; - 2) mp3channel[$i]=":mode=2" ;; - 3) mp3channel[$i]=":mode=3" ;; + read mp3chan[i] + case "${mp3chan[i]}" in + 0) mp3channel[i]=":mode=0" ;; + 1|"") mp3channel[i]=":mode=1" ;; + 2) mp3channel[i]=":mode=2" ;; + 3) mp3channel[i]=":mode=3" ;; *) - error "-> Track $i: Unknown MP3 channel option: '${mp3chan[$i]}'" + error "-> Track $i: Unknown MP3 channel option: '${mp3chan[i]}'" error "-> Exiting in function: mp3_audio_func()" exit_func 1 ;; esac - acodec[$i]="-oac mp3lame -lameopts ${abitrate[$i]}${aquality[$i]}${again[$i]}${mp3channel[$i]}" + acodec[i]="-oac mp3lame -lameopts ${abitrate[i]}${aquality[i]}${again[i]}${mp3channel[i]}" } # Shared by both lavc and aften @@ -5397,29 +5397,29 @@ echo "9 -> 160 kbps" echo printf "Track $i: Select the AC-3 Audio Bitrate [default is 15]: " - read ab[$i] - case "${ab[$i]}" in - 0) abitrate[$i]="32" ;; - 1) abitrate[$i]="40" ;; - 2) abitrate[$i]="48" ;; - 3) abitrate[$i]="56" ;; - 4) abitrate[$i]="64" ;; - 5) abitrate[$i]="80" ;; - 6) abitrate[$i]="96" ;; - 7) abitrate[$i]="112" ;; - 8) abitrate[$i]="128" ;; - 9) abitrate[$i]="160" ;; - 10) abitrate[$i]="192" ;; - 11) abitrate[$i]="224" ;; - 12) abitrate[$i]="256" ;; - 13) abitrate[$i]="320" ;; - 14) abitrate[$i]="384" ;; - 15|"") abitrate[$i]="448" ;; - 16) abitrate[$i]="512" ;; - 17) abitrate[$i]="576" ;; - 18) abitrate[$i]="640" ;; + read ab[i] + case "${ab[i]}" in + 0) abitrate[i]="32" ;; + 1) abitrate[i]="40" ;; + 2) abitrate[i]="48" ;; + 3) abitrate[i]="56" ;; + 4) abitrate[i]="64" ;; + 5) abitrate[i]="80" ;; + 6) abitrate[i]="96" ;; + 7) abitrate[i]="112" ;; + 8) abitrate[i]="128" ;; + 9) abitrate[i]="160" ;; + 10) abitrate[i]="192" ;; + 11) abitrate[i]="224" ;; + 12) abitrate[i]="256" ;; + 13) abitrate[i]="320" ;; + 14) abitrate[i]="384" ;; + 15|"") abitrate[i]="448" ;; + 16) abitrate[i]="512" ;; + 17) abitrate[i]="576" ;; + 18) abitrate[i]="640" ;; *) - error "-> Track $i: Unknown option: '${ab[$i]}'" + error "-> Track $i: Unknown option: '${ab[i]}'" error "-> Exiting in function: ac3_bitrate_func()" exit_func 1 ;; @@ -5427,7 +5427,7 @@ } aften_ac3_audio_func() { - acodec[$i]="-oac pcm" + acodec[i]="-oac pcm" ac3_bitrate_func echo brown "Track $i: AC-3 Dynamic Range Compression" @@ -5440,72 +5440,72 @@ echo "5 -> None" echo printf "Track $i: Select the AC-3 DRC Profile [default is 5]: " - read ac3drc[$i] - case "${ac3drc[$i]}" in - 0) drc[$i]="0" ;; - 1) drc[$i]="1" ;; - 2) drc[$i]="2" ;; - 3) drc[$i]="3" ;; - 4) drc[$i]="4" ;; - 5|"") drc[$i]="5" ;; + read ac3drc[i] + case "${ac3drc[i]}" in + 0) drc[i]="0" ;; + 1) drc[i]="1" ;; + 2) drc[i]="2" ;; + 3) drc[i]="3" ;; + 4) drc[i]="4" ;; + 5|"") drc[i]="5" ;; *) - error "-> Track $i: Unknown option: '${ac3drc[$i]}'" + error "-> Track $i: Unknown option: '${ac3drc[i]}'" error "-> Exiting in function: aften_ac3_audio_func()" exit_func 1 ;; esac printf "Track $i: Specify the AC-3 Exponent Strategy search size [1-32, higher is better - default is 16]: " - read ac3exp[$i] - if [ -z "${ac3exp[$i]}" ]; then - exps[$i]="16" + read ac3exp[i] + if [ -z "${ac3exp[i]}" ]; then + exps[i]="16" else - exps[$i]="${ac3exp[$i]}" + exps[i]="${ac3exp[i]}" fi - ac3lfe[$i]=$(get_selection_func "Track $i: Apply an AC-3 LFE low-pass filter? [y/N]: ") - if [ "${ac3lfe[$i]}" = "y" ]; then - lfe[$i]="1" + ac3lfe[i]=$(get_selection_func "Track $i: Apply an AC-3 LFE low-pass filter? [y/N]: ") + if [ "${ac3lfe[i]}" = "y" ]; then + lfe[i]="1" else - lfe[$i]="0" + lfe[i]="0" fi - ac3opts[$i]="-b ${abitrate[$i]} -dynrng ${drc[$i]} -exps ${exps[$i]} -lfefilter ${lfe[$i]} -readtoeof 1" + ac3opts[i]="-b ${abitrate[i]} -dynrng ${drc[i]} -exps ${exps[i]} -lfefilter ${lfe[i]} -readtoeof 1" } lavc_ac3_audio_func() { ac3_bitrate_func #printf "Track $i: Specify the Dynamic Range Compression [0.0-1.0, higher is stronger - default is 0.0]: " - #read drc[$i] - #if [ ! -z "${drc[$i]}" ]; then - # ac3drc[$i]="-a52drc ${drc[$i]}" + #read drc[i] + #if [ ! -z "${drc[i]}" ]; then + # ac3drc[i]="-a52drc ${drc[i]}" #fi - acodec[$i]="-oac lavc -lavcopts acodec=ac3:abitrate=${abitrate[$i]}" + acodec[i]="-oac lavc -lavcopts acodec=ac3:abitrate=${abitrate[i]}" } eac3_audio_func() { - acodec[$i]="-oac pcm" + acodec[i]="-oac pcm" printf "Track $i: Specify the E-AC-3 Audio Bitrate in kbps [default is 384]: " - read eac3br[$i] - if [ -z "${eac3br[$i]}" ]; then - abitrate[$i]="384" + read eac3br[i] + if [ -z "${eac3br[i]}" ]; then + abitrate[i]="384" else - abitrate[$i]="${eac3br[$i]}" + abitrate[i]="${eac3br[i]}" fi } dts_audio_func() { - acodec[$i]="-oac pcm" + acodec[i]="-oac pcm" printf "Track $i: Specify the DTS Audio Bitrate in kbps [default is 755]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - abitrate[$i]="754500" + read ab[i] + if [ -z "${ab[i]}" ]; then + abitrate[i]="754500" else - if [ "${ab[$i]}" -le "1509" ]; then - abitrate[$i]="$((${ab[$i]}*1000))" + if [ "${ab[i]}" -le "1509" ]; then + abitrate[i]="$((${ab[i]}*1000))" else echo error "-> Maximum allowed bitrate is 1509 kbps!" error "-> Defaulting to max allowed bitrate" echo - abitrate[$i]="1509750" + abitrate[i]="1509750" fi fi } @@ -5514,100 +5514,100 @@ case "$1" in fl|flhq|qt|qthq|ag1|ag1hq|ipc|ipchq|ip|iphq|iph|iphhq|atv|atvhq|ar|arhq|ar5|ar5hq|bb|bbhq|nks60|nks60hq|psp|psphq|ps3|ps3hq|mz|mzhq) printf "Track $i: Specify the AAC Average Bitrate [default is 128]: " - read abitrate[$i] - if [ -z "${abitrate[$i]}" ]; then - br[$i]="br=128" + read abitrate[i] + if [ -z "${abitrate[i]}" ]; then + br[i]="br=128" else - br[$i]="br=${abitrate[$i]}" + br[i]="br=${abitrate[i]}" fi case "$1" in ag1|ag1hq|ipc|ipchq|ip|iphq|iph|iphhq|atv|atvhq|ar|arhq|ar5|ar5hq|bb|bbhq|nks60|nks60hq|psp|psphq) # Restrict audio bitrate for devices # with a maximum allowed bitrate - if [ $(echo ${br[$i]} | awk '{print $2}') -gt 160 ]; then + if [ $(echo ${br[i]} | awk '{print $2}') -gt 160 ]; then echo green "-> Track $i: Audio bitrate for this portable device may not exceed 160 kbps!" green "-> Track $i: Falling back to 128 kbps!" echo - br[$i]="br=128" + br[i]="br=128" fi ;; esac ;; *) printf "Track $i: Specify the AAC encoding mode [ABR/VBR - default is ABR]: " - read aacmode[$i] - case "${aacmode[$i]}" in + read aacmode[i] + case "${aacmode[i]}" in a*|A*|"") printf "Track $i: Specify the AAC Average Bitrate [default is 192]: " - read abitrate[$i] - if [ -z "${abitrate[$i]}" ]; then - br[$i]="br=192" + read abitrate[i] + if [ -z "${abitrate[i]}" ]; then + br[i]="br=192" else - br[$i]="br=${abitrate[$i]}" + br[i]="br=${abitrate[i]}" fi ;; v*|V*) SKIPBTRCALC=yes printf "Track $i: Specify the AAC Quality value [10-500, higher is better - default is 150]: " - read abitrate[$i] - if [ -z "${abitrate[$i]}" ]; then - br[$i]="quality=150" + read abitrate[i] + if [ -z "${abitrate[i]}" ]; then + br[i]="quality=150" else - br[$i]="quality=${abitrate[$i]}" + br[i]="quality=${abitrate[i]}" fi ;; *) - error "-> Track $i: Unknown AAC encoding mode: '${aacmode[$i]}'" + error "-> Track $i: Unknown AAC encoding mode: '${aacmode[i]}'" error "-> Exiting in function: aac_audio_func()" exit_func 1 ;; esac ;; esac - tempns[$i]=$(get_selection_func "Track $i: Enable AAC Temporal Noise Shaping? [y/N]: ") - if [ "${tempns[$i]}" = "y" ]; then - tns[$i]=":tns" + tempns[i]=$(get_selection_func "Track $i: Enable AAC Temporal Noise Shaping? [y/N]: ") + if [ "${tempns[i]}" = "y" ]; then + tns[i]=":tns" fi - acodec[$i]="-oac faac -faacopts ${br[$i]}${tns[$i]}:mpeg=4:object=2" + acodec[i]="-oac faac -faacopts ${br[i]}${tns[i]}:mpeg=4:object=2" } neroaac_audio_func() { - acodec[$i]="-oac pcm" + acodec[i]="-oac pcm" case "$1" in qt|qthq|ag1|ag1hq|ipc|ipchq|ip|iphq|iph|iphhq|atv|atvhq|ar|arhq|ar5|ar5hq|bb|bbhq|nks60|nks60hq|psp|psphq|ps3|ps3hq|mz|mzhq|mx|mxhq) - aacprof[$i]="-lc" - AACTYPE[$i]="LC-AAC" + aacprof[i]="-lc" + AACTYPE[i]="LC-AAC" printf "Track $i: Specify the AAC Audio Bitrate in kbps [default is 128]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - neroaacbr[$i]="-br 128000 ${aacprof[$i]}" + read ab[i] + if [ -z "${ab[i]}" ]; then + neroaacbr[i]="-br 128000 ${aacprof[i]}" else - neroaacbr[$i]="-br $((${ab[$i]}*1000)) ${aacprof[$i]}" + neroaacbr[i]="-br $((${ab[i]}*1000)) ${aacprof[i]}" fi case "$1" in ag1|ag1hq|ipc|ipchq|ip|iphq|iph|iphhq|atv|atvhq|ar|arhq|ar5|ar5hq|bb|bbhq|nks60|nks60hq|psp|psphq) - if [ $(echo ${neroaacbr[$i]} | awk '{print $2}') -gt 160000 ]; then + if [ $(echo ${neroaacbr[i]} | awk '{print $2}') -gt 160000 ]; then echo green "-> Track $i: Audio bitrate for this preset may not exceed 160 kbps!" green "-> Track $i: Falling back to 128 kbps!" echo - neroaacbr[$i]="-br 128000 ${aacprof[$i]}" + neroaacbr[i]="-br 128000 ${aacprof[i]}" fi ;; esac - nero2p[$i]=$(get_selection_func "Track $i: Use 2-pass AAC encoding instead of 1-pass? [y/N]: ") - if [ "${nero2p[$i]}" = "y" ]; then - neroaacbr[$i]="${neroaacbr[$i]} -2pass" + nero2p[i]=$(get_selection_func "Track $i: Use 2-pass AAC encoding instead of 1-pass? [y/N]: ") + if [ "${nero2p[i]}" = "y" ]; then + neroaacbr[i]="${neroaacbr[i]} -2pass" fi ;; *) printf "Track $i: Which AAC Profile to use? [LC/HE/HEv2 - default is LC]: " - read aac_profile[$i] - case "${aac_profile[$i]}" in - LC|lc|"") aacprof[$i]="-lc"; AACTYPE[$i]="LC-AAC" ;; - HE|he) aacprof[$i]="-he"; AACTYPE[$i]="HE-AACv1" ;; - HEv2|hev2) aacprof[$i]="-hev2"; AACTYPE[$i]="HE-AACv2" ;; + read aac_profile[i] + case "${aac_profile[i]}" in + LC|lc|"") aacprof[i]="-lc"; AACTYPE[i]="LC-AAC" ;; + HE|he) aacprof[i]="-he"; AACTYPE[i]="HE-AACv1" ;; + HEv2|hev2) aacprof[i]="-hev2"; AACTYPE[i]="HE-AACv2" ;; *) error "-> Track $i: Unknown AAC profile" error "-> Exiting in function: neroaac_audio_func()" @@ -5615,20 +5615,20 @@ ;; esac printf "Track $i: Specify the AAC Encoding Mode [ABR/CBR/VBR - default is ABR]: " - read aacmode[$i] - case "${aacmode[$i]}" in + read aacmode[i] + case "${aacmode[i]}" in a*|A*|"") - case "${AACTYPE[$i]}" in - LC-AAC) defaacbr[$i]="192" ;; - HE-AACv1) defaacbr[$i]="55" ;; - HE-AACv2) defaacbr[$i]="25" ;; - esac - printf "Track $i: Specify the AAC Average Bitrate in kbps [default is ${defaacbr[$i]}]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - neroaacbr[$i]="-br $((${defaacbr[$i]}*1000)) ${aacprof[$i]}" + case "${AACTYPE[i]}" in + LC-AAC) defaacbr[i]="192" ;; + HE-AACv1) defaacbr[i]="55" ;; + HE-AACv2) defaacbr[i]="25" ;; + esac + printf "Track $i: Specify the AAC Average Bitrate in kbps [default is ${defaacbr[i]}]: " + read ab[i] + if [ -z "${ab[i]}" ]; then + neroaacbr[i]="-br $((${defaacbr[i]}*1000)) ${aacprof[i]}" else - neroaacbr[$i]="-br $((${ab[$i]}*1000)) ${aacprof[$i]}" + neroaacbr[i]="-br $((${ab[i]}*1000)) ${aacprof[i]}" fi ;; c*|C*) @@ -5644,24 +5644,24 @@ echo "6 -> 96 kbps 13 -> 320 kbps" echo printf "Track $i: Select the AAC Audio Bitrate [default is 10]: " - read ab[$i] - case "${ab[$i]}" in - 0) neroaacbr[$i]="-cbr 32000 ${aacprof[$i]}" ;; - 1) neroaacbr[$i]="-cbr 40000 ${aacprof[$i]}" ;; - 2) neroaacbr[$i]="-cbr 48000 ${aacprof[$i]}" ;; - 3) neroaacbr[$i]="-cbr 56000 ${aacprof[$i]}" ;; - 4) neroaacbr[$i]="-cbr 64000 ${aacprof[$i]}" ;; - 5) neroaacbr[$i]="-cbr 80000 ${aacprof[$i]}" ;; - 6) neroaacbr[$i]="-cbr 96000 ${aacprof[$i]}" ;; - 7) neroaacbr[$i]="-cbr 112000 ${aacprof[$i]}" ;; - 8) neroaacbr[$i]="-cbr 128000 ${aacprof[$i]}" ;; - 9) neroaacbr[$i]="-cbr 160000 ${aacprof[$i]}" ;; - 10|"") neroaacbr[$i]="-cbr 192000 ${aacprof[$i]}" ;; - 11) neroaacbr[$i]="-cbr 224000 ${aacprof[$i]}" ;; - 12) neroaacbr[$i]="-cbr 256000 ${aacprof[$i]}" ;; - 13) neroaacbr[$i]="-cbr 320000 ${aacprof[$i]}" ;; + read ab[i] + case "${ab[i]}" in + 0) neroaacbr[i]="-cbr 32000 ${aacprof[i]}" ;; + 1) neroaacbr[i]="-cbr 40000 ${aacprof[i]}" ;; + 2) neroaacbr[i]="-cbr 48000 ${aacprof[i]}" ;; + 3) neroaacbr[i]="-cbr 56000 ${aacprof[i]}" ;; + 4) neroaacbr[i]="-cbr 64000 ${aacprof[i]}" ;; + 5) neroaacbr[i]="-cbr 80000 ${aacprof[i]}" ;; + 6) neroaacbr[i]="-cbr 96000 ${aacprof[i]}" ;; + 7) neroaacbr[i]="-cbr 112000 ${aacprof[i]}" ;; + 8) neroaacbr[i]="-cbr 128000 ${aacprof[i]}" ;; + 9) neroaacbr[i]="-cbr 160000 ${aacprof[i]}" ;; + 10|"") neroaacbr[i]="-cbr 192000 ${aacprof[i]}" ;; + 11) neroaacbr[i]="-cbr 224000 ${aacprof[i]}" ;; + 12) neroaacbr[i]="-cbr 256000 ${aacprof[i]}" ;; + 13) neroaacbr[i]="-cbr 320000 ${aacprof[i]}" ;; *) - error "-> Track $i: Unknown option: '${ab[$i]}'" + error "-> Track $i: Unknown option: '${ab[i]}'" error "-> Exiting in function: neroaac_audio_func()" exit_func 1 ;; @@ -5670,30 +5670,30 @@ v*|V*) SKIPBTRCALC=yes # Assuming Stereo channels - case "${AACTYPE[$i]}" in - LC-AAC) defaacbr[$i]="0.4" ;; - HE-AACv1) defaacbr[$i]="0.22" ;; - HE-AACv2) defaacbr[$i]="0.11" ;; - esac - printf "Track $i: Specify the AAC Quality value [0.0-1.0, higher is better - default is ${defaacbr[$i]}]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - neroaacbr[$i]="-q ${defaacbr[$i]} ${aacprof[$i]}" + case "${AACTYPE[i]}" in + LC-AAC) defaacbr[i]="0.4" ;; + HE-AACv1) defaacbr[i]="0.22" ;; + HE-AACv2) defaacbr[i]="0.11" ;; + esac + printf "Track $i: Specify the AAC Quality value [0.0-1.0, higher is better - default is ${defaacbr[i]}]: " + read ab[i] + if [ -z "${ab[i]}" ]; then + neroaacbr[i]="-q ${defaacbr[i]} ${aacprof[i]}" else - neroaacbr[$i]="-q ${ab[$i]} ${aacprof[$i]}" + neroaacbr[i]="-q ${ab[i]} ${aacprof[i]}" fi ;; *) - error "-> Track $i: Unknown option: '${aacmode[$i]}'" + error "-> Track $i: Unknown option: '${aacmode[i]}'" error "-> Exiting in function: neroaac_audio_func()" exit_func 1 ;; esac - case "${aacmode[$i]}" in + case "${aacmode[i]}" in a*|A*|c*|C*|"") - nero2p[$i]=$(get_selection_func "Track $i: Use 2-pass AAC encoding instead of 1-pass? [y/N]: ") - if [ "${nero2p[$i]}" = "y" ]; then - neroaacbr[$i]="${neroaacbr[$i]} -2pass" + nero2p[i]=$(get_selection_func "Track $i: Use 2-pass AAC encoding instead of 1-pass? [y/N]: ") + if [ "${nero2p[i]}" = "y" ]; then + neroaacbr[i]="${neroaacbr[i]} -2pass" fi ;; esac @@ -5702,114 +5702,114 @@ } fdkaac_audio_func() { - acodec[$i]="-oac pcm" + acodec[i]="-oac pcm" case "$1" in qt|qthq|ag1|ag1hq|ipc|ipchq|ip|iphq|iph|iphhq|atv|atvhq|ar|arhq|ar5|ar5hq|bb|bbhq|nks60|nks60hq|psp|psphq|ps3|ps3hq|mz|mzhq|mx|mxhq) - aacprof[$i]="-t 2" - AACTYPE[$i]="LC-AAC" + aacprof[i]="-t 2" + AACTYPE[i]="LC-AAC" printf "Track $i: Specify the AAC Audio Bitrate in kbps [default is 192]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - fdkaacbr[$i]="-r 192000 ${aacprof[$i]} -a 1" + read ab[i] + if [ -z "${ab[i]}" ]; then + fdkaacbr[i]="-r 192000 ${aacprof[i]} -a 1" else - fdkaacbr[$i]="-r $((${ab[$i]}*1000)) ${aacprof[$i]} -a 1" + fdkaacbr[i]="-r $((${ab[i]}*1000)) ${aacprof[i]} -a 1" fi case "$1" in ag1|ag1hq|ipc|ipchq|ip|iphq|iph|iphhq|atv|atvhq|ar|arhq|ar5|ar5hq|bb|bbhq|nks60|nks60hq|psp|psphq) - if [ $(echo ${fdkaacbr[$i]} | awk '{print $2}') -gt 160000 ]; then + if [ $(echo ${fdkaacbr[i]} | awk '{print $2}') -gt 160000 ]; then echo green "-> Track $i: Audio bitrate for this preset may not exceed 160 kbps!" green "-> Track $i: Falling back to 128 kbps!" echo - fdkaacbr[$i]="-r 128000 ${aacprof[$i]} -a 1" + fdkaacbr[i]="-r 128000 ${aacprof[i]} -a 1" fi ;; esac ;; *) printf "Track $i: Which AAC Profile to use? [LC/HE/HEv2 - default is LC]: " - read aac_profile[$i] - case "${aac_profile[$i]}" in - LC|lc|"") aacprof[$i]="-t 2"; AACTYPE[$i]="LC-AAC"; defaacbr[$i]="192" ;; - HE|he) aacprof[$i]="-t 5"; AACTYPE[$i]="HE-AACv1"; defaacbr[$i]="55" ;; - HEv2|hev2) aacprof[$i]="-t 29"; AACTYPE[$i]="HE-AACv2"; defaacbr[$i]="25" ;; + read aac_profile[i] + case "${aac_profile[i]}" in + LC|lc|"") aacprof[i]="-t 2"; AACTYPE[i]="LC-AAC"; defaacbr[i]="192" ;; + HE|he) aacprof[i]="-t 5"; AACTYPE[i]="HE-AACv1"; defaacbr[i]="55" ;; + HEv2|hev2) aacprof[i]="-t 29"; AACTYPE[i]="HE-AACv2"; defaacbr[i]="25" ;; *) error "-> Track $i: Unknown AAC profile" error "-> Exiting in function: fdkaac_audio_func()" exit_func 1 ;; esac - printf "Track $i: Specify the AAC Audio Bitrate in kbps [default is ${defaacbr[$i]}]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - fdkaacbr[$i]="-r $((${defaacbr[$i]}*1000)) ${aacprof[$i]} -a 1" + printf "Track $i: Specify the AAC Audio Bitrate in kbps [default is ${defaacbr[i]}]: " + read ab[i] + if [ -z "${ab[i]}" ]; then + fdkaacbr[i]="-r $((${defaacbr[i]}*1000)) ${aacprof[i]} -a 1" else - fdkaacbr[$i]="-r $((${ab[$i]}*1000)) ${aacprof[$i]} -a 1" + fdkaacbr[i]="-r $((${ab[i]}*1000)) ${aacprof[i]} -a 1" fi ;; esac } aacplus_audio_func() { - acodec[$i]="-oac pcm" - channels[$i]="-channels 2" + acodec[i]="-oac pcm" + channels[i]="-channels 2" printf "Track $i: Specify the AAC+ Audio Bitrate in kbps [default is 55]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - aacplusbr[$i]="55" + read ab[i] + if [ -z "${ab[i]}" ]; then + aacplusbr[i]="55" else - if [[ ${ab[$i]} -ge 64 ]]; then + if [[ ${ab[i]} -ge 64 ]]; then echo green "-> Track $i: Bitrates of 64 kbps and up are not supported!" green "-> Track $i: Using default bitrate of 55 kbps" echo - aacplusbr[$i]="55" - elif [[ ${ab[$i]} -lt 48 ]]; then + aacplusbr[i]="55" + elif [[ ${ab[i]} -lt 48 ]]; then echo green "-> Track $i: Bitrates below 48 kbps use Parametric Stereo" green " which is not recommended!" green "-> Track $i: Using default bitrate of 55 kbps" echo - aacplusbr[$i]="55" + aacplusbr[i]="55" else - aacplusbr[$i]="${ab[$i]}" + aacplusbr[i]="${ab[i]}" fi fi } vorbis_audio_func() { - acodec[$i]="-oac pcm" + acodec[i]="-oac pcm" printf "Track $i: Select the Vorbis encoding mode [ABR/VBR - default is VBR]: " - read vorbmode[$i] - case "${vorbmode[$i]}" in + read vorbmode[i] + case "${vorbmode[i]}" in a*|A*) printf "Track $i: Specify the Vorbis nominal bitrate in kbps [default is 160]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - vorbq[$i]="-b 160" + read ab[i] + if [ -z "${ab[i]}" ]; then + vorbq[i]="-b 160" else - vorbq[$i]="-b ${ab[$i]}" + vorbq[i]="-b ${ab[i]}" fi ;; v*|V*|"") printf "Track $i: Specify the Vorbis audio quality [-1-10, higher is better - default is 4]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - vorbq[$i]="-q 4" + read ab[i] + if [ -z "${ab[i]}" ]; then + vorbq[i]="-q 4" else - if [ ! -z "$(echo ${ab[$i]} | grep '\.')" ]; then + if [ ! -z "$(echo ${ab[i]} | grep '\.')" ]; then echo error "-> Track $i: Floating point values are not supported yet!" - error "-> Track $i: Rounding value to $(echo ${ab[$i]} | awk -F. '{print $1}')" + error "-> Track $i: Rounding value to $(echo ${ab[i]} | awk -F. '{print $1}')" echo - vorbq[$i]="-q $(echo ${ab[$i]} | awk -F. '{print $1}')" + vorbq[i]="-q $(echo ${ab[i]} | awk -F. '{print $1}')" else - vorbq[$i]="-q ${ab[$i]}" + vorbq[i]="-q ${ab[i]}" fi fi ;; *) - error "-> Unknown option: '${vorbmode[$i]}'" + error "-> Unknown option: '${vorbmode[i]}'" error "-> Exiting in function: vorbis_audio_func()" exit_func 1 ;; @@ -5817,36 +5817,36 @@ } opus_audio_func() { - acodec[$i]="-oac pcm" + acodec[i]="-oac pcm" printf "Track $i: Select the Opus encoding mode [CBR/VBR - default is VBR]: " - read opusm[$i] - case "${opusm[$i]}" in - V*|v*|"") opusmode[$i]="--vbr" ;; - C*|c*) opusmode[$i]="--hard-cbr" ;; + read opusm[i] + case "${opusm[i]}" in + V*|v*|"") opusmode[i]="--vbr" ;; + C*|c*) opusmode[i]="--hard-cbr" ;; *) - error "-> Unknown option: '${opusm[$i]}'" + error "-> Unknown option: '${opusm[i]}'" error "-> Exiting in function: opus_audio_func()" exit_func 1 ;; esac printf "Track $i: Specify the Audio Bitrate in kbps [default is 128]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - opusbr[$i]="128" + read ab[i] + if [ -z "${ab[i]}" ]; then + opusbr[i]="128" else - opusbr[$i]="${ab[$i]}" + opusbr[i]="${ab[i]}" fi - opusopts[$i]="${opusmode[$i]} --bitrate ${opusbr[$i]} --ignorelength" + opusopts[i]="${opusmode[i]} --bitrate ${opusbr[i]} --ignorelength" } flac_audio_func() { - acodec[$i]="-oac pcm" + acodec[i]="-oac pcm" printf "Track $i: Specify the FLAC Audio compression [0-8, lower is better - default is 5]: " - read ab[$i] - if [ -z "${ab[$i]}" ]; then - flacq[$i]="-5" + read ab[i] + if [ -z "${ab[i]}" ]; then + flacq[i]="-5" else - flacq[$i]="-${ab[$i]}" + flacq[i]="-${ab[i]}" fi } @@ -5856,7 +5856,7 @@ audio_codec_exit_func() { case "$1" in error) - error "-> Track $i: Unknown/unsupported audio codec: '${audiocodec[$i]}'" + error "-> Track $i: Unknown/unsupported audio codec: '${audiocodec[i]}'" ;; esac error "-> Exiting in function: audio_codec_exit_func()" @@ -5866,7 +5866,7 @@ # Check availability of the selected audio codec. MISSING="is missing from your system!" check_audio_codec_func() { - case "${audiocodec[$i]}" in + case "${audiocodec[i]}" in mp3) if [ -z "$($MENCODER -oac help 2>/dev/null | awk '{print $1}' | grep 'mp3lame')" ]; then error "-> MEncoder does not support MP3 audio encoding!" @@ -5960,19 +5960,19 @@ echo "8 -> Skip audio resampling" echo printf "Track $i: Select a Resample filter [default is 7]: " - read rsmpfilter[$i] - case "${rsmpfilter[$i]}" in - 0) resample[$i]="resample=${hertz[$i]}:1:0 -srate ${hertz[$i]}" ;; - 1) resample[$i]="resample=${hertz[$i]}:0:0 -srate ${hertz[$i]}" ;; - 2) resample[$i]="resample=${hertz[$i]}:1:1 -srate ${hertz[$i]}" ;; - 3) resample[$i]="resample=${hertz[$i]}:0:1 -srate ${hertz[$i]}" ;; - 4) resample[$i]="resample=${hertz[$i]}:1:2 -srate ${hertz[$i]}" ;; - 5) resample[$i]="resample=${hertz[$i]}:0:2 -srate ${hertz[$i]}" ;; - 6) resample[$i]="lavcresample=${hertz[$i]}:16:0 -srate ${hertz[$i]}" ;; - 7|"") resample[$i]="lavcresample=${hertz[$i]}:16:1 -srate ${hertz[$i]}" ;; + read rsmpfilter[i] + case "${rsmpfilter[i]}" in + 0) resample[i]="resample=${hertz[i]}:1:0 -srate ${hertz[i]}" ;; + 1) resample[i]="resample=${hertz[i]}:0:0 -srate ${hertz[i]}" ;; + 2) resample[i]="resample=${hertz[i]}:1:1 -srate ${hertz[i]}" ;; + 3) resample[i]="resample=${hertz[i]}:0:1 -srate ${hertz[i]}" ;; + 4) resample[i]="resample=${hertz[i]}:1:2 -srate ${hertz[i]}" ;; + 5) resample[i]="resample=${hertz[i]}:0:2 -srate ${hertz[i]}" ;; + 6) resample[i]="lavcresample=${hertz[i]}:16:0 -srate ${hertz[i]}" ;; + 7|"") resample[i]="lavcresample=${hertz[i]}:16:1 -srate ${hertz[i]}" ;; 8) skiprsmp=yes ;; *) - error "-> Track $i: Unknown option: '${rsmpfilter[$i]}'" + error "-> Track $i: Unknown option: '${rsmpfilter[i]}'" error "-> Exiting in function: audio_resample_filters_func()" exit_func 1 ;; @@ -5980,16 +5980,16 @@ } audio_resample_func() { - rsmp[$i]=$(get_selection_func "Track $i: Would you like to Resample the Audio? [y/N]: ") - if [ "${rsmp[$i]}" = "y" ]; then + rsmp[i]=$(get_selection_func "Track $i: Would you like to Resample the Audio? [y/N]: ") + if [ "${rsmp[i]}" = "y" ]; then case "$source" in file|vcd|dvd|bd) echo green "-> Track $i: Detecting audio sample rate..." - AUDSAMPLE[$i]=$($MPLAYER "$sourcetype" $MPLAYEROPTS $device ${aid[$i]} $demuxer $cache $MPOPTS 2>/dev/null \ + AUDSAMPLE[i]=$($MPLAYER "$sourcetype" $MPLAYEROPTS $device ${aid[i]} $demuxer $cache $MPOPTS 2>/dev/null \ | grep '^ID_AUDIO_RATE' | tail -n 1 | awk -F= '{print $2}') - if [ ! -z "${AUDSAMPLE[$i]}" ]; then - green "-> Track $i: Detected: ${AUDSAMPLE[$i]} Hz ($(echo "scale=1; ${AUDSAMPLE[$i]} / 1000" | $BC -l) kHz)" + if [ ! -z "${AUDSAMPLE[i]}" ]; then + green "-> Track $i: Detected: ${AUDSAMPLE[i]} Hz ($(echo "scale=1; ${AUDSAMPLE[i]} / 1000" | $BC -l) kHz)" else error "-> Track $i: Could not detect the sample rate!" fi @@ -5998,7 +5998,7 @@ echo brown "Track $i: Available Sample Frequencies" brown "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - case "${audiocodec[$i]}" in + case "${audiocodec[i]}" in pcm|vorbis|opus) echo "0 -> 8000 Hz (8 kHz)" echo "1 -> 11025 Hz (11 kHz)" @@ -6011,19 +6011,19 @@ echo "8 -> 48000 Hz (48 kHz)" echo printf "Track $i: Select a Sample Frequency [default is 7]: " - read freq[$i] - case "${freq[$i]}" in - 0) hertz[$i]="8000" ;; - 1) hertz[$i]="11025" ;; - 2) hertz[$i]="12000" ;; - 3) hertz[$i]="16000" ;; - 4) hertz[$i]="22050" ;; - 5) hertz[$i]="24000" ;; - 6) hertz[$i]="32000" ;; - 7|"") hertz[$i]="44100" ;; - 8) hertz[$i]="48000" ;; + read freq[i] + case "${freq[i]}" in + 0) hertz[i]="8000" ;; + 1) hertz[i]="11025" ;; + 2) hertz[i]="12000" ;; + 3) hertz[i]="16000" ;; + 4) hertz[i]="22050" ;; + 5) hertz[i]="24000" ;; + 6) hertz[i]="32000" ;; + 7|"") hertz[i]="44100" ;; + 8) hertz[i]="48000" ;; *) - error "-> Track $i: Unknown option: '${freq[$i]}'" + error "-> Track $i: Unknown option: '${freq[i]}'" error "-> Exiting in function: audio_resample_func()" exit_func 1 ;; @@ -6044,22 +6044,22 @@ echo "11 -> 96000 Hz (96 kHz)" echo printf "Track $i: Select a Sample Frequency [default is 7]: " - read freq[$i] - case "${freq[$i]}" in - 0) hertz[$i]="8000" ;; - 1) hertz[$i]="11025" ;; - 2) hertz[$i]="12000" ;; - 3) hertz[$i]="16000" ;; - 4) hertz[$i]="22050" ;; - 5) hertz[$i]="24000" ;; - 6) hertz[$i]="32000" ;; - 7|"") hertz[$i]="44100" ;; - 8) hertz[$i]="48000" ;; - 9) hertz[$i]="64000" ;; - 10) hertz[$i]="88200" ;; - 11) hertz[$i]="96000" ;; + read freq[i] + case "${freq[i]}" in + 0) hertz[i]="8000" ;; + 1) hertz[i]="11025" ;; + 2) hertz[i]="12000" ;; + 3) hertz[i]="16000" ;; + 4) hertz[i]="22050" ;; + 5) hertz[i]="24000" ;; + 6) hertz[i]="32000" ;; + 7|"") hertz[i]="44100" ;; + 8) hertz[i]="48000" ;; + 9) hertz[i]="64000" ;; + 10) hertz[i]="88200" ;; + 11) hertz[i]="96000" ;; *) - error "-> Track $i: Unknown option: '${freq[$i]}'" + error "-> Track $i: Unknown option: '${freq[i]}'" error "-> Exiting in function: audio_resample_func()" exit_func 1 ;; @@ -6071,13 +6071,13 @@ echo "2 -> 48000 Hz (48 kHz)" echo printf "Track $i: Select a Sample Frequency [default is 1]: " - read freq[$i] - case "${freq[$i]}" in - 0) hertz[$i]="32000" ;; - 1|"") hertz[$i]="44100" ;; - 2) hertz[$i]="48000" ;; + read freq[i] + case "${freq[i]}" in + 0) hertz[i]="32000" ;; + 1|"") hertz[i]="44100" ;; + 2) hertz[i]="48000" ;; *) - error "-> Track $i: Unknown option: '${freq[$i]}'" + error "-> Track $i: Unknown option: '${freq[i]}'" error "-> Exiting in function: audio_resample_func()" exit_func 1 ;; @@ -6089,12 +6089,12 @@ audio_resample_filters_func ;; *) - if [ "${AUDSAMPLE[$i]}" = "${hertz[$i]}" ]; then + if [ "${AUDSAMPLE[i]}" = "${hertz[i]}" ]; then echo error "-> Track $i: Detected sample rate equals selected one!" - error "-> Track $i: ${AUDSAMPLE[$i]} Hz = ${hertz[$i]} Hz" + error "-> Track $i: ${AUDSAMPLE[i]} Hz = ${hertz[i]} Hz" error "-> Track $i: Skipping resampling" - resample[$i]= + resample[i]= else audio_resample_filters_func fi @@ -6105,61 +6105,61 @@ # Audio EQ audio_equalizer_func() { - audioeq[$i]=$(get_selection_func "Track $i: Would you like to use the Audio Equalizer? [y/N]: ") - if [ "${audioeq[$i]}" = "y" ]; then + audioeq[i]=$(get_selection_func "Track $i: Would you like to use the Audio Equalizer? [y/N]: ") + if [ "${audioeq[i]}" = "y" ]; then printf "Track $i: Specify the Audio Equalizer parameters [press 'Enter' to skip]: " - read audeqparams[$i] - if [ ! -z "${audeqparams[$i]}" ]; then - audeq[$i]="equalizer=${audeqparams[$i]}," + read audeqparams[i] + if [ ! -z "${audeqparams[i]}" ]; then + audeq[i]="equalizer=${audeqparams[i]}," fi fi } # Volume normalization audio_volnorm_func() { - norm[$i]=$(get_selection_func "Track $i: Would you like to Normalize the Audio Volume? [y/N]: ") - if [ "${norm[$i]}" = "y" ]; then - volnorm[$i]="volnorm=1," + norm[i]=$(get_selection_func "Track $i: Would you like to Normalize the Audio Volume? [y/N]: ") + if [ "${norm[i]}" = "y" ]; then + volnorm[i]="volnorm=1," fi } # Volume audio_volume_func() { - avolume[$i]=$(get_selection_func "Track $i: Would you like to set the Audio Volume? [y/N]: ") - if [ "${avolume[$i]}" = "y" ]; then + avolume[i]=$(get_selection_func "Track $i: Would you like to set the Audio Volume? [y/N]: ") + if [ "${avolume[i]}" = "y" ]; then printf "Track $i: Specify the Audio volume in dB [-200-60 - default is 2]: " - read dbgain[$i] - if [ -z "${dbgain[$i]}" ]; then - volume[$i]="volume=2:1," + read dbgain[i] + if [ -z "${dbgain[i]}" ]; then + volume[i]="volume=2:1," else - volume[$i]="volume=${dbgain[$i]}:1," + volume[i]="volume=${dbgain[i]}:1," fi fi } # Audio panning audio_pan_func() { - audpan[$i]=$(get_selection_func "Track $i: Would you like to Pan the Audio? [y/N]: ") - if [ "${audpan[$i]}" = "y" ]; then + audpan[i]=$(get_selection_func "Track $i: Would you like to Pan the Audio? [y/N]: ") + if [ "${audpan[i]}" = "y" ]; then printf "Track $i: Specify the panning filter values [press 'Enter' to skip]: " - read panval[$i] - if [ ! -z "${panval[$i]}" ]; then - pan[$i]="pan=${panval[$i]}," + read panval[i] + if [ ! -z "${panval[i]}" ]; then + pan[i]="pan=${panval[i]}," fi fi } # Audio channel routing/removing/adding filter audio_channels_func() { - if [ -z "${chanfilter[$i]}" ]; then - audroute[$i]=$(get_selection_func "Track $i: Would you like to Add/Remove/Route Audio Channels? [y/N]: ") - if [ "${audroute[$i]}" = "y" ]; then + if [ -z "${chanfilter[i]}" ]; then + audroute[i]=$(get_selection_func "Track $i: Would you like to Add/Remove/Route Audio Channels? [y/N]: ") + if [ "${audroute[i]}" = "y" ]; then printf "Track $i: Specify the Audio Channels filter parameters [press 'Enter' to skip]: " - read audchanparams[$i] - if [ ! -z "${audchanparams[$i]}" ]; then - audchannels[$i]="channels=${audchanparams[$i]}," - if [ "$(echo "${audchannels[$i]}" | awk -F: '{print $1}' | sed 's|channels=||; s|,||')" -gt "6" ]; then - audchannels[$i]= + read audchanparams[i] + if [ ! -z "${audchanparams[i]}" ]; then + audchannels[i]="channels=${audchanparams[i]}," + if [ "$(echo "${audchannels[i]}" | awk -F: '{print $1}' | sed 's|channels=||; s|,||')" -gt "6" ]; then + audchannels[i]= echo error "-> More than 6 channels not supported!" error "-> Skipping channels filter" @@ -6172,31 +6172,31 @@ # Audio channels decode function audio_channels_decode_func() { - case "${audiocodec[$i]}" in + case "${audiocodec[i]}" in aftenac3|lavcac3|eac3|dts|aac|neroaac|fdkaac|vorbis|opus|flac|pcm|"") - chan[$i]=$(get_selection_func "Track $i: Would you like to Decode/Output more than 2 Audio Channels? [y/N]: ") - if [ "${chan[$i]}" = "y" ]; then + chan[i]=$(get_selection_func "Track $i: Would you like to Decode/Output more than 2 Audio Channels? [y/N]: ") + if [ "${chan[i]}" = "y" ]; then case "$source" in dvd|bd) defchans="6" ;; *) defchans="2" ;; esac audio_channels_amount_func() { printf "Track $i: How many Channels to Decode? [1/2/3/4/5/6 - default is $defchans]: " - read chandec[$i] - case "${chandec[$i]}" in + read chandec[i] + case "${chandec[i]}" in [1-6]|"") true ;; *) echo - green "-> '${chandec[$i]}' channels not supported!" + green "-> '${chandec[i]}' channels not supported!" green "-> Falling back to 2 channels decoding" echo - chandec[$i]=2 + chandec[i]=2 ;; esac - if [ -z "${chandec[$i]}" ]; then - channels[$i]="-channels $defchans" + if [ -z "${chandec[i]}" ]; then + channels[i]="-channels $defchans" else - channels[$i]="-channels ${chandec[$i]}" + channels[i]="-channels ${chandec[i]}" fi } echo @@ -6224,32 +6224,32 @@ echo " channels." echo printf "Track $i: Decode (D) or Output (O) the Channels? [D/O - default is D]: " - read decout[$i] - case "${decout[$i]}" in + read decout[i] + case "${decout[i]}" in o|O|0) if [ "$DISABLE_ALL_AUD_FILTERS" = "n" ]; then audio_channels_amount_func - if [ "${AACTYPE[$i]}" = "HE-AACv2" ]; then - if [ "$(echo ${channels[$i]} | awk '{print $2}')" != "2" ]; then + if [ "${AACTYPE[i]}" = "HE-AACv2" ]; then + if [ "$(echo ${channels[i]} | awk '{print $2}')" != "2" ]; then echo error "-> HE-AACv2 only supports Stereo!" error "-> Forcing stereo output decoding" echo - channels[$i]="-channels 2" + channels[i]="-channels 2" fi else printf "Track $i: How many Channels to Output? [1/2/3/4/5/6 - default is 2]: " - read outchan[$i] - case "${outchan[$i]}" in - 1) chanfilter[$i]="channels=1," ;; - 2|"") chanfilter[$i]="channels=2," ;; - 3) chanfilter[$i]="channels=3," ;; - 4) chanfilter[$i]="channels=4," ;; - 5) chanfilter[$i]="channels=5," ;; - 6) chanfilter[$i]="channels=6," ;; + read outchan[i] + case "${outchan[i]}" in + 1) chanfilter[i]="channels=1," ;; + 2|"") chanfilter[i]="channels=2," ;; + 3) chanfilter[i]="channels=3," ;; + 4) chanfilter[i]="channels=4," ;; + 5) chanfilter[i]="channels=5," ;; + 6) chanfilter[i]="channels=6," ;; *) echo - error "-> '${outchan[$i]}' channels not supported!" + error "-> '${outchan[i]}' channels not supported!" error "-> Exiting in function: audio_channels_decode_func()" echo exit_func 1 @@ -6273,9 +6273,9 @@ } aac_hev2_func() { - if [ "${AACTYPE[$i]}" = "HE-AACv2" ]; then - if [ -z "${channels[$i]}" ]; then - channels[$i]="-channels 2" + if [ "${AACTYPE[i]}" = "HE-AACv2" ]; then + if [ -z "${channels[i]}" ]; then + channels[i]="-channels 2" fi fi } @@ -6284,7 +6284,7 @@ # the above audio filters audio_filters_func() { aud_filters_func() { - case "${audiocodec[$i]}" in + case "${audiocodec[i]}" in mp3) test "$ALLOW_AUD_PAN" = "y" && audio_pan_func test "$ALLOW_AUD_EQUALIZER" = "y" && audio_equalizer_func @@ -6300,8 +6300,8 @@ } if [ "$ALLOW_AUD_CHANNELS" = "y" -o "$ALLOW_AUD_PAN" = "y" -o "$ALLOW_AUD_NORMALIZE" = "y" \ -o "$ALLOW_AUD_VOLUME" = "y" -o "$ALLOW_AUD_RESAMPLE" = "y" -o "$ALLOW_AUD_EQUALIZER" = "y" ]; then - use_audfilters[$i]=$(get_selection_func "Track $i: Would you like to use Audio filters? [y/N]: ") - if [ "${use_audfilters[$i]}" = "y" ]; then + use_audfilters[i]=$(get_selection_func "Track $i: Would you like to use Audio filters? [y/N]: ") + if [ "${use_audfilters[i]}" = "y" ]; then case "$1" in fl|flhq|ag1|ag1hq|ipc|ipchq|ip|iphq|iph|iphhq|atv|atvhq|ar|arhq|ar5|ar5hq|bb|bbhq|nks60|nks60hq|psp|psphq|ps3|ps3hq|mz|mzhq|mx|mxhq) # Resampling is skipped here. See the @@ -6321,34 +6321,34 @@ audio_filters_var_func() { case "$1" in fl|flhq) - afilters[$i]="${audchannels[$i]}${pan[$i]}${audeq[$i]}${volnorm[$i]}${volume[$i]},lavcresample=22050:16:1 -srate 22050" - channels[$i]="-channels 2" + afilters[i]="${audchannels[i]}${pan[i]}${audeq[i]}${volnorm[i]}${volume[i]},lavcresample=22050:16:1 -srate 22050" + channels[i]="-channels 2" ;; qt|qthq) - afilters[$i]="${audchannels[$i]}${pan[$i]}${audeq[$i]}${volnorm[$i]}${volume[$i]}${resample[$i]}" - channels[$i]="-channels 2" + afilters[i]="${audchannels[i]}${pan[i]}${audeq[i]}${volnorm[i]}${volume[i]}${resample[i]}" + channels[i]="-channels 2" ;; ag1|ag1hq|ipc|ipchq|ip|iphq|iph|iphhq|atv|atvhq|ar|arhq|ar5|ar5hq|bb|bbhq|psp|psphq|mz|mzhq|mx|mxhq) - afilters[$i]="${audchannels[$i]}${pan[$i]}${audeq[$i]}${volnorm[$i]}${volume[$i]},lavcresample=48000:16:1 -srate 48000" - channels[$i]="-channels 2" + afilters[i]="${audchannels[i]}${pan[i]}${audeq[i]}${volnorm[i]}${volume[i]},lavcresample=48000:16:1 -srate 48000" + channels[i]="-channels 2" ;; ps3|ps3hq) - afilters[$i]="${chanfilter[$i]}${audchannels[$i]}${pan[$i]}${audeq[$i]}${volnorm[$i]}${volume[$i]},lavcresample=48000:16:1 -srate 48000" + afilters[i]="${chanfilter[i]}${audchannels[i]}${pan[i]}${audeq[i]}${volnorm[i]}${volume[i]},lavcresample=48000:16:1 -srate 48000" ;; nks60|nks60hq) - afilters[$i]="${audchannels[$i]}${pan[$i]}${audeq[$i]}${volnorm[$i]}${volume[$i]},lavcresample=44100:16:1 -srate 44100" - channels[$i]="-channels 2" + afilters[i]="${audchannels[i]}${pan[i]}${audeq[i]}${volnorm[i]}${volume[i]},lavcresample=44100:16:1 -srate 44100" + channels[i]="-channels 2" ;; *) - afilters[$i]="${chanfilter[$i]}${audchannels[$i]}${pan[$i]}${audeq[$i]}${volnorm[$i]}${volume[$i]}${resample[$i]}" + afilters[i]="${chanfilter[i]}${audchannels[i]}${pan[i]}${audeq[i]}${volnorm[i]}${volume[i]}${resample[i]}" ;; esac } audio_track_echo_func() { - for e in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do + for e in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do if [ "$e" != "1" ]; then - if [ "${TRACKID[$e]}" = "yes" ]; then + if [ "${TRACKID[e]}" = "yes" ]; then echo fi fi @@ -6357,10 +6357,10 @@ select_ac3_encoder_func() { printf "Track $i: Which AC-3 Encoder to use? [aften/lavc - default is lavc]: " - read ac3enc[$i] - case "${ac3enc[$i]}" in + read ac3enc[i] + case "${ac3enc[i]}" in lavc|LAVC|"") - audiocodec[$i]="lavcac3" + audiocodec[i]="lavcac3" lavc_ac3_audio_func ;; aften|AFTEN) @@ -6368,15 +6368,15 @@ echo error "-> 'aften' is missing from your system!" error "-> Falling back to the lavc encoder" - audiocodec[$i]="lavcac3" + audiocodec[i]="lavcac3" lavc_ac3_audio_func else - audiocodec[$i]="aftenac3" + audiocodec[i]="aftenac3" aften_ac3_audio_func fi ;; *) - error "-> Unsupported AC-3 encoder: '${ac3enc[$i]}'" + error "-> Unsupported AC-3 encoder: '${ac3enc[i]}'" error "-> Exiting in function: select_ac3_encoder_func()" exit_func 1 ;; @@ -6384,8 +6384,8 @@ } select_audio_codec_func() { - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then case "$1" in qt|qthq|iph|iphhq|fl|flhq) echo @@ -6415,8 +6415,8 @@ printf "Track $i: Select the Audio Codec [default is AAC]: " ;; esac - read audiocodec[$i] - audiocodec[$i]="$(echo ${audiocodec[$i]} | tr '[:upper:]' '[:lower:]')" + read audiocodec[i] + audiocodec[i]="$(echo "${audiocodec[i]}" | tr '[:upper:]' '[:lower:]')" check_audio_codec_func case "$source" in dir) @@ -6453,9 +6453,9 @@ exit_func 1 ;; esac - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - audiocodec[$i]="$(echo "$DEFAULT_AUD_CODEC" | tr '[:upper:]' '[:lower:]')" + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + audiocodec[i]="$(echo "$DEFAULT_AUD_CODEC" | tr '[:upper:]' '[:lower:]')" fi done else @@ -6488,15 +6488,15 @@ audio_copy_func() { # In case we try to copy AAC audio we need # to pass MEncoder the proper audio format - CPAUD[$i]="$($MPLAYER "$sourcetype" $MPLAYEROPTS $device $demuxer $cache ${aid[$i]} -vo null -ao null -frames 1 -identify 2>/dev/null | grep '^ID_AUDIO_CODEC' | tail -n 1 | awk -F= '{print $2}')" - if [ "${CPAUD[$i]}" = "ffaac" ]; then - audiofmt[$i]="-fafmttag 0x706d" + CPAUD[i]="$($MPLAYER "$sourcetype" $MPLAYEROPTS $device $demuxer $cache ${aid[i]} -vo null -ao null -frames 1 -identify 2>/dev/null | grep '^ID_AUDIO_CODEC' | tail -n 1 | awk -F= '{print $2}')" + if [ "${CPAUD[i]}" = "ffaac" ]; then + audiofmt[i]="-fafmttag 0x706d" fi # For TrueHD audio - if [ "${CPAUD[$i]}" = "fftruehd" ]; then - acodec[$i]="-nosound" + if [ "${CPAUD[i]}" = "fftruehd" ]; then + acodec[i]="-nosound" else - acodec[$i]="-oac copy -mc 0 -noskip -msglevel demuxer=-1 ${audiofmt[$i]}" + acodec[i]="-oac copy -mc 0 -noskip -msglevel demuxer=-1 ${audiofmt[i]}" fi } @@ -6523,9 +6523,9 @@ case "$3" in qt|qthq|iph|iphhq|fl|flhq) set_audio_codec_func $3 - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - case "${audiocodec[$i]}" in + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + case "${audiocodec[i]}" in aac|"") faac_audio_func $3 ask_audio_filters_func $3 @@ -6549,8 +6549,8 @@ audio_track_echo_func ;; nosound) - acodec[$i]="-nosound" - aid[$i]= + acodec[i]="-nosound" + aid[i]= ;; *) audio_codec_exit_func error @@ -6561,9 +6561,9 @@ ;; ag1|ag1hq|ipc|ipchq|ip|iphq|atv|atvhq|ar|arhq|ar5|ar5hq|bb|bbhq|nks60|nks60hq|psp|psphq|mx|mxhq) set_audio_codec_func $3 - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - case "${audiocodec[$i]}" in + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + case "${audiocodec[i]}" in aac|"") faac_audio_func $3 ask_audio_filters_func $3 @@ -6580,8 +6580,8 @@ audio_track_echo_func ;; nosound) - acodec[$i]="-nosound" - aid[$i]= + acodec[i]="-nosound" + aid[i]= ;; *) audio_codec_exit_func error @@ -6592,9 +6592,9 @@ ;; bd40|bdhq40|bd41|bdhq41) set_audio_codec_func $3 - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - case "${audiocodec[$i]}" in + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + case "${audiocodec[i]}" in ac3|"") select_ac3_encoder_func audio_channels_decode_func @@ -6617,8 +6617,8 @@ audio_copy_func ;; nosound) - acodec[$i]="-nosound" - aid[$i]= + acodec[i]="-nosound" + aid[i]= ;; *) audio_codec_exit_func error @@ -6629,9 +6629,9 @@ ;; avchd|avchdhq) set_audio_codec_func $3 - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - case "${audiocodec[$i]}" in + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + case "${audiocodec[i]}" in ac3|"") select_ac3_encoder_func audio_channels_decode_func @@ -6642,8 +6642,8 @@ audio_copy_func ;; nosound) - acodec[$i]="-nosound" - aid[$i]= + acodec[i]="-nosound" + aid[i]= ;; *) audio_codec_exit_func error @@ -6654,9 +6654,9 @@ ;; ps3|ps3hq) set_audio_codec_func $3 - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - case "${audiocodec[$i]}" in + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + case "${audiocodec[i]}" in aac|"") faac_audio_func $3 audio_channels_decode_func @@ -6679,8 +6679,8 @@ audio_copy_func ;; nosound) - acodec[$i]="-nosound" - aid[$i]= + acodec[i]="-nosound" + aid[i]= ;; *) audio_codec_exit_func error @@ -6691,9 +6691,9 @@ ;; mz|mzhq) set_audio_codec_func $3 - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - case "${audiocodec[$i]}" in + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + case "${audiocodec[i]}" in mp3) mp3_audio_func ask_audio_filters_func $3 @@ -6715,8 +6715,8 @@ audio_track_echo_func ;; nosound) - acodec[$i]="-nosound" - aid[$i]= + acodec[i]="-nosound" + aid[i]= ;; *) audio_codec_exit_func error @@ -6727,9 +6727,9 @@ ;; *) set_audio_codec_func $3 codec - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - case "${audiocodec[$i]}" in + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + case "${audiocodec[i]}" in mp3) mp3_audio_func ask_audio_filters_func $3 @@ -6797,7 +6797,7 @@ audio_track_echo_func ;; pcm) - acodec[$i]="-oac pcm" + acodec[i]="-oac pcm" audio_channels_decode_func ask_audio_filters_func $3 audio_track_echo_func @@ -6806,8 +6806,8 @@ audio_copy_func ;; nosound) - acodec[$i]="-nosound" - aid[$i]= + acodec[i]="-nosound" + aid[i]= ;; *) audio_codec_exit_func error @@ -6855,120 +6855,120 @@ TARGET_SIZE=$tfsm fi # Get the chosen audio bitrate - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - case "${audiocodec[$i]}" in + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + case "${audiocodec[i]}" in aftenac3|lavcac3|eac3) - AUDIO_BITRATE[$i]=${abitrate[$i]} + AUDIO_BITRATE[i]=${abitrate[i]} ;; dts) - AUDIO_BITRATE[$i]=$((${abitrate[$i]}/1000)) + AUDIO_BITRATE[i]=$((${abitrate[i]}/1000)) ;; mp3) - case "${mp3mode[$i]}" in + case "${mp3mode[i]}" in a*|A*|c*|C*|"") - AUDIO_BITRATE[$i]=$(echo ${abitrate[$i]} | awk -F= '{print $2}') + AUDIO_BITRATE[i]=$(echo ${abitrate[i]} | awk -F= '{print $2}') ;; v*|V*) # Use 10 kbps lesser compared # to the LAME specs - case "${abitrate[$i]}" in - q=0) AUDIO_BITRATE[$i]=230 ;; - q=1) AUDIO_BITRATE[$i]=200 ;; - q=2) AUDIO_BITRATE[$i]=180 ;; - q=3) AUDIO_BITRATE[$i]=165 ;; - q=4) AUDIO_BITRATE[$i]=155 ;; - q=5) AUDIO_BITRATE[$i]=120 ;; - q=6) AUDIO_BITRATE[$i]=105 ;; - q=7) AUDIO_BITRATE[$i]=90 ;; - q=8) AUDIO_BITRATE[$i]=75 ;; - q=9) AUDIO_BITRATE[$i]=54 ;; + case "${abitrate[i]}" in + q=0) AUDIO_BITRATE[i]=230 ;; + q=1) AUDIO_BITRATE[i]=200 ;; + q=2) AUDIO_BITRATE[i]=180 ;; + q=3) AUDIO_BITRATE[i]=165 ;; + q=4) AUDIO_BITRATE[i]=155 ;; + q=5) AUDIO_BITRATE[i]=120 ;; + q=6) AUDIO_BITRATE[i]=105 ;; + q=7) AUDIO_BITRATE[i]=90 ;; + q=8) AUDIO_BITRATE[i]=75 ;; + q=9) AUDIO_BITRATE[i]=54 ;; esac ;; p*|P*) - case "${mp3preset[$i]}" in - 0|"") AUDIO_BITRATE[$i]=160 ;; - 1) AUDIO_BITRATE[$i]=185 ;; - 2) AUDIO_BITRATE[$i]=210 ;; - 3) AUDIO_BITRATE[$i]=320 ;; + case "${mp3preset[i]}" in + 0|"") AUDIO_BITRATE[i]=160 ;; + 1) AUDIO_BITRATE[i]=185 ;; + 2) AUDIO_BITRATE[i]=210 ;; + 3) AUDIO_BITRATE[i]=320 ;; esac ;; esac ;; aac|"") - AUDIO_BITRATE[$i]=$(echo ${br[$i]} | sed 's|br=||g') + AUDIO_BITRATE[i]=$(echo ${br[i]} | sed 's|br=||g') ;; aac+) - AUDIO_BITRATE[$i]=${aacplusbr[$i]} + AUDIO_BITRATE[i]=${aacplusbr[i]} ;; neroaac) - AUDIO_BITRATE[$i]=$(($(echo ${neroaacbr[$i]} | awk '{print $2}')/1000)) + AUDIO_BITRATE[i]=$(($(echo ${neroaacbr[i]} | awk '{print $2}')/1000)) ;; fdkaac) - AUDIO_BITRATE[$i]=$(($(echo ${fdkaacbr[$i]} | awk '{print $2}')/1000)) + AUDIO_BITRATE[i]=$(($(echo ${fdkaacbr[i]} | awk '{print $2}')/1000)) ;; vorbis) - case "${vorbmode[$i]}" in + case "${vorbmode[i]}" in a*|A*) - AUDIO_BITRATE[$i]=$(echo ${vorbq[$i]} | awk '{print $2}') + AUDIO_BITRATE[i]=$(echo ${vorbq[i]} | awk '{print $2}') ;; v*|V*|"") # Quality values -> bitrate mappings - case "$(echo ${vorbq[$i]} | awk '{print $2}')" in - -1) AUDIO_BITRATE[$i]=45 ;; - 0) AUDIO_BITRATE[$i]=64 ;; - 1) AUDIO_BITRATE[$i]=80 ;; - 2) AUDIO_BITRATE[$i]=96 ;; - 3) AUDIO_BITRATE[$i]=112 ;; - 4) AUDIO_BITRATE[$i]=128 ;; - 5) AUDIO_BITRATE[$i]=160 ;; - 6) AUDIO_BITRATE[$i]=192 ;; - 7) AUDIO_BITRATE[$i]=224 ;; - 8) AUDIO_BITRATE[$i]=256 ;; - 9) AUDIO_BITRATE[$i]=320 ;; - 10) AUDIO_BITRATE[$i]=500 ;; + case "$(echo ${vorbq[i]} | awk '{print $2}')" in + -1) AUDIO_BITRATE[i]=45 ;; + 0) AUDIO_BITRATE[i]=64 ;; + 1) AUDIO_BITRATE[i]=80 ;; + 2) AUDIO_BITRATE[i]=96 ;; + 3) AUDIO_BITRATE[i]=112 ;; + 4) AUDIO_BITRATE[i]=128 ;; + 5) AUDIO_BITRATE[i]=160 ;; + 6) AUDIO_BITRATE[i]=192 ;; + 7) AUDIO_BITRATE[i]=224 ;; + 8) AUDIO_BITRATE[i]=256 ;; + 9) AUDIO_BITRATE[i]=320 ;; + 10) AUDIO_BITRATE[i]=500 ;; esac ;; esac ;; opus) - AUDIO_BITRATE[$i]=${opusbr[$i]} + AUDIO_BITRATE[i]=${opusbr[i]} ;; pcm) # Get channels info. Resampling is not taken # into account yet so we assume 48 kHz - if [ ! -z "${channels[$i]}" -a ! -z "${chanfilter[$i]}" ]; then - case "$(echo "${chanfilter[$i]}" | sed 's|channels=||; s|,||')" in - 1) AUDIO_BITRATE[$i]=768 ;; - 2) AUDIO_BITRATE[$i]=1536 ;; - 3) AUDIO_BITRATE[$i]=2304 ;; - 4) AUDIO_BITRATE[$i]=3072 ;; - 5) AUDIO_BITRATE[$i]=3840 ;; - 6) AUDIO_BITRATE[$i]=4608 ;; - 7) AUDIO_BITRATE[$i]=5376 ;; - 8) AUDIO_BITRATE[$i]=6144 ;; + if [ ! -z "${channels[i]}" -a ! -z "${chanfilter[i]}" ]; then + case "$(echo "${chanfilter[i]}" | sed 's|channels=||; s|,||')" in + 1) AUDIO_BITRATE[i]=768 ;; + 2) AUDIO_BITRATE[i]=1536 ;; + 3) AUDIO_BITRATE[i]=2304 ;; + 4) AUDIO_BITRATE[i]=3072 ;; + 5) AUDIO_BITRATE[i]=3840 ;; + 6) AUDIO_BITRATE[i]=4608 ;; + 7) AUDIO_BITRATE[i]=5376 ;; + 8) AUDIO_BITRATE[i]=6144 ;; esac - elif [ ! -z "${channels[$i]}" -a -z "${chanfilter[$i]}" ]; then - case "$(echo "${channels[$i]}" | awk '{print $2}')" in - 1) AUDIO_BITRATE[$i]=768 ;; - 2) AUDIO_BITRATE[$i]=1536 ;; - 3) AUDIO_BITRATE[$i]=2304 ;; - 4) AUDIO_BITRATE[$i]=3072 ;; - 5) AUDIO_BITRATE[$i]=3840 ;; - 6) AUDIO_BITRATE[$i]=4608 ;; - 7) AUDIO_BITRATE[$i]=5376 ;; - 8) AUDIO_BITRATE[$i]=6144 ;; + elif [ ! -z "${channels[i]}" -a -z "${chanfilter[i]}" ]; then + case "$(echo "${channels[i]}" | awk '{print $2}')" in + 1) AUDIO_BITRATE[i]=768 ;; + 2) AUDIO_BITRATE[i]=1536 ;; + 3) AUDIO_BITRATE[i]=2304 ;; + 4) AUDIO_BITRATE[i]=3072 ;; + 5) AUDIO_BITRATE[i]=3840 ;; + 6) AUDIO_BITRATE[i]=4608 ;; + 7) AUDIO_BITRATE[i]=5376 ;; + 8) AUDIO_BITRATE[i]=6144 ;; esac else - AUDIO_BITRATE[$i]=1536 + AUDIO_BITRATE[i]=1536 fi ;; copy) - $MPLAYER "$sourcetype" $MPLAYEROPTS $device ${aid[$i]} $cache -vo null -ao null -identify -demuxer lavf -frames 1 2>/dev/null > "$TEMPDIR/copybitrate" - AUDIOBTR[$i]="$(grep '^ID_AUDIO_BITRATE' "$TEMPDIR/copybitrate" | tail -n 1 | awk -F= '{print $2}')" - case "${AUDIOBTR[$i]}" in + $MPLAYER "$sourcetype" $MPLAYEROPTS $device ${aid[i]} $cache -vo null -ao null -identify -demuxer lavf -frames 1 2>/dev/null > "$TEMPDIR/copybitrate" + AUDIOBTR[i]="$(grep '^ID_AUDIO_BITRATE' "$TEMPDIR/copybitrate" | tail -n 1 | awk -F= '{print $2}')" + case "${AUDIOBTR[i]}" in [1-9]*) - AUDIO_BITRATE[$i]=$((${AUDIOBTR[$i]}/1000)) + AUDIO_BITRATE[i]=$((${AUDIOBTR[i]}/1000)) ;; *|"") echo @@ -6976,18 +6976,18 @@ green "-> Track $i: If you know the audio bitrate, please provide it below in kbps" echo printf "Track $i: Provide the Audio Bitrate in kbps [default is 0]: " - read cpbtr[$i] - if [ -z "${cpbtr[$i]}" ]; then - AUDIO_BITRATE[$i]=0 + read cpbtr[i] + if [ -z "${cpbtr[i]}" ]; then + AUDIO_BITRATE[i]=0 else - AUDIO_BITRATE[$i]=${cpbtr[$i]} + AUDIO_BITRATE[i]=${cpbtr[i]} fi ;; esac rm -f "$TEMPDIR/copybitrate" ;; nosound) - AUDIO_BITRATE[$i]=0 + AUDIO_BITRATE[i]=0 ;; esac fi @@ -7137,10 +7137,10 @@ videofilters="-vf $(echo $ivtcfilter$delogofilter$cropfilter$deintfilter$fpsfilter$ild$deblockfilter$denoisefilter$debandfilter$ili$brightnessfilter$colorspacefilter,softskip,$dsizefilter$expandfilter_bfr$scale$isws$swsparam$expandfilter_afr$noisefilter$unsharpfilter$eq2filter,harddup$intfilter$telecinefilter | sed 's|^,||; s|,,|,|g; s|,$||')" # Audio filters chain -for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - if [ ! -z "${afilters[$i]}" ]; then - audiofilters[$i]="-af $(echo ${afilters[$i]} | sed 's|^,||; s|,,|,|g; s|,$||')" +for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + if [ ! -z "${afilters[i]}" ]; then + audiofilters[i]="-af $(echo ${afilters[i]} | sed 's|^,||; s|,,|,|g; s|,$||')" fi fi done @@ -7392,9 +7392,9 @@ *) audfmt="-oac pcm" ;; esac dump_subs_func() { - for i in $(seq 2 $MAX_AMOUNT_SUBS); do - if [ ! -z "${vobsubout[$i]}" ]; then - echo "$MENCODER $sourcetype $device $chapters $ofps ${subtitle[$i]} ${vobsubout[$i]} ${aid[$i]} $audfmt -ovc copy -o /dev/null" + for i in $(eval echo "{2..$MAX_AMOUNT_SUBS}"); do + if [ ! -z "${vobsubout[i]}" ]; then + echo "$MENCODER $sourcetype $device $chapters $ofps ${subtitle[i]} ${vobsubout[i]} ${aid[i]} $audfmt -ovc copy -o /dev/null" echo fi done @@ -7482,11 +7482,11 @@ mkfifo "$AUDPIPE" FIFO="test -p \"$AUDPIPE\" || mkfifo \"$AUDPIPE\"" -for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then +for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then case "$source" in - dir) AUDIOENC[$i]="$BATCH" ;; - *) AUDIOENC[$i]="$TEMPDIR/audioenc$i" ;; + dir) AUDIOENC[i]="$BATCH" ;; + *) AUDIOENC[i]="$TEMPDIR/audioenc$i" ;; esac if [ "$i" = "1" ]; then @@ -7495,98 +7495,98 @@ AUDINPUT="$TEMPDIR/audio$i.avi" fi if [ "$i" != "1" ]; then - audflt[$i]="${audiofilters[$i]}" + audflt[i]="${audiofilters[i]}" fi # aac-enc only supports signed 16 bit WAV format # dcaenc misinterprets floating-point WAVs as # 32-bit integer ones due to a known bug. - case "${audiocodec[$i]}" in + case "${audiocodec[i]}" in fdkaac|dts) - if [ ! -z "${audflt[$i]}" ]; then - audfilters[$i]="${audflt[$i]},format=s16le" + if [ ! -z "${audflt[i]}" ]; then + audfilters[i]="${audflt[i]},format=s16le" else - audfilters[$i]="-af format=s16le" + audfilters[i]="-af format=s16le" fi ;; *) - audfilters[$i]="${audflt[$i]}" + audfilters[i]="${audflt[i]}" ;; esac - MPL[$i]="$MPLAYER \"$AUDINPUT\" $MPLAYEROPTS ${channels[$i]} ${audfilters[$i]} -really-quiet -vc dummy -vo null -nocache -ao pcm:fast:file=\"$AUDPIPE\"" - NERO[$i]="$NEROAACENC -ignorelength ${neroaacbr[$i]} -if \"$AUDPIPE\" -of \"$TEMPDIR/audio$i.aac\" &" - FDKAAC[$i]="$FDKAACENC ${fdkaacbr[$i]} \"$AUDPIPE\" \"$TEMPDIR/audio$i.aac\" &" - AACPLUS[$i]="$AACPLUSENC \"$AUDPIPE\" \"$TEMPDIR/audio$i.aac\" ${aacplusbr[$i]} &" - OGG[$i]="$OGGENC ${vorbq[$i]} \"$AUDPIPE\" -o \"$TEMPDIR/audio$i.ogg\" &" - OPUS[$i]="$OPUSENC ${opusopts[$i]} \"$AUDPIPE\" \"$TEMPDIR/audio$i.opus\" &" - FLACENC[$i]="$FLAC ${flacq[$i]} \"$AUDPIPE\" -o \"$TEMPDIR/audio$i.flac\" &" - DTSENC[$i]="$DCAENC \"$AUDPIPE\" \"$TEMPDIR/audio$i.dts\" ${abitrate[$i]} &" - AFTENENC[$i]="$AFTEN ${ac3opts[$i]} \"$AUDPIPE\" \"$TEMPDIR/audio$i.ac3\" &" + MPL[i]="$MPLAYER \"$AUDINPUT\" $MPLAYEROPTS ${channels[i]} ${audfilters[i]} -really-quiet -vc dummy -vo null -nocache -ao pcm:fast:file=\"$AUDPIPE\"" + NERO[i]="$NEROAACENC -ignorelength ${neroaacbr[i]} -if \"$AUDPIPE\" -of \"$TEMPDIR/audio$i.aac\" &" + FDKAAC[i]="$FDKAACENC ${fdkaacbr[i]} \"$AUDPIPE\" \"$TEMPDIR/audio$i.aac\" &" + AACPLUS[i]="$AACPLUSENC \"$AUDPIPE\" \"$TEMPDIR/audio$i.aac\" ${aacplusbr[i]} &" + OGG[i]="$OGGENC ${vorbq[i]} \"$AUDPIPE\" -o \"$TEMPDIR/audio$i.ogg\" &" + OPUS[i]="$OPUSENC ${opusopts[i]} \"$AUDPIPE\" \"$TEMPDIR/audio$i.opus\" &" + FLACENC[i]="$FLAC ${flacq[i]} \"$AUDPIPE\" -o \"$TEMPDIR/audio$i.flac\" &" + DTSENC[i]="$DCAENC \"$AUDPIPE\" \"$TEMPDIR/audio$i.dts\" ${abitrate[i]} &" + AFTENENC[i]="$AFTEN ${ac3opts[i]} \"$AUDPIPE\" \"$TEMPDIR/audio$i.ac3\" &" # Identify audio codec # for audio stream copy - case "${audiocodec[$i]}" in + case "${audiocodec[i]}" in copy) echo green "-> Track $i: Detecting audio codec..." - AUDCODEC[$i]=$($MPLAYER "$sourcetype" $MPLAYEROPTS $device ${aid[$i]} $demuxer $cache -vo null -frames 1 -identify 2>/dev/null | grep '^ID_AUDIO_CODEC' | tail -n 1 | awk -F= '{print $2}') - case "${AUDCODEC[$i]}" in - *a52*|*ac3*) audiocodec[$i]="ffac3"; detectaud[$i]="AC-3" ;; - *eac3*) audiocodec[$i]="ffeac3"; detectaud[$i]="E-AC-3" ;; - *truehd*) audiocodec[$i]="fftruehd"; detectaud[$i]="Dolby TrueHD" ;; - *dca*|*dts*) audiocodec[$i]="ffdts"; detectaud[$i]="DTS" ;; - *vorbis*) audiocodec[$i]="ffvorbis"; detectaud[$i]="Vorbis" ;; - *opus*) audiocodec[$i]="ffopus"; detectaud[$i]="Opus" ;; - *pcm*) audiocodec[$i]="ffpcm"; detectaud[$i]="PCM" ;; - *faad*|*aac*) audiocodec[$i]="ffaac"; detectaud[$i]="AAC" ;; - *mp3*|*mad*) audiocodec[$i]="ffmp3"; detectaud[$i]="MP3" ;; - *flac*) audiocodec[$i]="ffflac"; detectaud[$i]="FLAC" ;; - *wma*) audiocodec[$i]="unsupported"; detectaud[$i]="WMA" ;; - *dvdpcm*) audiocodec[$i]="unsupported"; detectaud[$i]="LPCM" ;; - *|"") audiocodec[$i]="unsupported"; detectaud[$i]="unknown/unsupported" ;; + AUDCODEC[i]=$($MPLAYER "$sourcetype" $MPLAYEROPTS $device ${aid[i]} $demuxer $cache -vo null -frames 1 -identify 2>/dev/null | grep '^ID_AUDIO_CODEC' | tail -n 1 | awk -F= '{print $2}') + case "${AUDCODEC[i]}" in + *a52*|*ac3*) audiocodec[i]="ffac3"; detectaud[i]="AC-3" ;; + *eac3*) audiocodec[i]="ffeac3"; detectaud[i]="E-AC-3" ;; + *truehd*) audiocodec[i]="fftruehd"; detectaud[i]="Dolby TrueHD" ;; + *dca*|*dts*) audiocodec[i]="ffdts"; detectaud[i]="DTS" ;; + *vorbis*) audiocodec[i]="ffvorbis"; detectaud[i]="Vorbis" ;; + *opus*) audiocodec[i]="ffopus"; detectaud[i]="Opus" ;; + *pcm*) audiocodec[i]="ffpcm"; detectaud[i]="PCM" ;; + *faad*|*aac*) audiocodec[i]="ffaac"; detectaud[i]="AAC" ;; + *mp3*|*mad*) audiocodec[i]="ffmp3"; detectaud[i]="MP3" ;; + *flac*) audiocodec[i]="ffflac"; detectaud[i]="FLAC" ;; + *wma*) audiocodec[i]="unsupported"; detectaud[i]="WMA" ;; + *dvdpcm*) audiocodec[i]="unsupported"; detectaud[i]="LPCM" ;; + *|"") audiocodec[i]="unsupported"; detectaud[i]="unknown/unsupported" ;; esac - green "-> Track $i: Detected ${detectaud[$i]} audio" - if [ "${audiocodec[$i]}" = "unsupported" ]; then + green "-> Track $i: Detected ${detectaud[i]} audio" + if [ "${audiocodec[i]}" = "unsupported" ]; then error "-> Skipping unsupported track $i for the MKV/MP4/TS/OGM containers" fi ;; esac - case "${audiocodec[$i]}" in + case "${audiocodec[i]}" in mp3|lavcac3|aac|"") - case "${audiocodec[$i]}" in - mp3) audext[$i]="mp3" ;; - lavcac3) audext[$i]="ac3" ;; - aac|"") audext[$i]="aac" ;; + case "${audiocodec[i]}" in + mp3) audext[i]="mp3" ;; + lavcac3) audext[i]="ac3" ;; + aac|"") audext[i]="aac" ;; esac - MENC[$i]="$MENCODER \"$sourcetype\" $device $chapters $demuxer $cache ${aid[$i]} ${channels[$i]} $fps $ofps ${acodec[$i]} ${audiofilters[$i]} $vidfilteropts $vidcodecopts -of rawaudio -o \"$TEMPDIR/audio$i.${audext[$i]}\"" + MENC[i]="$MENCODER \"$sourcetype\" $device $chapters $demuxer $cache ${aid[i]} ${channels[i]} $fps $ofps ${acodec[i]} ${audiofilters[i]} $vidfilteropts $vidcodecopts -of rawaudio -o \"$TEMPDIR/audio$i.${audext[i]}\"" ;; ff*) # Stream copy so we just dump the audio - if [ "${audiocodec[$i]}" = "ffaac" ]; then - audformat[$i]="-fafmttag 0x706d" + if [ "${audiocodec[i]}" = "ffaac" ]; then + audformat[i]="-fafmttag 0x706d" fi - case "${audiocodec[$i]}" in - ffac3|ffeac3|fftruehd) audext[$i]="ac3" ;; - ffdts) audext[$i]="dts" ;; - ffvorbis) audext[$i]="ogg" ;; - ffopus) audext[$i]="opus" ;; - ffpcm) audext[$i]="wav" ;; - ffaac) audext[$i]="aac" ;; - ffmp3) audext[$i]="mp3" ;; - ffflac) audext[$i]="flac" ;; + case "${audiocodec[i]}" in + ffac3|ffeac3|fftruehd) audext[i]="ac3" ;; + ffdts) audext[i]="dts" ;; + ffvorbis) audext[i]="ogg" ;; + ffopus) audext[i]="opus" ;; + ffpcm) audext[i]="wav" ;; + ffaac) audext[i]="aac" ;; + ffmp3) audext[i]="mp3" ;; + ffflac) audext[i]="flac" ;; esac - case "${audiocodec[$i]}" in + case "${audiocodec[i]}" in fftruehd) - MENC[$i]="$MPLAYER \"$sourcetype\" $MPLAYEROPTS $device $demuxer $cache ${aid[$i]} -vo null -vc dummy -dumpaudio -dumpfile \"$TEMPDIR/audio$i.${audext[$i]}\"" + MENC[i]="$MPLAYER \"$sourcetype\" $MPLAYEROPTS $device $demuxer $cache ${aid[i]} -vo null -vc dummy -dumpaudio -dumpfile \"$TEMPDIR/audio$i.${audext[i]}\"" ;; *) - MENC[$i]="$MENCODER \"$sourcetype\" $device $chapters $demuxer $cache ${aid[$i]} $fps $ofps $vidcodecopts $vidfilteropts ${audformat[$i]} -oac copy -mc 0 -noskip -msglevel demuxer=-1 -of rawaudio -o \"$TEMPDIR/audio$i.${audext[$i]}\"" + MENC[i]="$MENCODER \"$sourcetype\" $device $chapters $demuxer $cache ${aid[i]} $fps $ofps $vidcodecopts $vidfilteropts ${audformat[i]} -oac copy -mc 0 -noskip -msglevel demuxer=-1 -of rawaudio -o \"$TEMPDIR/audio$i.${audext[i]}\"" ;; esac ;; aac+|neroaac|fdkaac|aftenac3|vorbis|opus|flac|dts|pcm) - MENC[$i]="$MENCODER \"$sourcetype\" $device $chapters $demuxer $cache ${aid[$i]} ${channels[$i]} $fps $ofps $vidcodecopts $vidfilteropts -oac pcm -o \"$TEMPDIR/audio$i.avi\"" + MENC[i]="$MENCODER \"$sourcetype\" $device $chapters $demuxer $cache ${aid[i]} ${channels[i]} $fps $ofps $vidcodecopts $vidfilteropts -oac pcm -o \"$TEMPDIR/audio$i.avi\"" ;; eac3) if [ "$i" = "1" ]; then @@ -7596,44 +7596,44 @@ MENCINPUT="$sourcetype" mencfilters="$fps $ofps $vidcodecopts $vidfilteropts" fi - MENC[$i]="$MENCODER \"$MENCINPUT\" $device $chapters $demuxer $cache ${aid[$i]} ${channels[$i]} $mencfilters ${audflt[$i]} -oac lavc -lavcopts acodec=eac3:abitrate=${abitrate[$i]} -mc 0 -noskip -of rawaudio -o \"$TEMPDIR/audio$i.eac3\"" + MENC[i]="$MENCODER \"$MENCINPUT\" $device $chapters $demuxer $cache ${aid[i]} ${channels[i]} $mencfilters ${audflt[i]} -oac lavc -lavcopts acodec=eac3:abitrate=${abitrate[i]} -mc 0 -noskip -of rawaudio -o \"$TEMPDIR/audio$i.eac3\"" ;; esac audio_encoder_func() { - case "${audiocodec[$i]}" in + case "${audiocodec[i]}" in fftruehd|eac3) - echo "${MENC[$i]}" + echo "${MENC[i]}" echo "sleep 2" echo ;; mp3|pcm|lavcac3|ff*|aac|"") if [ "$i" != "1" ]; then - echo "${MENC[$i]}" + echo "${MENC[i]}" echo "sleep 2" fi ;; aac+|neroaac|fdkaac|aftenac3|vorbis|opus|flac|dts) echo "$FIFO" if [ "$i" != "1" ]; then - echo "${MENC[$i]}" + echo "${MENC[i]}" echo "sleep 2" echo fi - case "${audiocodec[$i]}" in - aac+) echo "${AACPLUS[$i]}" ;; - neroaac) echo "${NERO[$i]}" ;; - fdkaac) echo "${FDKAAC[$i]}" ;; - aftenac3) echo "${AFTENENC[$i]}" ;; - vorbis) echo "${OGG[$i]}" ;; - opus) echo "${OPUS[$i]}" ;; - flac) echo "${FLACENC[$i]}" ;; - dts) echo "${DTSENC[$i]}" ;; + case "${audiocodec[i]}" in + aac+) echo "${AACPLUS[i]}" ;; + neroaac) echo "${NERO[i]}" ;; + fdkaac) echo "${FDKAAC[i]}" ;; + aftenac3) echo "${AFTENENC[i]}" ;; + vorbis) echo "${OGG[i]}" ;; + opus) echo "${OPUS[i]}" ;; + flac) echo "${FLACENC[i]}" ;; + dts) echo "${DTSENC[i]}" ;; esac - echo "${MPL[$i]}" - if [ "${nero2p[$i]}" = "y" ]; then + echo "${MPL[i]}" + if [ "${nero2p[i]}" = "y" ]; then echo "sleep 2" - echo "${MPL[$i]}" + echo "${MPL[i]}" fi echo "sleep 2" ;; @@ -7641,7 +7641,7 @@ echo } - audio_encoder_func >> "${AUDIOENC[$i]}" + audio_encoder_func >> "${AUDIOENC[i]}" if [ "$saveopts" = "y" ]; then audio_encoder_func >> "$OPTSFILE" fi @@ -7652,45 +7652,45 @@ # Get audio channels info # Used for audio tagging -for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - if [ ! -z "${channels[$i]}" -a ! -z "${chanfilter[$i]}" ]; then - case "$(echo "${chanfilter[$i]}" | sed 's|channels=||; s|,||')" in - 1) chaninfo[$i]="Mono" ;; - 2) chaninfo[$i]="Stereo" ;; - 3) chaninfo[$i]="3.0" ;; - 4) chaninfo[$i]="4.0" ;; - 5) chaninfo[$i]="5.0" ;; - 6) chaninfo[$i]="5.1" ;; - 7) chaninfo[$i]="6.1" ;; - 8) chaninfo[$i]="7.1" ;; - esac - elif [ ! -z "${channels[$i]}" -a -z "${chanfilter[$i]}" ]; then - case "$(echo "${channels[$i]}" | awk '{print $2}')" in - 1) chaninfo[$i]="Mono" ;; - 2) chaninfo[$i]="Stereo" ;; - 3) chaninfo[$i]="3.0" ;; - 4) chaninfo[$i]="4.0" ;; - 5) chaninfo[$i]="5.0" ;; - 6) chaninfo[$i]="5.1" ;; - 7) chaninfo[$i]="6.1" ;; - 8) chaninfo[$i]="7.1" ;; - esac - else - case "${audiocodec[$i]}" in - ff*) chans[$i]="-channels 8" ;; - esac - AUDCH[$i]="$($MPLAYER "$sourcetype" $MPLAYEROPTS $MPOPTS ${aid[$i]} ${chans[$i]} $demuxer $cache 2>/dev/null | grep '^ID_AUDIO_NCH' | tail -n 1 | awk -F= '{print $2}')" - case "${AUDCH[$i]}" in - 1) chaninfo[$i]="Mono" ;; - 2) chaninfo[$i]="Stereo" ;; - 3) chaninfo[$i]="3.0" ;; - 4) chaninfo[$i]="4.0" ;; - 5) chaninfo[$i]="5.0" ;; - 6) chaninfo[$i]="5.1" ;; - 7) chaninfo[$i]="6.1" ;; - 8) chaninfo[$i]="7.1" ;; - *|"") chaninfo[$i]="Stereo" ;; +for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + if [ ! -z "${channels[i]}" -a ! -z "${chanfilter[i]}" ]; then + case "$(echo "${chanfilter[i]}" | sed 's|channels=||; s|,||')" in + 1) chaninfo[i]="Mono" ;; + 2) chaninfo[i]="Stereo" ;; + 3) chaninfo[i]="3.0" ;; + 4) chaninfo[i]="4.0" ;; + 5) chaninfo[i]="5.0" ;; + 6) chaninfo[i]="5.1" ;; + 7) chaninfo[i]="6.1" ;; + 8) chaninfo[i]="7.1" ;; + esac + elif [ ! -z "${channels[i]}" -a -z "${chanfilter[i]}" ]; then + case "$(echo "${channels[i]}" | awk '{print $2}')" in + 1) chaninfo[i]="Mono" ;; + 2) chaninfo[i]="Stereo" ;; + 3) chaninfo[i]="3.0" ;; + 4) chaninfo[i]="4.0" ;; + 5) chaninfo[i]="5.0" ;; + 6) chaninfo[i]="5.1" ;; + 7) chaninfo[i]="6.1" ;; + 8) chaninfo[i]="7.1" ;; + esac + else + case "${audiocodec[i]}" in + ff*) chans[i]="-channels 8" ;; + esac + AUDCH[i]="$($MPLAYER "$sourcetype" $MPLAYEROPTS $MPOPTS ${aid[i]} ${chans[i]} $demuxer $cache 2>/dev/null | grep '^ID_AUDIO_NCH' | tail -n 1 | awk -F= '{print $2}')" + case "${AUDCH[i]}" in + 1) chaninfo[i]="Mono" ;; + 2) chaninfo[i]="Stereo" ;; + 3) chaninfo[i]="3.0" ;; + 4) chaninfo[i]="4.0" ;; + 5) chaninfo[i]="5.0" ;; + 6) chaninfo[i]="5.1" ;; + 7) chaninfo[i]="6.1" ;; + 8) chaninfo[i]="7.1" ;; + *|"") chaninfo[i]="Stereo" ;; esac fi fi @@ -7717,17 +7717,17 @@ # Input type agnostic. Only # allow supported subtitle formats # by MKV. Others will be skipped - for i in $(seq 1 $MAX_AMOUNT_SUBS); do - if [ ! -z "${EXTSUB[$i]}" ]; then - case "$(echo "${EXTSUB[$i]##*.}" | tr '[:upper:]' '[:lower:]')" in + for i in $(eval echo "{1..$MAX_AMOUNT_SUBS}"); do + if [ ! -z "${EXTSUB[i]}" ]; then + case "$(echo "${EXTSUB[i]##*.}" | tr '[:upper:]' '[:lower:]')" in idx|srt|ass|ssa|sup|mks) - MKVSUBS[$i]="--language -1:${SUBLANG[$i]} \"${EXTSUB[$i]}\"" + MKVSUBS[i]="--language -1:${SUBLANG[i]} \"${EXTSUB[i]}\"" ;; *) echo - error "-> Subtitle format '$(echo "${EXTSUB[$i]##*.}" | tr '[:lower:]' '[:upper:]')' not supported by MKV!" + error "-> Subtitle format '$(echo "${EXTSUB[i]##*.}" | tr '[:lower:]' '[:upper:]')' not supported by MKV!" error "-> Supported subtitle formats are: IDX, SRT, ASS/SSA, SUP, MKS" - error "-> Skipping import of '${EXTSUB[$i]}'" + error "-> Skipping import of '${EXTSUB[i]}'" echo ;; esac @@ -7776,9 +7776,9 @@ aac+|neroaac|fdkaac|aftenac3|eac3|vorbis|opus|flac|fftruehd) MKVAUDLANG1="--language 0:${AUDLANG[1]}" ;; *|"") MKVAUDLANG1="--language 1:${AUDLANG[1]}" ;; esac - for i in $(seq 2 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - MKVAUDLANG[$i]="--language -1:${AUDLANG[$i]}" + for i in $(eval echo "{2..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + MKVAUDLANG[i]="--language -1:${AUDLANG[i]}" fi done ;; @@ -7797,9 +7797,9 @@ if [ ! -z "${vobsubout[*]}" ]; then mkvimpsub=$(get_selection_func "Import the ripped subtitle(s) into the MKV container? [y/N]: ") if [ "$mkvimpsub" = "y" ]; then - for i in $(seq 1 $MAX_AMOUNT_SUBS); do - if [ ! -z "${IDXFILE[$i]}" ]; then - MKVSUBS[$i]="\"${IDXFILE[$i]}\"" + for i in $(eval echo "{1..$MAX_AMOUNT_SUBS}"); do + if [ ! -z "${IDXFILE[i]}" ]; then + MKVSUBS[i]="\"${IDXFILE[i]}\"" fi done fi @@ -7868,45 +7868,45 @@ echo " <Name>Video Filters</Name>" echo " <String>$(echo $videofilters | sed 's|^\-vf ||')</String>" echo " </Simple>" - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - if [ "${audiocodec[$i]}" != "nosound" ]; then + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + if [ "${audiocodec[i]}" != "nosound" ]; then echo " <Simple>" echo " <Name>Audio Codec (Track $i)</Name>" - case "${audiocodec[$i]}" in - aac|"") echo " <String>LC-AAC ${chaninfo[$i]}</String>" ;; - ffaac) echo " <String>AAC ${chaninfo[$i]}</String>" ;; - neroaac|fdkaac) echo " <String>${AACTYPE[$i]} ${chaninfo[$i]}</String>" ;; - aac+) echo " <String>HE-AACv1 ${chaninfo[$i]}</String>" ;; - vorbis|ffvorbis) echo " <String>Vorbis ${chaninfo[$i]}</String>" ;; - opus|ffopus) echo " <String>Opus ${chaninfo[$i]}</String>" ;; + case "${audiocodec[i]}" in + aac|"") echo " <String>LC-AAC ${chaninfo[i]}</String>" ;; + ffaac) echo " <String>AAC ${chaninfo[i]}</String>" ;; + neroaac|fdkaac) echo " <String>${AACTYPE[i]} ${chaninfo[i]}</String>" ;; + aac+) echo " <String>HE-AACv1 ${chaninfo[i]}</String>" ;; + vorbis|ffvorbis) echo " <String>Vorbis ${chaninfo[i]}</String>" ;; + opus|ffopus) echo " <String>Opus ${chaninfo[i]}</String>" ;; mp3|ffmp3) echo " <String>MP3</String>" ;; - aftenac3|lavcac3|ffac3) echo " <String>AC-3 ${chaninfo[$i]}</String>" ;; - eac3) echo " <String>E-AC-3 ${chaninfo[$i]}</String>" ;; - fftruehd) echo " <String>Dolby TrueHD ${chaninfo[$i]}</String>" ;; - dts|ffdts) echo " <String>DTS ${chaninfo[$i]}</String>" ;; - flac|ffflac) echo " <String>FLAC ${chaninfo[$i]}</String>" ;; - pcm|ffpcm) echo " <String>PCM ${chaninfo[$i]}</String>" ;; - *) echo " <String>${detectaud[$i]} ${chaninfo[$i]}</String>" ;; + aftenac3|lavcac3|ffac3) echo " <String>AC-3 ${chaninfo[i]}</String>" ;; + eac3) echo " <String>E-AC-3 ${chaninfo[i]}</String>" ;; + fftruehd) echo " <String>Dolby TrueHD ${chaninfo[i]}</String>" ;; + dts|ffdts) echo " <String>DTS ${chaninfo[i]}</String>" ;; + flac|ffflac) echo " <String>FLAC ${chaninfo[i]}</String>" ;; + pcm|ffpcm) echo " <String>PCM ${chaninfo[i]}</String>" ;; + *) echo " <String>${detectaud[i]} ${chaninfo[i]}</String>" ;; esac echo " </Simple>" case "$source" in dvd|bd|file) echo " <Simple>" echo " <Name>Audio Language (Track $i)</Name>" - echo " <String>${AUDLANG[$i]}</String>" + echo " <String>${AUDLANG[i]}</String>" echo " </Simple>" ;; esac - if [ ! -z "${audiofilters[$i]}" ]; then + if [ ! -z "${audiofilters[i]}" ]; then echo " <Simple>" echo " <Name>Audio Filters (Track $i)</Name>" - echo " <String>$(echo ${audiofilters[$i]} | sed 's|^\-af ||; s| \-srate.*||')</String>" + echo " <String>$(echo ${audiofilters[i]} | sed 's|^\-af ||; s| \-srate.*||')</String>" echo " </Simple>" fi echo " <Simple>" echo " <Name>Audio Encoder (Track $i)</Name>" - case "${audiocodec[$i]}" in + case "${audiocodec[i]}" in aac|"") echo " <String>faac</String>" ;; neroaac) echo " <String>neroAacEnc</String>" ;; fdkaac) echo " <String>aac-enc (fdkaac)</String>" ;; @@ -7925,11 +7925,11 @@ fi fi done - for i in $(seq 1 $MAX_AMOUNT_SUBS); do - if [ ! -z "${SUBLANG[$i]}" ]; then + for i in $(eval echo "{1..$MAX_AMOUNT_SUBS}"); do + if [ ! -z "${SUBLANG[i]}" ]; then echo " <Simple>" echo " <Name>Subtitle Language (Sub $i)</Name>" - echo " <String>${SUBLANG[$i]}</String>" + echo " <String>${SUBLANG[i]}</String>" echo " </Simple>" fi done @@ -8038,56 +8038,56 @@ esac # MKV audio & tagging for subsequent tracks - for i in $(seq 2 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - case "${audiocodec[$i]}" in + for i in $(eval echo "{2..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + case "${audiocodec[i]}" in ff*) # Stream copy - if [ "${audiocodec[$i]}" = "ffmp3" ]; then - audinfo[$i]="${detectaud[$i]}" + if [ "${audiocodec[i]}" = "ffmp3" ]; then + audinfo[i]="${detectaud[i]}" else - audinfo[$i]="${detectaud[$i]} ${chaninfo[$i]}" + audinfo[i]="${detectaud[i]} ${chaninfo[i]}" fi - MKVAUD[$i]="--track-name -1:\"${audinfo[$i]}\" ${MKVAUDLANG[$i]} \"$TEMPDIR/audio$i.${audext[$i]}\"" + MKVAUD[i]="--track-name -1:\"${audinfo[i]}\" ${MKVAUDLANG[i]} \"$TEMPDIR/audio$i.${audext[i]}\"" ;; mp3) - MKVAUD[$i]="--track-name -1:\"MP3\" ${MKVAUDLANG[$i]} \"$TEMPDIR/audio$i.mp3\"" + MKVAUD[i]="--track-name -1:\"MP3\" ${MKVAUDLANG[i]} \"$TEMPDIR/audio$i.mp3\"" ;; aac+) - MKVAUD[$i]="--track-name -1:\"HE-AACv1 ${chaninfo[$i]}\" ${MKVAUDLANG[$i]} --aac-is-sbr 0:1 \"$TEMPDIR/audio$i.aac\"" + MKVAUD[i]="--track-name -1:\"HE-AACv1 ${chaninfo[i]}\" ${MKVAUDLANG[i]} --aac-is-sbr 0:1 \"$TEMPDIR/audio$i.aac\"" ;; neroaac|fdkaac) - case "${AACTYPE[$i]}" in - HE-AACv1|HE-AACv2) MKVSBR[$i]="--aac-is-sbr 0:1" ;; + case "${AACTYPE[i]}" in + HE-AACv1|HE-AACv2) MKVSBR[i]="--aac-is-sbr 0:1" ;; esac - MKVAUD[$i]="--track-name -1:\"${AACTYPE[$i]} ${chaninfo[$i]}\" ${MKVAUDLANG[$i]} ${MKVSBR[$i]} --no-chapters \"$TEMPDIR/audio$i.aac\"" + MKVAUD[i]="--track-name -1:\"${AACTYPE[i]} ${chaninfo[i]}\" ${MKVAUDLANG[i]} ${MKVSBR[i]} --no-chapters \"$TEMPDIR/audio$i.aac\"" ;; aac|"") - MKVAUD[$i]="--track-name -1:\"LC-AAC ${chaninfo[$i]}\" ${MKVAUDLANG[$i]} \"$TEMPDIR/audio$i.aac\"" + MKVAUD[i]="--track-name -1:\"LC-AAC ${chaninfo[i]}\" ${MKVAUDLANG[i]} \"$TEMPDIR/audio$i.aac\"" ;; aftenac3) - MKVAUD[$i]="--track-name -1:\"AC-3 ${chaninfo[$i]}\" ${MKVAUDLANG[$i]} \"$TEMPDIR/audio$i.ac3\"" + MKVAUD[i]="--track-name -1:\"AC-3 ${chaninfo[i]}\" ${MKVAUDLANG[i]} \"$TEMPDIR/audio$i.ac3\"" ;; lavcac3) - MKVAUD[$i]="--track-name -1:\"AC-3 ${chaninfo[$i]}\" ${MKVAUDLANG[$i]} \"$TEMPDIR/audio$i.ac3\"" + MKVAUD[i]="--track-name -1:\"AC-3 ${chaninfo[i]}\" ${MKVAUDLANG[i]} \"$TEMPDIR/audio$i.ac3\"" ;; eac3) - MKVAUD[$i]="--track-name -1:\"E-AC-3 ${chaninfo[$i]}\" ${MKVAUDLANG[$i]} \"$TEMPDIR/audio$i.eac3\"" + MKVAUD[i]="--track-name -1:\"E-AC-3 ${chaninfo[i]}\" ${MKVAUDLANG[i]} \"$TEMPDIR/audio$i.eac3\"" ;; vorbis) - MKVAUD[$i]="--track-name -1:\"Vorbis ${chaninfo[$i]}\" ${MKVAUDLANG[$i]} \"$TEMPDIR/audio$i.ogg\"" + MKVAUD[i]="--track-name -1:\"Vorbis ${chaninfo[i]}\" ${MKVAUDLANG[i]} \"$TEMPDIR/audio$i.ogg\"" ;; opus) - MKVAUD[$i]="--track-name -1:\"Opus ${chaninfo[$i]}\" ${MKVAUDLANG[$i]} \"$TEMPDIR/audio$i.opus\"" + MKVAUD[i]="--track-name -1:\"Opus ${chaninfo[i]}\" ${MKVAUDLANG[i]} \"$TEMPDIR/audio$i.opus\"" ;; flac) - MKVAUD[$i]="--track-name -1:\"FLAC ${chaninfo[$i]}\" ${MKVAUDLANG[$i]} \"$TEMPDIR/audio$i.flac\"" + MKVAUD[i]="--track-name -1:\"FLAC ${chaninfo[i]}\" ${MKVAUDLANG[i]} \"$TEMPDIR/audio$i.flac\"" ;; dts) - MKVAUD[$i]="--track-name -1:\"DTS ${chaninfo[$i]}\" ${MKVAUDLANG[$i]} \"$TEMPDIR/audio$i.dts\"" + MKVAUD[i]="--track-name -1:\"DTS ${chaninfo[i]}\" ${MKVAUDLANG[i]} \"$TEMPDIR/audio$i.dts\"" ;; pcm) - MKVAUD[$i]="-D --track-name -1:\"PCM ${chaninfo[$i]}\" ${MKVAUDLANG[$i]} \"$TEMPDIR/audio$i.avi\"" + MKVAUD[i]="-D --track-name -1:\"PCM ${chaninfo[i]}\" ${MKVAUDLANG[i]} \"$TEMPDIR/audio$i.avi\"" ;; esac fi @@ -8179,17 +8179,17 @@ # Input type agnostic. Only # allow supported subtitle formats # by MP4. Others will be skipped - for i in $(seq 1 $MAX_AMOUNT_SUBS); do - if [ ! -z "${EXTSUB[$i]}" ]; then - case "$(echo "${EXTSUB[$i]##*.}" | tr '[:upper:]' '[:lower:]')" in + for i in $(eval echo "{1..$MAX_AMOUNT_SUBS}"); do + if [ ! -z "${EXTSUB[i]}" ]; then + case "$(echo "${EXTSUB[i]##*.}" | tr '[:upper:]' '[:lower:]')" in idx|srt|ttxt) - MP4SUBS[$i]="-add \"${EXTSUB[$i]}\":lang=${SUBLANG[$i]}" + MP4SUBS[i]="-add \"${EXTSUB[i]}\":lang=${SUBLANG[i]}" ;; *) echo - error "-> Subtitle format '$(echo "${EXTSUB[$i]##*.}" | tr '[:lower:]' '[:upper:]')' not supported by MP4!" + error "-> Subtitle format '$(echo "${EXTSUB[i]##*.}" | tr '[:lower:]' '[:upper:]')' not supported by MP4!" error "-> Supported subtitle formats are: IDX, SRT, TTXT" - error "-> Skipping import of '${EXTSUB[$i]}'" + error "-> Skipping import of '${EXTSUB[i]}'" echo ;; esac @@ -8242,9 +8242,9 @@ # Audio language info case "$source" in dvd|bd|file) - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - MP4AUDLANG[$i]=":lang=${AUDLANG[$i]}" + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + MP4AUDLANG[i]=":lang=${AUDLANG[i]}" fi done ;; @@ -8263,9 +8263,9 @@ if [ ! -z "${vobsubout[*]}" ]; then mp4impsub=$(get_selection_func "Import the ripped subtitle(s) into the MP4 container? [y/N]: ") if [ "$mp4impsub" = "y" ]; then - for i in $(seq 1 $MAX_AMOUNT_SUBS); do - if [ ! -z "${IDXFILE[$i]}" ]; then - MP4SUBS[$i]="-add \"${IDXFILE[$i]}\"" + for i in $(eval echo "{1..$MAX_AMOUNT_SUBS}"); do + if [ ! -z "${IDXFILE[i]}" ]; then + MP4SUBS[i]="-add \"${IDXFILE[i]}\"" fi done fi @@ -8354,39 +8354,39 @@ esac # Subsequent tracks - for i in $(seq 2 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - case "${audiocodec[$i]}" in + for i in $(eval echo "{2..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + case "${audiocodec[i]}" in ff*) # Stream copy - if [ "${audiocodec[$i]}" = "ffmp3" ]; then - audinfo[$i]="${detectaud[$i]}" + if [ "${audiocodec[i]}" = "ffmp3" ]; then + audinfo[i]="${detectaud[i]}" else - audinfo[$i]="${detectaud[$i]} ${chaninfo[$i]}" + audinfo[i]="${detectaud[i]} ${chaninfo[i]}" fi - AUDIOINPUT[$i]="-add \"$TEMPDIR/audio$i.${audext[$i]}\"#audio:name=\"${audinfo[$i]}\"${MP4AUDLANG[$i]}" + AUDIOINPUT[i]="-add \"$TEMPDIR/audio$i.${audext[i]}\"#audio:name=\"${audinfo[i]}\"${MP4AUDLANG[i]}" ;; mp3) - AUDIOINPUT[$i]="-add \"$TEMPDIR/audio$i.mp3\"#audio:name=\"MP3\"${MP4AUDLANG[$i]}" + AUDIOINPUT[i]="-add \"$TEMPDIR/audio$i.mp3\"#audio:name=\"MP3\"${MP4AUDLANG[i]}" ;; vorbis) - AUDIOINPUT[$i]="-add \"$TEMPDIR/audio$i.ogg\"#audio:name=\"Vorbis ${chaninfo[$i]}\"${MP4AUDLANG[$i]}" + AUDIOINPUT[i]="-add \"$TEMPDIR/audio$i.ogg\"#audio:name=\"Vorbis ${chaninfo[i]}\"${MP4AUDLANG[i]}" ;; aftenac3|lavcac3) - AUDIOINPUT[$i]="-add \"$TEMPDIR/audio$i.ac3\"#audio:name=\"AC-3 ${chaninfo[$i]}\"${MP4AUDLANG[$i]}" + AUDIOINPUT[i]="-add \"$TEMPDIR/audio$i.ac3\"#audio:name=\"AC-3 ${chaninfo[i]}\"${MP4AUDLANG[i]}" ;; aac+) - AUDIOINPUT[$i]="-add \"$TEMPDIR/audio$i.aac\"#audio:sbr:name=\"HE-AACv1 Stereo\"${MP4AUDLANG[$i]}" + AUDIOINPUT[i]="-add \"$TEMPDIR/audio$i.aac\"#audio:sbr:name=\"HE-AACv1 Stereo\"${MP4AUDLANG[i]}" ;; aac|"") - AUDIOINPUT[$i]="-add \"$TEMPDIR/audio$i.aac\"#audio:name=\"LC-AAC ${chaninfo[$i]}\"${MP4AUDLANG[$i]}" + AUDIOINPUT[i]="-add \"$TEMPDIR/audio$i.aac\"#audio:name=\"LC-AAC ${chaninfo[i]}\"${MP4AUDLANG[i]}" ;; neroaac|fdkaac) - RMNEROAUD[$i]="rm -f \"$TEMPDIR/audio$i.aac\"" - case "${AACTYPE[$i]}" in - HE-AACv1|HE-AACv2) AACSBR[$i]=":sbr" ;; + RMNEROAUD[i]="rm -f \"$TEMPDIR/audio$i.aac\"" + case "${AACTYPE[i]}" in + HE-AACv1|HE-AACv2) AACSBR[i]=":sbr" ;; esac - AUDIOINPUT[$i]="-add \"$TEMPDIR/audio$i.aac\"#audio:name=\"${AACTYPE[$i]} ${chaninfo[$i]}\"${AACSBR[$i]}${MP4AUDLANG[$i]}" + AUDIOINPUT[i]="-add \"$TEMPDIR/audio$i.aac\"#audio:name=\"${AACTYPE[i]} ${chaninfo[i]}\"${AACSBR[i]}${MP4AUDLANG[i]}" ;; esac fi @@ -8429,8 +8429,8 @@ echo "$RMMP4VID" echo echo "$RMMP4AUD" - for trk in $(seq 2 $MAX_AMOUNT_AUD_TRACKS); do - test ! -z "${RMNEROAUD[$trk]}" && echo "${RMNEROAUD[$trk]}" + for trk in $(eval echo "{2..$MAX_AMOUNT_AUD_TRACKS}"); do + test ! -z "${RMNEROAUD[trk]}" && echo "${RMNEROAUD[trk]}" done echo "sleep 2" echo @@ -8498,9 +8498,9 @@ case "$source" in dvd|bd|file) - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - TSAUDLANG[$i]=", lang=${AUDLANG[$i]}" + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + TSAUDLANG[i]=", lang=${AUDLANG[i]}" fi done ;; @@ -8547,37 +8547,37 @@ esac # Second, third, etc audio tracks - for i in $(seq 2 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - case "${audiocodec[$i]}" in + for i in $(eval echo "{2..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + case "${audiocodec[i]}" in ffac3|ffeac3) - METAAUD[$i]="echo \"A_AC3, \\\"$TEMPDIR/audio$i.raw\\\"${TSAUDLANG[$i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" + METAAUD[i]="echo \"A_AC3, \\\"$TEMPDIR/audio$i.raw\\\"${TSAUDLANG[i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" ;; ffdts) - METAAUD[$i]="echo \"A_DTS, \\\"$TEMPDIR/audio$i.raw\\\"${TSAUDLANG[$i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" + METAAUD[i]="echo \"A_DTS, \\\"$TEMPDIR/audio$i.raw\\\"${TSAUDLANG[i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" ;; ffmp3) - METAAUD[$i]="echo \"A_MP3, \\\"$TEMPDIR/audio$i.raw\\\"${TSAUDLANG[$i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" + METAAUD[i]="echo \"A_MP3, \\\"$TEMPDIR/audio$i.raw\\\"${TSAUDLANG[i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" ;; aac|"") - METAAUD[$i]="echo \"A_AAC, \\\"$TEMPDIR/audio$i.aac\\\"${TSAUDLANG[$i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" + METAAUD[i]="echo \"A_AAC, \\\"$TEMPDIR/audio$i.aac\\\"${TSAUDLANG[i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" ;; mp3) - METAAUD[$i]="echo \"A_MP3, \\\"$TEMPDIR/audio$i.mp3\\\"${TSAUDLANG[$i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" + METAAUD[i]="echo \"A_MP3, \\\"$TEMPDIR/audio$i.mp3\\\"${TSAUDLANG[i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" ;; aftenac3|lavcac3) - METAAUD[$i]="echo \"A_AC3, \\\"$TEMPDIR/audio$i.ac3\\\"${TSAUDLANG[$i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" + METAAUD[i]="echo \"A_AC3, \\\"$TEMPDIR/audio$i.ac3\\\"${TSAUDLANG[i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" ;; eac3) - METAAUD[$i]="echo \"A_AC3, \\\"$TEMPDIR/audio$i.eac3\\\"${TSAUDLANG[$i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" + METAAUD[i]="echo \"A_AC3, \\\"$TEMPDIR/audio$i.eac3\\\"${TSAUDLANG[i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" ;; dts) - METAAUD[$i]="echo \"A_DTS, \\\"$TEMPDIR/audio$i.dts\\\"${TSAUDLANG[$i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" + METAAUD[i]="echo \"A_DTS, \\\"$TEMPDIR/audio$i.dts\\\"${TSAUDLANG[i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" ;; neroaac|fdkaac) - case "${AACTYPE[$i]}" in + case "${AACTYPE[i]}" in LC-AAC) - METAAUD[$i]="echo \"A_AAC, \\\"$TEMPDIR/audio$i.aac\\\"${TSAUDLANG[$i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" + METAAUD[i]="echo \"A_AAC, \\\"$TEMPDIR/audio$i.aac\\\"${TSAUDLANG[i]}\" >> \"$TEMPDIR/tsmuxer.meta\"" ;; esac ;; @@ -8625,8 +8625,8 @@ echo echo "$METAOPT" echo "$METAVID" - for trk in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - echo "${METAAUD[$trk]}" + for trk in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + echo "${METAAUD[trk]}" done echo "$TSMUXER \"$TEMPDIR/tsmuxer.meta\" \"$TSOUT\"" echo "sleep 2" @@ -8706,24 +8706,24 @@ esac # Subsequent tracks - for i in $(seq 2 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - case "${audiocodec[$i]}" in + for i in $(eval echo "{2..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + case "${audiocodec[i]}" in # audio stream copy ff*) - OGMAUD[$i]="-c LANGUAGE=${AUDLANG[$i]} \"$TEMPDIR/audio$i.${audext[$i]}\"" + OGMAUD[i]="-c LANGUAGE=${AUDLANG[i]} \"$TEMPDIR/audio$i.${audext[i]}\"" ;; mp3) - OGMAUD[$i]="-c LANGUAGE=${AUDLANG[$i]} \"$TEMPDIR/audio$i.mp3\"" + OGMAUD[i]="-c LANGUAGE=${AUDLANG[i]} \"$TEMPDIR/audio$i.mp3\"" ;; aftenac3|lavcac3) - OGMAUD[$i]="-c LANGUAGE=${AUDLANG[$i]} \"$TEMPDIR/audio$i.ac3\"" + OGMAUD[i]="-c LANGUAGE=${AUDLANG[i]} \"$TEMPDIR/audio$i.ac3\"" ;; vorbis) - OGMAUD[$i]="-c LANGUAGE=${AUDLANG[$i]} \"$TEMPDIR/audio$i.ogg\"" + OGMAUD[i]="-c LANGUAGE=${AUDLANG[i]} \"$TEMPDIR/audio$i.ogg\"" ;; pcm) - OGMAUD[$i]="-c LANGUAGE=${AUDLANG[$i]} -D \"$TEMPDIR/audio$i.avi\"" + OGMAUD[i]="-c LANGUAGE=${AUDLANG[i]} -D \"$TEMPDIR/audio$i.avi\"" ;; esac fi @@ -8753,17 +8753,17 @@ # Input type agnostic. Only # allow supported subtitle formats # by OGM. Others will be skipped - for i in $(seq 1 $MAX_AMOUNT_SUBS); do - if [ ! -z "${EXTSUB[$i]}" ]; then - case "$(echo "${EXTSUB[$i]##*.}" | tr '[:upper:]' '[:lower:]')" in + for i in $(eval echo "{1..$MAX_AMOUNT_SUBS}"); do + if [ ! -z "${EXTSUB[i]}" ]; then + case "$(echo "${EXTSUB[i]##*.}" | tr '[:upper:]' '[:lower:]')" in srt|SRT) - OGMSUBS[$i]="-c LANGUAGE=${SUBLANG[$i]} \"${EXTSUB[$i]}\"" + OGMSUBS[i]="-c LANGUAGE=${SUBLANG[i]} \"${EXTSUB[i]}\"" ;; *) echo - error "-> Subtitle format '$(echo "${EXTSUB[$i]##*.}" | tr '[:lower:]' '[:upper:]')' not supported by OGM!" + error "-> Subtitle format '$(echo "${EXTSUB[i]##*.}" | tr '[:lower:]' '[:upper:]')' not supported by OGM!" error "-> Supported subtitle formats are: SRT" - error "-> Skipping import of '${EXTSUB[$i]}'" + error "-> Skipping import of '${EXTSUB[i]}'" echo ;; esac @@ -8863,8 +8863,8 @@ echo >> "$OPTSFILE" fi if [ "$avi_to_mkv" = "no" -a "$avi_to_mp4" = "no" -a "$avi_to_ts" = "no" -a "$avi_to_ogm" = "no" ]; then - for i in $(seq 2 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then + for i in $(eval echo "{2..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then echo error "-> Subsequent audio track(s) only supported by" error " the MKV/MP4/TS/OGM containers!" @@ -9011,13 +9011,13 @@ *) audfmt="-oac pcm" ;; esac -for i in $(seq 2 $MAX_AMOUNT_SUBS); do - if [ ! -z "${vobsubout[$i]}" ]; then +for i in $(eval echo "{2..$MAX_AMOUNT_SUBS}"); do + if [ ! -z "${vobsubout[i]}" ]; then echo green "-> Dumping subtitle $i, please wait..." sleep 2 - $MENCODER $sourcetype $device $chapters $ofps ${aid[$i]} ${subtitle[$i]} -vobsubout "${SUBFILE[$i]%.*}" -vobsuboutindex $(($i-1)) $audfmt -ovc copy -o /dev/null >/dev/null 2>&1 - if [ -e "${IDXFILE[$i]}" ]; then + $MENCODER $sourcetype $device $chapters $ofps ${aid[i]} ${subtitle[i]} -vobsubout "${SUBFILE[i]%.*}" -vobsuboutindex $(($i-1)) $audfmt -ovc copy -o /dev/null >/dev/null 2>&1 + if [ -e "${IDXFILE[i]}" ]; then green "-> Done" else error "-> Failed!" @@ -9035,72 +9035,72 @@ # Encode audio if [ "$avi_to_mkv" = "yes" -o "$avi_to_mp4" = "yes" -o "$avi_to_ogm" = "yes" -o "$avi_to_ts" = "yes" ]; then - for i in $(seq 1 $MAX_AMOUNT_AUD_TRACKS); do - if [ "${TRACKID[$i]}" = "yes" ]; then - if [ ! -z "$(grep '.*' "${AUDIOENC[$i]}")" ]; then + for i in $(eval echo "{1..$MAX_AMOUNT_AUD_TRACKS}"); do + if [ "${TRACKID[i]}" = "yes" ]; then + if [ ! -z "$(grep '.*' "${AUDIOENC[i]}")" ]; then sleep 2 echo - case "${audiocodec[$i]}" in + case "${audiocodec[i]}" in ff*) # Stream copy - audfile[$i]="$TEMPDIR/audio$i.${audext[$i]}" - green "-> Track $i: Dumping ${detectaud[$i]} audio, please wait..." + audfile[i]="$TEMPDIR/audio$i.${audext[i]}" + green "-> Track $i: Dumping ${detectaud[i]} audio, please wait..." ;; mp3) - audfile[$i]="$TEMPDIR/audio$i.mp3" + audfile[i]="$TEMPDIR/audio$i.mp3" green "-> Track $i: Encoding audio to MP3, please wait..." ;; neroaac) - audfile[$i]="$TEMPDIR/audio$i.aac" - green "-> Track $i: Encoding audio with 'neroAacEnc' to ${AACTYPE[$i]}, please wait..." + audfile[i]="$TEMPDIR/audio$i.aac" + green "-> Track $i: Encoding audio with 'neroAacEnc' to ${AACTYPE[i]}, please wait..." ;; fdkaac) - audfile[$i]="$TEMPDIR/audio$i.aac" - green "-> Track $i: Encoding audio with 'aac-enc' to ${AACTYPE[$i]}, please wait..." + audfile[i]="$TEMPDIR/audio$i.aac" + green "-> Track $i: Encoding audio with 'aac-enc' to ${AACTYPE[i]}, please wait..." ;; aac|"") - audfile[$i]="$TEMPDIR/audio$i.aac" + audfile[i]="$TEMPDIR/audio$i.aac" green "-> Track $i: Encoding audio with 'MEncoder' to LC-AAC, please wait..." ;; aac+) - audfile[$i]="$TEMPDIR/audio$i.aac" + audfile[i]="$TEMPDIR/audio$i.aac" green "-> Track $i: Encoding audio with 'aacplusenc' to HE-AACv1, please wait..." ;; aftenac3) - audfile[$i]="$TEMPDIR/audio$i.ac3" + audfile[i]="$TEMPDIR/audio$i.ac3" green "-> Track $i: Encoding audio with 'aften' to AC-3, please wait..." ;; lavcac3) - audfile[$i]="$TEMPDIR/audio$i.ac3" + audfile[i]="$TEMPDIR/audio$i.ac3" green "-> Track $i: Encoding audio with 'MEncoder' to AC-3, please wait..." ;; eac3) - audfile[$i]="$TEMPDIR/audio$i.eac3" + audfile[i]="$TEMPDIR/audio$i.eac3" green "-> Track $i: Encoding audio with 'MEncoder' to E-AC-3, please wait..." ;; vorbis) - audfile[$i]="$TEMPDIR/audio$i.ogg" + audfile[i]="$TEMPDIR/audio$i.ogg" green "-> Track $i: Encoding audio with 'oggenc' to Vorbis, please wait..." ;; opus) - audfile[$i]="$TEMPDIR/audio$i.opus" + audfile[i]="$TEMPDIR/audio$i.opus" green "-> Track $i: Encoding audio with 'opusenc' to Opus, please wait..." ;; flac) - audfile[$i]="$TEMPDIR/audio$i.flac" + audfile[i]="$TEMPDIR/audio$i.flac" green "-> Track $i: Encoding audio with 'flac' to FLAC, please wait..." ;; dts) - audfile[$i]="$TEMPDIR/audio$i.dts" + audfile[i]="$TEMPDIR/audio$i.dts" green "-> Track $i: Encoding audio with 'dcaenc' to DTS, please wait..." ;; pcm) - audfile[$i]="$TEMPDIR/audio$i.avi" + audfile[i]="$TEMPDIR/audio$i.avi" green "-> Track $i: Encoding audio with 'MEncoder' to PCM/WAV, please wait..." ;; esac - source "${AUDIOENC[$i]}" >/dev/null 2>&1 - if [ -e "${audfile[$i]}" -a "$(stat -c %s "${audfile[$i]}")" -ge "20480" ]; then + source "${AUDIOENC[i]}" >/dev/null 2>&1 + if [ -e "${audfile[i]}" -a "$(stat -c %s "${audfile[i]}")" -ge "20480" ]; then green "-> Track $i: Done" else error "-> Track $i: Failed"
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.