]> code.delx.au - transcoding/blob - batchencode.sh
Enabled bframes for x264 and tweaked default bitrate
[transcoding] / batchencode.sh
1 #!/bin/bash
2
3 # inputdesc specification:
4 #
5 # general options
6 # output_file\tinput_file\tspecific_options
7 # output_file\tinput_file\tspecific_options
8 #
9 # Example inputdesc
10 # --filters pp=ci,crop=704:576:10:0,scale=768:576,denoise3d,harddup
11 # 1x01.avi dvd://1 --dvd DISC1
12 # 1x02.avi dvd://1 --dvd DISC2
13
14
15 encoder="$1"
16 input="$2"
17 if [ -z "$input" ]; then
18 echo "Usage: $0 toh264.py inputdesc"
19 exit 1
20 fi
21
22 # Read the general options
23 options="$(head -n 1 "$input")"
24
25 # Read each file description
26 tail -n +2 "$input" | while read line; do
27 out=$(echo "$line" | cut -d ' ' -f 1)
28 in=$(echo "$line" | cut -d ' ' -f 2)
29 specopts=$(echo "$line" | cut -d ' ' -f 3)
30 nice -n 10 "$encoder" $options $specopts "$in" "$out"
31 done
32