@@ -100,6 +100,7 @@ help() {
100
100
echo " -mp2 copy|aac"
101
101
echo " -mp3 copy|aac"
102
102
echo " -sel <n-n,n> # audio, subtitle stream select"
103
+ echo " -vol <factor>|<stream>=<factor> # Volume"
103
104
echo " -lang <str>=<lang>[,<str>=<lang>]"
104
105
echo " Automation"
105
106
echo " --as & # server start, search pathes in /etc/vdr-transcode-s.conf"
@@ -201,6 +202,20 @@ parameter() {
201
202
" -test" )
202
203
OPT=" $OPT $2 "
203
204
;;
205
+ " -test2" )
206
+ OPT=" $OPT $2 $3 "
207
+ # shift
208
+ ;;
209
+ " -test3" )
210
+ OPT=" $OPT $2 $3 $4 "
211
+ # shift
212
+ # shift
213
+ ;;
214
+ " -test3g" )
215
+ OPT_G=" $OPT_G $2 $3 $4 "
216
+ # shift
217
+ # shift
218
+ ;;
204
219
" -vc1" )
205
220
vc1=$2
206
221
;;
@@ -240,7 +255,7 @@ parameter() {
240
255
" -aac" )
241
256
aac=$2
242
257
;;
243
- " -aac_stereo_br" )
258
+ " -aac_stereo_br" | " -aac_br " )
244
259
aac_stereo_br=$2
245
260
;;
246
261
" aac_6ch_br" )
@@ -460,7 +475,7 @@ set_streamo() {
460
475
# declare -a $parametera_log
461
476
while [ $1 ]
462
477
do
463
- parameter $1 $2
478
+ parameter $1 $2 $3 $4
464
479
if [ " ${1: 0: 1} " == " -" -a " ${1: 1: 1} " != " -" ]
465
480
then
466
481
parameter_log=" $parameter_log $1 $2 \n"
@@ -516,6 +531,12 @@ status() {
516
531
echo $log
517
532
olddir=$( grep " PWD:" $log )
518
533
olddir=${olddir: 5}
534
+ info=$olddir /info
535
+ if [ -e $info ]
536
+ then
537
+ sender=$( grep ^C $info | cut -d \ -f 3-)
538
+ # echo $sender
539
+ fi
519
540
oldsize=$( grep " oldsize=" $log )
520
541
oldsize=${oldsize#* =}
521
542
# Duration: 01:51:21.66, start: 16209.384800, bitrate: 3498 kb/s
@@ -530,7 +551,7 @@ status() {
530
551
nw=$( echo $fps1 | wc -w)
531
552
fps1=$( echo $fps1 | cut -d \ -f $nw )
532
553
# echo fps1=$fps1
533
- echo " Duration: $dur , fps=$fps1 "
554
+ echo " Duration: $dur , fps=$fps1 $sender "
534
555
# frame=15001 fps=11331 q=-1.0 Lsize= 173773kB time=00:04:59.98 bitrate=4745.4kbits/s speed= 227x
535
556
# l=$(grep "^frame=" $(cat $vtlog) | tr '\r' '\n'| tail -n 1)
536
557
# t=$(tr '\r' '\n' < $l | grep -a "^frame=" | tail -n 1)
@@ -552,6 +573,7 @@ status() {
552
573
restz=$(( $durs - $t2 ))
553
574
prz=$(( $dur2s * 100 / $durs ))
554
575
prm=$(( $dur2s * 1000 / $durs ))
576
+ unset drop
555
577
if [[ " $l " == * " drop=" * ]]
556
578
then
557
579
drop=${l##* drop=}
@@ -586,7 +608,7 @@ ls_iso() {
586
608
e=$( readlink $( which ls) )
587
609
if [ " $e " == " " ]
588
610
then
589
- ls -l --time-style long-iso $1
611
+ ls -lL --time-style long-iso $1
590
612
else
591
613
ls -l $1
592
614
fi
@@ -709,7 +731,7 @@ input_vdr() {
709
731
fi
710
732
# ls -l --time-style long-iso * > $old
711
733
ls_iso > $old
712
- s=$( du)
734
+ s=$( du -L )
713
735
oldsize=$( echo $s | cut -d \ -f 1)
714
736
echo " oldsize=" $oldsize >> $old
715
737
input=00001.ts
@@ -1197,6 +1219,12 @@ streams() {
1197
1219
exit
1198
1220
}
1199
1221
inf () {
1222
+ info=info
1223
+ if [ -e $info ]
1224
+ then
1225
+ sender=$( grep ^C $info | cut -d \ -f 3-)
1226
+ echo $sender
1227
+ fi
1200
1228
ffmpeg $OPT_G $ffmpeg_i 2>&1 | grep -E " Duration|Stream|Chapter"
1201
1229
exit
1202
1230
}
@@ -1278,6 +1306,15 @@ set_vp9() {
1278
1306
}
1279
1307
1280
1308
1309
+ set_aac () {
1310
+ if [ " $atyp " != " stereo" ]
1311
+ then
1312
+ audio_t=" -c:$stro $aaclib -b:$stro $aac_6ch_br "
1313
+ else
1314
+ audio_t=" -c:$stro $aaclib -b:$stro $aac_stereo_br "
1315
+ fi
1316
+ }
1317
+
1281
1318
analyze () {
1282
1319
# set -x
1283
1320
ffprobe -hide_banner $ffmpeg_i 2>&1 | grep " Stream" > $t
@@ -1526,12 +1563,13 @@ analyze() {
1526
1563
[ " $ac3 " == " eac3" ] && audio_t=" -c:$stro $ac3 -b:$stro 256k"
1527
1564
if [ " $ac3 " == " aac" ]
1528
1565
then
1529
- if [ " $atyp " != " stereo" ]
1530
- then
1531
- audio_t=" -c:$stro $aaclib -b:$stro $aac_6ch_br "
1532
- else
1533
- audio_t=" -c:$stro $aaclib -b:$stro $aac_stereo_br "
1534
- fi
1566
+ set_aac
1567
+ # if [ "$atyp" != "stereo" ]
1568
+ # then
1569
+ # audio_t="-c:$stro $aaclib -b:$stro $aac_6ch_br"
1570
+ # else
1571
+ # audio_t="-c:$stro $aaclib -b:$stro $aac_stereo_br"
1572
+ # fi
1535
1573
ac3_aac=1
1536
1574
fi
1537
1575
if [ " $atyp " == " stereo" ]
@@ -1562,12 +1600,13 @@ analyze() {
1562
1600
" eac3" )
1563
1601
map=" $map -map 0:$str "
1564
1602
audio_t=" -c:$stro copy"
1565
- if [ " $atyp " != " stereo" ]
1566
- then
1567
- [ " $eac3 " == " aac" ] && audio_t=" -c:$stro $aaclib -b:$stro $aac_6ch_br "
1568
- else
1569
- [ " $eac3 " == " aac" ] && audio_t=" -c:$stro $aaclib -b:$stro $aac_stereo_br "
1570
- fi
1603
+ [ " $eac3 " == " aac" ] && set_aac
1604
+ # if [ "$atyp" != "stereo" ]
1605
+ # then
1606
+ # [ "$eac3" == "aac" ] && audio_t="-c:$stro $aaclib -b:$stro $aac_6ch_br"
1607
+ # else
1608
+ # [ "$eac3" == "aac" ] && audio_t="-c:$stro $aaclib -b:$stro $aac_stereo_br"
1609
+ # fi
1571
1610
audio=" $audio $audio_t "
1572
1611
stro1=$(( $stro1 + 1 ))
1573
1612
;;
@@ -1577,7 +1616,8 @@ analyze() {
1577
1616
[ " $OUTPUT " == " vdr" -a " $dts " == " copy" ] && dts=eac3
1578
1617
[ " $dts " == " ac3" ] && audio_t=" -c:$stro $dts -b:$stro 448k"
1579
1618
[ " $dts " == " eac3" ] && audio_t=" -c:$stro $dts -b:$stro $aac_6ch_br "
1580
- [ " $dts " == " aac" ] && audio_t=" -c:$stro $aaclib -b:$stro $aac_6ch_br "
1619
+ # [ "$dts" == "aac" ] && audio_t="-c:$stro $aaclib -b:$stro $aac_6ch_br"
1620
+ [ " $dts " == " aac" ] && set_aac
1581
1621
# [ "$dts" == "aac" ] && audio_t="-c:$stro $aaclib -vbr 2"
1582
1622
if [ " $atyp " == " stereo" ]
1583
1623
then
@@ -1727,7 +1767,8 @@ header() {
1727
1767
if [ -e /proc/asound/NVidia ]
1728
1768
then
1729
1769
lspci | grep VGA >> $log_c
1730
- grep " NVIDIA GPU " /var/log/Xorg.0.log >> $log_c
1770
+ xlog=/var/log/Xorg.0.log
1771
+ [ -e $xlog ] && grep " NVIDIA GPU " $xlog >> $log_c
1731
1772
fi
1732
1773
log_conf $conf
1733
1774
log_conf $conf1
@@ -1937,6 +1978,7 @@ server() {
1937
1978
fi
1938
1979
# PID=$(pidof $0)
1939
1980
echo $$ > $runs
1981
+ wd=$PWD
1940
1982
while (true) do
1941
1983
while read line
1942
1984
do
@@ -1957,6 +1999,7 @@ server() {
1957
1999
echo $d $dh >> $logs
1958
2000
vdr-transcode --auto > vt.log 2> vt.err
1959
2001
fi
2002
+ cd $wd
1960
2003
done
1961
2004
fi
1962
2005
done < $confs
@@ -2003,10 +2046,16 @@ auto_check() {
2003
2046
tac $logs > $t
2004
2047
# cat $t
2005
2048
sum=0
2049
+ i=0
2006
2050
while read line
2007
2051
do
2008
2052
c=$( echo $line | cut -d \ -f 3-)
2009
- [ ! -e $c ] && continue
2053
+ if [ ! -e $c ]
2054
+ then
2055
+ i=$(( $i + 1 ))
2056
+ [ $i -gt 10 ] && break
2057
+ continue
2058
+ fi
2010
2059
ext=${c##* .}
2011
2060
if [ " $ext " == " rec" ]
2012
2061
then
0 commit comments