annotate TOOLS/mencvcd @ 6002:ba14193cc935

dvbscale - setup scaling for the DVB card
author arpi
date Mon, 06 May 2002 22:49:31 +0000
parents e77da1c93ef7
children c0b50929b2cd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
1 #!/bin/sh
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
2 #
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
3 # Version: 0.1.4
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
4 #
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
5 # Licence: GPL
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
6 #
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
7 # 2002/04/14 Jürgen Hammelmann <juergen.hammelmann@gmx.de>
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
8 #
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
9 # Script: MPlayer Sources (DVD) to (S)VCD ripping and burning
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
10 #
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
11 # requires: newest mplayer cvs version
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
12 # mjpegtools v1.6 beta
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
13 # vcdimager
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
14 # cdrdao
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
15 # lame
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
16 #
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
17 ################################################################################
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
18 #
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
19 # 2002/04/11 v0.1.0: first version
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
20 # 2002/04/12 v0.1.1:
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
21 # 2002/04/14 v0.1.2:
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
22 # - handles now multiple vcd's
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
23 # - support's mp3 audio as option
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
24 # - use of mp2enc/lame instead of toolame because of support
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
25 # of resampling and mp3
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
26 # 2002/04/16 v0.1.3:
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
27 # - new option "-burnonly"
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
28 # - new option "-vbr"
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
29 # - removes mpg file after mastering cd image
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
30 # (mplayer can read bin images!)
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
31 # - bugfixes
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
32 # 2002/04/22 v0.1.4
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
33 # - bugfixes / changes
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
34 # - more options
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
35 #
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
36 ################################################################################
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
37 #
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
38 # global config section, change them to your needs!
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
39
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
40 TMPDIR="." # path to directory for creating temporary files, recommended 2-3GB space
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
41
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
42 CDDRV="generic-mmc" # cdrdao: cdwriter driver
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
43 CDDEV="--device 0,1,0" # or comment out and create link /dev/cdrecorder to your cdwriter dev
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
44
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
45
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
46 ################################################################################
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
47 AUDIO="audiodump.wav"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
48 VIDEO="stream.yuv"
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
49 VCDMODE=2
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
50 SVCDMODE=5
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
51 ################################################################################
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
52
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
53 function usage() {
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
54 echo "usage: $HOWCALLED <name> [options] [mplayer options]"
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
55 echo
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
56 echo "$HOWCALLED options:"
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
57 echo
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
58 echo "-h|-? help"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
59 echo "-w outputs in wide screen format 16:9"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
60 echo "-abr <n> output audio bitrate in kbs [224]"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
61 echo "-asr <n> output audio sample rate in Hz [48000]"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
62 echo "-blank cleans cd-rw before burning"
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
63 echo "-burnonly burn only the premastered <name>*.cue/<name>*.bin images"
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
64 echo "-cdsize <n> maximal size of cd images [646]"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
65 echo "-denoise denoises mpeg stream"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
66 echo "-noburn disables burning"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
67 echo "-mp3 outputs audio in mp3 instead of mp2 format"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
68 echo "-mpg don't encode from source, multiplex/burn"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
69 echo " only the encoded mpg stream"
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
70 echo "-ratio <s> output ratio size of frames, see yuvscaler (1)"
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
71 echo "-size <XxY> sets output size of frames"
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
72 echo "-svcdout encode to SVCD format [VCD default]"
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
73 echo "-vbr <n> output video bitrate in kbs [VCD:1152, SVCD:2500]"
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
74 echo
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
75 echo "example:"
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
76 echo "'$HOWCALLED crazy -dvd 3 -w' encodes and burns dvd title 3 to VCD in 16:9."
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
77 }
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
78
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
79 HOWCALLED=`basename $0`
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
80 NAME=$1
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
81 if [ $# -le 1 ]; then
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
82 usage
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
83 exit 1
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
84 fi
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
85 shift 1
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
86
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
87 cd $TMPDIR
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
88 rm -f $VIDEO
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
89 rm -f $AUDIO
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
90 # create a named pipe for video stream
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
91 mkfifo -m 660 $VIDEO
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
92
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
93 # some inits
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
94 sub=""
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
95 size=""
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
96 ratio=""
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
97 params=""
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
98 wide=""
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
99 blank=0
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
100 burn=1
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
101 burnonly=0
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
102 mp3=0
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
103 mkstream=1
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
104 abr=224
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
105 abrset=0
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
106 asr=44100
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
107 vbr=1152
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
108 vbrset=0
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
109 denoise="cat -"
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
110 norm="VCD"
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
111 mplexnorm="-f $VCDMODE -m 1 -V -b 46"
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
112 max=646
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
113 mpegnorm="-f $VCDMODE -b $vbr -B 260 -V 46"
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
114 imaget="-t vcd2"
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
115
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
116 while [ "$1"x != "x" ]; do
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
117 case $1 in
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
118 -w)
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
119 wide="-M WIDE2STD"
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
120 ;;
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
121 -h|-?)
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
122 usage
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
123 exit 0
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
124 ;;
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
125 -abr)
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
126 abr=$2
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
127 abrset=1
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
128 shift 1
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
129 ;;
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
130 -asr)
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
131 asr=$2
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
132 shift 1
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
133 ;;
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
134 -cdsize)
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
135 max=$2
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
136 shift 1
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
137 ;;
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
138 -blank)
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
139 blank=1
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
140 ;;
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
141 -noburn)
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
142 burn=0
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
143 ;;
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
144 -burnonly)
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
145 burnonly=1
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
146 burn=1
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
147 ;;
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
148 -mp3)
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
149 mp3=1
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
150 ;;
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
151 -mpg)
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
152 mkstream=0
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
153 ;;
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
154 -denoise)
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
155 denoise="yuvdenoise"
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
156 ;;
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
157 -ratio)
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
158 ratio=$2
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
159 shift 1
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
160 ;;
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
161 -sid) # mplayer option: have to set vop expand, too!!!
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
162 sub="-vop pp,expand=-1:-1:-1:-1:1 -sid $2"
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
163 shift 1
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
164 ;;
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
165 -size)
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
166 size=$2
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
167 shift 1
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
168 ;;
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
169 -svcdout)
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
170 norm="SVCD"
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
171 ;;
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
172 -vbr)
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
173 vbr=$2
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
174 vbrset=1
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
175 shift 1
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
176 ;;
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
177 *)
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
178 params="$params $1"
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
179 ;;
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
180 esac
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
181 shift 1
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
182 done
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
183
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
184 # some configs
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
185 if [ "$norm" == "SVCD" ]; then
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
186 [ $vbrset -eq 0 ] && vbr=2500
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
187 mplexnorm="-f $SVCDMODE -m 2 -V -b 230"
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
188 if [ -n "$wide" ]; then
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
189 wide=""
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
190 mpegnorm="-f $SVCDMODE -b $vbr -B 260 -V 230 -a 3"
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
191 else
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
192 mpegnorm="-f $SVCDMODE -b $vbr -B 260 -V 230 -a 2"
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
193 fi
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
194 imaget="-t svcd"
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
195 fi
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
196
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
197 # ratio overwrites wide sizing, size overwrites default frame size
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
198 [ -n "$ratio" ] && wide="-M $ratio"
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
199 [ -n "$size" ] && size="-O SIZE_$size"
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
200
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
201 # with mp3 audio set the default audio bitrate to 128 kbs
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
202 [ $mp3 -eq 1 -a $abrset -eq 0 ] && abr=128
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
203
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
204 # audio sample rate in kHz
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
205 ((a=$asr / 1000))
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
206 ((b=$asr % 1000))
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
207 [ $b -le 9 ] && b="00$b00"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
208 [ $b -le 99 ] && b="0$b00"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
209 kasr="$a.$b"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
210
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
211 # start de-/encoding
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
212 if [ $burnonly -eq 0 ]; then
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
213 # encode streams
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
214 if [ $mkstream -eq 1 ]; then
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
215 # start mplayer
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
216 mplayer -noframedrop -vo yuv4mpeg -ao pcm -waveheader \
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
217 -v -osdlevel 0 $sub $params &
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
218
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
219 # mjpegtools
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
220 ($denoise < $VIDEO | \
5783
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
221 yuvscaler -v 0 $wide -O $norm $size | \
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
222 mpeg2enc -v 0 -s $mpegnorm -S $max -g 6 -G 15 -r 16 \
e77da1c93ef7 by Juergen Hammelmann <juergen.hammelmann@gmx.de>, some bugfixes and new options, enables subtitles with new -vop expand plugin
jaf
parents: 5686
diff changeset
223 -4 2 -2 1 -o $NAME.mpv) &
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
224
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
225 # wait for finishing the subprocesses
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
226 wait
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
227
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
228 if [ $mp3 -eq 0 ]; then
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
229 # mp2enc/lame can't read audiodump.wav directly from named pipe,
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
230 # we have to read the whole file.
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
231 mp2enc -b $abr -r $asr -o $NAME.mpa < $AUDIO
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
232 else
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
233 lame -b $abr --resample $kasr - $NAME.mpa < $AUDIO
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
234 fi
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
235 fi
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
236
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
237 # remove wav file, won't need anymore!
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
238 rm -f $AUDIO
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
239
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
240 # multiplex streams
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
241 [ -f $NAME.mpv -a -f $NAME.mpa ] || exit 1
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
242 rm -f ${NAME}*.mpg
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
243 mplex $mplexnorm $NAME.mpv $NAME.mpa -o ${NAME}%d.mpg
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
244
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
245 # create cd images
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
246 for mpg in ${NAME}*.mpg; do
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
247 [ -f $mpg ] || exit 1
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
248 cue="`basename $mpg .mpg`.cue"
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
249 bin="`basename $mpg .mpg`.bin"
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
250 rm -f $cue $bin
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
251 vcdimager $imaget -c $cue -b $bin $mpg
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
252 [ -f $bin -a -f $cue ] && rm -f $mpg
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
253 done
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
254
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
255 # end of streaming/mastering
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
256 fi
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
257
5686
00ac1397ecb7 - new option "-burnonly": burn only the preformated bin images
atmos4
parents: 5633
diff changeset
258 # remove pipe, won't need anymore!
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
259 rm -f $VIDEO
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
260
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
261 # burn the (s)vcd's
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
262 [ $burn -eq 0 ] && exit 0
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
263
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
264 for cue in ${NAME}*.cue; do
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
265 bin="`basename $cue .cue`.bin"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
266 [ -f $bin -a -f $cue ] || exit 1
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
267
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
268 echo "please insert a cd in your cdwriter, after a keypress we start:"
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
269 read -n 1 i
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
270
5633
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
271 if [ $blank -eq 1 ]; then
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
272 cdrdao blank --reload $CDDEV --driver $CDDRV --blank-mode minimal
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
273 fi
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
274 cdrdao write --reload $CDDEV --driver $CDDRV $cue
b62460b1db74 Updated to support resampling audio and multiple cds.
atmos4
parents: 5568
diff changeset
275 done
5568
772c627c1494 anything to (S)VCD encode script by Juergen Hammelmann <juergen.hammelmann at gmx.de>
atmos4
parents:
diff changeset
276 exit 0