annotate TOOLS/divx2svcd @ 12128:69ee0a61da88

ability to disable mp3lib, liba52 and libmpeg2
author alex
date Mon, 05 Apr 2004 23:17:40 +0000
parents 67c4eacf9c24
children ec39b4555f7d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11839
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
1 #!/bin/bash
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
2
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
3 # (c) 2003 Vajna Miklos <mainroot@freemail.hu>
12012
67c4eacf9c24 v0.50 by VMiklos
diego
parents: 11970
diff changeset
4 # divx2svcd for MPlayer
11839
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
5 # distributed under GPL License
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
6
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
7 # A simple utility that creates SvcD from a video which uses avi container
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
8
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
9 # The newest version of this utility can be found at
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
10 # http://vmiklos.uw.hu/divx2svcd/divx2svcd
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
11 # MPlayer avariable at
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
12 # http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0pre3.tar.bz2
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
13
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
14 ###changelog###
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
15 #nobody cares about it :-)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
16 cat >/dev/null <<EOF
12012
67c4eacf9c24 v0.50 by VMiklos
diego
parents: 11970
diff changeset
17 0.5.0
67c4eacf9c24 v0.50 by VMiklos
diego
parents: 11970
diff changeset
18 - needless for dumpvideo patch ;-)
67c4eacf9c24 v0.50 by VMiklos
diego
parents: 11970
diff changeset
19
11970
38fd3979872b update by VMiklos
attila
parents: 11839
diff changeset
20 0.4.9
38fd3979872b update by VMiklos
attila
parents: 11839
diff changeset
21 - changed default bitrate to 1600 for better quality
38fd3979872b update by VMiklos
attila
parents: 11839
diff changeset
22 - fix for burning more than one cd
38fd3979872b update by VMiklos
attila
parents: 11839
diff changeset
23 - fix for wrong parameter help
38fd3979872b update by VMiklos
attila
parents: 11839
diff changeset
24
11839
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
25 0.4.8
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
26 - small fixes
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
27
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
28 0.4.7
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
29 - fixed bug, when there is no sub available
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
30
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
31 0.4.6
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
32 - support for burning the svcd with cdrecord
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
33 - lots of paranoid options for better quality from Denes Balatoni
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
34
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
35 0.4.5
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
36 - support for filenames including spaces
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
37
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
38 0.4.4
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
39 - support for checking all applications this script uses
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
40 - this changelog
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
41
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
42 0.4.3
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
43 - advanced detectation of movie aspect (mpeg4 codec, mpeg container)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
44
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
45 0.4.2
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
46 - advanced vf options for movies with non-standard aspect
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
47
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
48 0.4.1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
49 - checking for available sub
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
50
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
51 0.4.0
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
52 - support for tcmplex-panteltje
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
53 - support for libavcodec audio encoder
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
54
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
55 0.3.1-0.3.2
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
56 - small fixes
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
57
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
58 0.3
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
59 - almost totally rewritten from scratch
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
60 based on the idea of Denes Balatoni <pnis@coder.hu>
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
61 - support for toolame instead of mp2enc
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
62 - suppert for libavcodec mpeg2video codec instead of mpeg2enc
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
63
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
64 0.2
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
65 - support for tcmplex instead of mplex
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
66
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
67 0.1rc2-rc4
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
68 - small bugfixes
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
69
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
70 0.1rc1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
71 - initial release
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
72
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
73 EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
74
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
75
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
76 ###preparing###
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
77 #help
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
78
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
79 function usage()
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
80 {
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
81 cat <<EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
82 Usage: `basename $0` input_avi [options]
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
83
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
84 Options:
11970
38fd3979872b update by VMiklos
attila
parents: 11839
diff changeset
85 -b|--bitrate xx bitrate of mp2 video stream [1600]
38fd3979872b update by VMiklos
attila
parents: 11839
diff changeset
86 -s|--cdsize xx size of the cd we split the video to [795]
11839
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
87 -w|--writecd enables burning [disable]
11970
38fd3979872b update by VMiklos
attila
parents: 11839
diff changeset
88 -d|--device xx scsi cd-recording device if you are using linux 2.4.x [0,0,0]
11839
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
89 -c|--clean clean up svcd images you just created
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
90 -h|--help this help screen
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
91 EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
92
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
93 }
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
94
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
95 #initializating constants
12012
67c4eacf9c24 v0.50 by VMiklos
diego
parents: 11970
diff changeset
96 version='0.5.0'
67c4eacf9c24 v0.50 by VMiklos
diego
parents: 11970
diff changeset
97 bitrate=1375
11839
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
98 cdsize=795
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
99 burning=0
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
100 cleaning=0
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
101 dev4='0,0,0'
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
102 firstcd=1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
103
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
104 #paranoid options
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
105 paraopts='vrc_override=1,10,708:vqcomp=0.1:vratetol=10000000:vrc_buf_size=917:vrc_maxrate=2500:intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,12,14,18,27,29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,39,38,40,48,27,29,34,37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79:inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26,28,30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44'
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
106
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
107 #header
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
108 echo "DivX2SvcD $version (C) 2003-2004 Vajna Miklos"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
109 echo
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
110
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
111 #checking for bc
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
112 which bc >/dev/null 2>&1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
113 bcbin=`which bc 2>/dev/null`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
114 if [ $? != 0 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
115 cat <<EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
116 ERROR: Can't find bc. You can download it at
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
117 ftp://ftp.ibiblio.org/pub/gnu/bc/bc-1.06.tar.gz
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
118 EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
119 exit 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
120 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
121
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
122 #checking for vcdimager
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
123 which vcdimager >/dev/null 2>&1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
124 bcbin=`which vcdimager 2>/dev/null`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
125 if [ $? != 0 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
126 cat <<EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
127 ERROR: Can't find vcdimager. You can download it at http://www.vcdimager.org
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
128 /pub/vcdimager/vcdimager-0.7_UNSTABLE/vcdimager-0.7.14.tar.gz
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
129 EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
130 exit 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
131 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
132
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
133 #checking which mplex utility we have to use
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
134 which tcmplex-panteltje >/dev/null 2>&1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
135 if [ $? = 0 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
136 tcp_path=`which tcmplex-panteltje 2>&1`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
137 else
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
138 tcp_path="x"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
139 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
140 which tcmplex >/dev/null 2>&1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
141 if [ $? = 0 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
142 tc_path=`which tcmplex 2>&1`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
143 else
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
144 tc_path="x"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
145 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
146
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
147 if [ -x $tcp_path ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
148 tcbin=tcmplex-panteltje
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
149 tcopt=-0
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
150 elif [ -x $tc_path ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
151 tcbin=tcmplex
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
152 tcopt=-p
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
153 else
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
154 cat <<EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
155 ERROR: Can't find any sutable mplex utility. You can download
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
156 tcmplex-panteltje at http://sunsite.rediris.es/
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
157 sites2/ibiblio.org/linux/apps/video/tcmplex-panteltje-0.3.tgz
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
158 EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
159 exit 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
160 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
161
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
162 #pharsing parameters
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
163
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
164 if [ $# -le 0 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
165 echo "Missing parameter!"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
166 usage
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
167 exit 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
168 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
169
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
170 case $1 in
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
171 -h)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
172 usage
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
173 exit 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
174 ;;
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
175 -*)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
176 echo "Missing parameter!"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
177 usage
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
178 exit 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
179 ;;
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
180 *)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
181 input=`echo $1 |sed 's/\\ / /'`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
182 if [ "$input" == "`basename "$input"`" ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
183 input="`pwd`/$1"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
184 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
185 nev=`basename "$input" .avi`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
186 shift 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
187 ;;
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
188 esac
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
189
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
190 while [ "$1"x != "x" ]; do
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
191 case $1 in
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
192 -b|--bitrate)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
193 bitrate=$2
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
194 shift 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
195 ;;
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
196 -s|--cdsize)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
197 cdsize="$2"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
198 shift 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
199 ;;
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
200 -d|--device)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
201 dev4="$2"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
202 shift 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
203 ;;
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
204 -w|--write)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
205 burning=1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
206 ;;
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
207 -c|--clean)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
208 cleaning=1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
209 ;;
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
210 -h|--help)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
211 usage
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
212 exit 0
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
213 ;;
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
214 esac
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
215 shift 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
216 done
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
217
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
218 #checking for cd-recording device
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
219 if [ "$burning" == 1 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
220 echo -n "Searching for cdrecorder device... "
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
221
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
222 if [ `uname -r |cut -d '.' -f 2` == 4 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
223 #linux 2.4.x
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
224 dev="dev=$dev4"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
225 echo "$dev4"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
226 elif [ `uname -r |cut -d '.' -f 2` == 6 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
227 #linux 2.6.x
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
228 if [ -e /dev/cdrecorder ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
229 dev='dev=/dev/cdrecorder'
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
230 echo "/dev/cdrecorder"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
231 else
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
232 cat <<EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
233 ERROR: Device file /dev/cdrecorder not found. Please link your
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
234 cd-recording device to /dev/cdrecorder!
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
235 Example: 'cd /dev; ln -s hdc cdrecorder'
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
236 EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
237 exit 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
238 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
239 else
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
240 cat <<EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
241 ERROR: Linux 2.4 or 2.6 series not found. You can download it at
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
242 http://www.kernel.org/ ;-)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
243 EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
244 exit 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
245 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
246
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
247 #checking for cdrecord
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
248 which cdrecord >/dev/null 2>&1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
249 cdrbin=`which cdrecord 2>/dev/null`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
250 if [ $? != 0 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
251 cat <<EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
252 ERROR: Can't find cdrecord. You can download it at
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
253 ftp://ftp.berlios.de/pub/cdrecord/alpha/cdrtools-2.01a20.tar.gz
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
254 EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
255 exit 1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
256 else #checking for version >= 2.01a14
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
257 echo -n "Checking for cdrecord version >= 2.01a14... "
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
258 $cdrbin cuefile=a 2>&1 |grep 'Bad Option' >/dev/null 2>&1
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
259 if [ "$?" == 0 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
260 cat <<EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
261 ERROR: Can't find cdrecord version >= 2.01a14. You can download it at
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
262 ftp://ftp.berlios.de/pub/cdrecord/alpha/cdrtools-2.01a20.tar.gz
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
263 EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
264 else
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
265 echo "`$cdrbin -version |cut -d ' ' -f 2`"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
266 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
267 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
268 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
269
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
270 #checking for sub avariable
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
271
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
272 if [ -f "$nev.sub" ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
273 subopts=$nev.sub
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
274 else
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
275 subopts=''
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
276 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
277
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
278 if [ "x$subopts" == "x" ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
279 subs=''
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
280 else
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
281 subs='-sub '
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
282 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
283
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
284 #checking for what height needed
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
285 inputwidth=`mplayer -vo null -ao null "$input" -frames 1 2>/dev/null |grep '=>'|cut -d ' ' -f 5|cut -d x -f 1`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
286 inputheight=`mplayer -vo null -ao null "$input" -frames 1 2>/dev/null |grep '=>'|cut -d ' ' -f 5|cut -d x -f 2`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
287 svcdaspect=`echo -e "scale=10\n1.596/($inputwidth/$inputheight)"|bc /dev/stdin`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
288 height=`echo -e "scale=10\n$svcdaspect*480"|bc /dev/stdin|cut -d . -f 1`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
289
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
290 #checking for ratios less than 1.33
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
291 istoohigh=`expr $height \> 577`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
292 if [ "$istoohigh" = 1 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
293 height=576
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
294 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
295
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
296 #find out the vf options
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
297 if [ "$height" = 576 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
298 vfopts='-vf scale=480:576'
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
299 else
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
300 #-vf processes filters in reverse order
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
301 exy=`echo -e "scale=10\n(576-$height)/2"|bc /dev/stdin|cut -d . -f 1`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
302 vfopts="-vf scale=480:$height,expand=480:576:0:$exy:1"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
303 echo "Using filter options: '$vfopts'"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
304 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
305
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
306 #finish displaying informations
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
307 if [ "$burning" == 1 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
308 #asking for cd
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
309 cat <<EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
310
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
311 Please insert a blank cd in your cdwriter.
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
312 (If you are using a rewritable media,
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
313 don't forgot to blank it before using divx2svcd.)
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
314 Press any key when your are ready.
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
315 EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
316 read -n 1 i
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
317 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
318
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
319
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
320 ###start working###
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
321 #encoding
12012
67c4eacf9c24 v0.50 by VMiklos
diego
parents: 11970
diff changeset
322 mencoder -ofps 25 -oac lavc "$input" -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=$bitrate:acodec=mp2:abitrate=128:keyint=25:aspect=4/3:$paraopts -o "${nev}2.avi" -srate 44100 -of mpeg -channels 2 $vfopts $subs "$subopts"
11839
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
323
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
324 #splitting
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
325 mplayer -dumpvideo -dumpfile "$nev.m2v" "${nev}2.avi"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
326 mplayer -dumpaudio -dumpfile "$nev.mp2" "${nev}2.avi"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
327 rm "${nev}2.avi"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
328 echo "maxFileSize = $cdsize" > template
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
329 $tcbin -i "$nev.m2v" $tcopt "$nev.mp2" -o "$nev.mpg" -m s -F template
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
330 rm template
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
331 rm "$nev.m2v" "$nev.mp2"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
332
11970
38fd3979872b update by VMiklos
attila
parents: 11839
diff changeset
333 for i in *mpg
11839
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
334 do
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
335 nev2=`basename "$i" .mpg`
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
336 #creating images
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
337 vcdimager -t svcd -c "$nev2.cue" -b "$nev2.bin" "$i"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
338 #burning if needs
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
339 if [ "$burning" == 1 ]; then
11970
38fd3979872b update by VMiklos
attila
parents: 11839
diff changeset
340 if [ "$firstcd" != 1 ]; then
11839
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
341 cat <<EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
342
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
343 Please insert an another blank cd in your cdwriter.
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
344 Press any key when your are ready.
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
345 EOF
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
346 read -n 1 i
11970
38fd3979872b update by VMiklos
attila
parents: 11839
diff changeset
347 else
38fd3979872b update by VMiklos
attila
parents: 11839
diff changeset
348 firstcd=2
11839
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
349 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
350 $cdrbin -v -dao $dev speed=12 gracetime=2 driveropts=burnfree -eject cuefile="$nev2.cue"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
351 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
352 #cleaning if needs
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
353 if [ "$cleaning" == 1 ]; then
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
354 rm -f "$nev2.cue" "$nev2.bin"
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
355 fi
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
356 done
cbde5342c574 add divx2svcd script.
attila
parents:
diff changeset
357 rm -f "$nev"*mpg