summaryrefslogtreecommitdiffstats
path: root/debian/transcode/transcode-1.1.7/docs/html/misc.html
blob: ecef4c42ef50ebae2cac4658771006ceba3adcdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
<html>
<head>
<title> Linux Video Stream Processing Tool - Examples</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="DVD, digital video, DV, encoder, divx,
DivX;-), lame, source, posix, avifile, opendivx, codec, linux, AC3,
program stream, video, audio, transcode, decoder, stream, YV12">
</head>

<body bgcolor=#CDB5CD>


<a name=top></a>
<table cellspacing="10" cellpadding="0" border="0" width="100%">
  <tr>
    <td align=left valign="top" width=30% bgcolor="#a0a0a0">
    <table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%>
      <td align="left" bgcolor="#e9e9e9"> <FONT
      FACE="Lucida,Helvetica"> <font>Miscellaneous</font>
    </tr>
    <tr>

      <td>

	   <ul>
	     <li> <a href="#para"> <FONT FACE="Lucida,Helvetica">
		  Overview on the
		  resizing/clipping options</font></a> <br>
	   </uL>

	   <ul>
	     <li> <a href="#maudio"> <FONT FACE="Lucida,Helvetica">
		  AVI-files with multiple audio tracks</font></a><br>
	   </ul>



	   <ul>
	    <li> <a href="#pass"> <FONT FACE="Lucida,Helvetica">
		pass-through modes </font></a>

		 <ul>
		   <li><a href="#pass_1"> <FONT FACE="Lucida,Helvetica">
			replacing audio</font></a>
		   <li><a href="#pass_2"> <FONT FACE="Lucida,Helvetica">
			creating music clips</font></a>
		   <li><a href="#pass_3"> <FONT FACE="Lucida,Helvetica">
			audio recompression</font></a>
		   <li><a href="#pass_4"> <FONT FACE="Lucida,Helvetica">
			fixing truncated AVI files</font></a>
		 </ul>
		 <br>


	    <li> <a href="#audio"> <FONT FACE="Lucida,Helvetica">
		audio only conversion</font></a>
		 <br>
		 <ul>
		   <li><a href="#aud_1"> <FONT FACE="Lucida,Helvetica">
			audio track -> MP3</font></a>
		   <li><a href="#aud_2"> <FONT FACE="Lucida,Helvetica">
			audio track -> PCM</font></a>
		   <li><a href="#aud_3"> <FONT FACE="Lucida,Helvetica">
			ASF audio -> MP3</font></a>
		 </ul>

      </td>
    </tr>
</table>
</table>


<a name=para></a>
<table cellspacing="10" cellpadding="0" border="0" width="100%">
  <tr>
    <td align=left valign="top" width=30% bgcolor="#a0a0a0">
    <table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%>
      <td align="left" bgcolor="#e9e9e9">

      <font>
      resizing/clipping options
</font>
    </tr>
    <tr>
      <td>

	  <br> by Steffen Klupsch &lt;steffen@vlsi.informatik.tu-darmstadt.de&gt;

<P>
Boundary Conditions (valid for transcode-0.5.0 and later):
<UL>
  <LI> maximum image size is 1024x768
  <LI> The video frame operations ordering is fixed:
    "-j -I -X -B -Z -Y -r -z -l -k -K -G -C"
   (executed from left to right)
  <LI> Shrinking the image with '-B' is not possible
   if the image width/height is not a multiple of 32.
  <LI> Expanding the image with '-X' is not possible
   if the image width/height is not a multiple of 32.
  <LI> The final frame width/height should be a multiple of 8.
   (to avoid encoding problems with some divx codecs)

  <OL>
    <LI> Reducing the video height/width by 2,4,8
   Option '-r factor' can be used to shrink the video image by a
   constant factor, this factor can be 2,4 or 8.

    <LI> Clipping and changing the aspect ratio
   transcode uses 3 steps to produce the input image for the
   export modules
    <OL>
      <LI> Clipping of the input image.
      <LI> Changing the aspect ratio of the 1) output.
      <LI> Clipping of the 2) output.

    </OL>
  </OL>
</UL>
<P>
   Used Options:
<OL>
  <LI> The first clipping is defined by the option <br>
      '-j top[,left[,bottom[,right]]]' <br>
      if you don't specify all parameters, they will be assumed to be
      symmetric to the others.
<P>
          -j 80      is expanded to -j 80,0,80,0 (top,left,bottom,right)<br>
          -j 80,8    is expanded to -j 80,8,80,8<br>
          -j 80,8,10 is expanded to -j 80,8,10,8<br><br>
  <LI> Changing the aspect ration can be done in 3 ways:
  <UL>
    <LI> (fast) shrinking the image with option '-B n[,m]'
    <LI> (fast) expanding the image with option '-X n,[m]'
    <LI> (high quality) resizing with option '-Z wxh'
  </UL><br>
  <LI> The 2nd clipping is defined by the option
<br>
      '-Y top[,left[,bottom[,right]]]'<br>
      if you don't specify all parameters, they will be assumed to be
      symmetric to the others.

</OL>
<P>
Examples on Usage:

<OL>
  <LI> Input data '16:9' 'widescreen' DVD data,
      output data should have 4:3 aspect ratio without black border.
      <br>
      Analyze the input data, we assume a black border at the top and
      bottom of 66 pixel in a 720x576 pixel frame.
<p>
      <OL>
	<LI> Using the fast resizing option  -B,
     shrinking the height to reach a correct aspect ratio:
     '-j 32,0 -B 4,0 -Y 24,0'
     Final image size: 720x336 Pixel

      <LI> Using the fast resizing options -X and -B,
     removing 1% at the left&amp;right border, expanding the image width
     to PAL resolution, and shrinking the height to reach a
     correct aspect ratio:<br>
     '-j 32,8 -X 0,2 -B 3,0 -Y 24,0'<br>
     Final image size: 768x368 Pixel

      <LI> Using the fast -X resizing, expanding the image width,
     but removing 3% of the image at the left and the right border:<br>
     '-j 64,24 -X 0,7'<br>
     Final image size: 896x448 Pixel

      <LI> Using the slower -Z resizing, expanding the image width to PAL
     resolution:<br>
     '-j 68,0 -Z 768x360'<br>
     Final image size: 768x360 Pixel

      <LI> Using the slower -Z resizing, 800 Pixel image width:<br>
     '-j 66,0 -Z 800x368'<br>
     Final image size: 800x368 Pixel

      <LI> Using the slower -Z resizing, expanding the image width:<br>
     '-j 64,0 -Z 960x448'<br>
     Final image size: 960x448 Pixel

    </OL>
<p>
  <LI> Input data '16:9' DVD data without black borders,
   output data should have 4:3 aspect ratio.
<p>
  <OL>
    <LI> Using the fast resizing option  -B, <br>
     shrinking the height to reach correct aspect ratio:
     '-B 4,0'<br>
     Final image size: 720x448 Pixel

    <LI> Using the fast -X resizing, expanding the image width,
     but removing 3% of the image at the left and the right border:<br>
     '-j 0,24 -X 0,7'<br>
     Final image size: 896x576 Pixel

    <LI> Using the slower -Z resizing, expanding the image width
     to PAL resolution:<br>
     '-Z 768x472'<br>
     Final image size: 768x472 Pixel

    <LI> Using the slower -Z resizing, 800 Pixel image width:<br>
     '-Z 800x480'<br>
     Final image size: 800x480 Pixel

    <LI> Using the slower -Z resizing, expanding the image width:<br>
     '-Z 960x576'<br>
     Final image size: 960x576 Pixel

  </OL>
</OL>
<P>

    </table>
</table>


<a name=pass></a>
<table cellspacing="10" cellpadding="0" border="0" width="100%">
  <tr>
    <td align=left valign="top" width=30% bgcolor="#a0a0a0">
    <table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%>
      <td align="left" bgcolor="#e9e9e9">

      <font>pass-through modes</font>
    </tr>
    <tr>
      <td>
	   This section is devoted to the pass-through modes
	   available, which maybe useful for some, not so common
	   situations as outlined below.

	   <a name=pass_1><h3>replacing audio</h3></a>
	   <a name=pass_2><h3>creating video clips</h3></a>
	   Suppose you have mastered a couple of DV clips,
	   concatenated to a well defined playtime "clip1.avi" that
	   accidently
	   correspond to the length of your favorite music clip "clip2.mp3"
	   in MP3 format. We want to keep the quality of the video
	   and simply replace the PCM audio track. This is done by
	   the following command:
	   <p>

	   <table>
	     <tr>
	       <td align=left valign="top" bgcolor="#ccffcc">
	       transcode</td>

	       <td align=left valign="top" bgcolor="#ccffcc">
	       -i clip.avi -p clip.mp3</td>
		   </tr>

		   <tr><td></td>
			<td align=left valign="top" bgcolor="#ccffcc">
			-P 1  </td>
		  </tr>

	     <td></td><td align=left valign="top" bgcolor="#ccffcc">
		 -o new_clip.avi -y raw</td></tr>

	   </table>

	   <br>

	   Note: The MP3 stream must be identified by <i>tcprobe</i>.
	   If this fails, we need to supply the import module options
	   "-x dv,mp3" to make sure, the audio is decoded properly.
	   The "-y raw" export module simply writes the video chunks
	   as is together with the re-encoded audio. MP3 pass-through,
	   similar
	   to AC3 pass-through with options "-A -N 0x2000" is not yet available.

	   <a name=pass_3><h3>audio recompression</h3></a>

	   The following situation is not uncommon. Suppose your single
	   AVI-file "movie128.avi" is about 2x700MB+15MB, i.e., too large to fit
	   on 2 CD's. Fortunately, the audio is MP3 with a bitrate of
	   128kbps, which is the default.
	   We recompress the audio to 96kbps to reduce the filesize
	   below 2x700MB. Let's also double the volume of the sound,
	   if possible, or use the recommended value given by <i>tcscan</i>.

	   <p>

	   <table>
	     <tr>
	       <td align=left valign="top" bgcolor="#ccffcc">
	       transcode</td>

	       <td align=left valign="top" bgcolor="#ccffcc">
	       -i movie128.avi</td>
		   </tr>

		   <tr><td></td>
			<td align=left valign="top" bgcolor="#ccffcc">
			-P 1 -b 96 -s 2.0</td>
		  </tr>

	     <td></td><td align=left valign="top" bgcolor="#ccffcc">
		 -o movie96.avi -y raw</td></tr>

	   </table>

	   <br>

	   This is reasonable fast since video is only passed through
	   and the audio quality is still ok.
	   After you are done, use avisplit to split the file
	   into 2 chunks.
	   <a name=pass_4><h3>fixing truncated AVI files</h3></a>

	   The AVI file header is updated (written to disk), whenever video/audio
	   parameter are set. If transcode or hardware crashes, the truncated file
	   is in most cases playable for advanced players.
	   Repairing the AVI-file index is also possible via pass-through option "-P3".
<p>
	       <table>
       <tr>
	 <td align=left valign=center bgcolor="#ccffcc">
	 transcode -i crashed.avi -o new.avi -P3 -u X</td>
	 </td>
       </table>

	   <br>Option "-u X" with X>>10 enhances pass-through speed.


    </table>
</table>


<a name=audio></a>
<table cellspacing="10" cellpadding="0" border="0" width="100%">
  <tr>
    <td align=left valign="top" width=30% bgcolor="#a0a0a0">
    <table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%>
      <td align="left" bgcolor="#e9e9e9">

      <font>audio only conversion</font>
    </tr>
    <tr>
      <td>

	   Audio only conversion is also possible with
	   <i>transcode</i>.
	   Certainly, there are tons of tools out there, doing the
	   same job, so I will concentrate on useful examples, mainly
	   DVD ripping and encoding on the fly, using options "-p"
	   for input and "-m" for output.

	   <a name=aud_1><h3>audio track -> MP3</h3></a>

	   Some DVDs have a separate AC3 (Dobly Digital) film soundtrack, which
	   you might want to convert to MP3. Music DVDs have
	   tracks with uncompressed audio
	   which is LPCM format (linear PCM), you want to archive. In this
	   particular case, you might need to add "-d" for audio byte swapping.
	   You need to check with tcprobe which audio track is the
	   right one.
	   We do it in 1 step for
	   track 2 and write to the file "track.mp3":

	   <p>
	   <table>
	     <tr>
	       <td align=left valign="top" bgcolor="#ccffcc">
	       transcode</td>

	       <td align=left valign="top" bgcolor="#ccffcc">
	       -p /dev/dvd/ -T 1,-1 -a 2 </td>
	     </tr>

	<td></td><td align=left valign="top" bgcolor="#ccffcc">
	     -y raw -m track.mp3 </td></tr>

      </table>
      <p>

      <a name=aud_2><h3>audio track -> PCM</h3></a>

      If you prefer uncompressed PCM data for further processing, add
      "-N 0x1" in the command above:

	   <p>
	   <table>
	     <tr>
	       <td align=left valign="top" bgcolor="#ccffcc">
	       transcode</td>

	       <td align=left valign="top" bgcolor="#ccffcc">
	       -p /dev/dvd/ -T 1,-1 -a 2</td>
	     </tr>

	<td></td><td align=left valign="top" bgcolor="#ccffcc">
	     -y raw -m track.pcm -N 0x1</td></tr>

      </table>
      <p>


      <a name=aud_3><h3>ASF audio -> MP3</h3></a>

      I had this ASF (advanced stream format) Genesis audio file
      lying around and tried the <i>avifile</i> import module. Since
      no auto-probing is available for ASF streams in the current
      version, you must play around with the sample rate. CD quality
      is 44100 Hz samplerate:

	   <p>
	   <table>
	     <tr>
	       <td align=left valign="top" bgcolor="#ccffcc">
	       transcode</td>

	       <td align=left valign="top" bgcolor="#ccffcc">
	       -p carpet_crawler_1999.asf -x null,af6</td>
	     </tr>

	     <tr><td></td>
		  <td align=left valign="top" bgcolor="#ccffcc">
		  -e 44100 -E 44100 -b 112</td>
	   </tr>

	<td></td><td align=left valign="top" bgcolor="#ccffcc">
	     -y null,raw -m carpet_crawler_1999.mp3</td></tr>

      </table>
      <p>

    </table>
</table>

<a name=maudio></a>
<table cellspacing="10" cellpadding="0" border="0" width="100%">
  <tr>
    <td align=left valign="top" width=30% bgcolor="#a0a0a0">
    <table border="0" cellpadding="10" cellspacing="3" font size=+2 bgcolor="#ffffff" width=100%>
      <td align="left" bgcolor="#e9e9e9">

      <font>AVI-files with multiple audio tracks</font>
    </tr>
    <tr>
      <td>
	  <a name=xvcd><h3>HowTo:</h3></a>

	  Before you start, try to find the best bitrate for video
	  encoding
	  with multiple audio tracks by using <i>tcprobe</i> with
	  option "-b n*128", for example, if you want n MP3 audio
	  tracks with 128kbps bitrate each.<br>
	  A first session produces the file movie.avi with a single audio
	  track "-a 0". Now, we use a similar command to extract a second
	  audio
	  track from the source. Suppose, we used the example modules
	  "vmod,amod"
	  for video and audio extraction.<p>


	  The second session goes as follows. This session will be much
	  faster, since no video is de/encoded.<p>

	  <Ul>
	    <li>
		(1) transcode the second audio track "-a 1" into an AVI
		container file named add-on.avi This looks like:

		<table>
		  <tr>
		    <td align=left valign="top" bgcolor="#ccffcc">
		    transcode -i (...) -x null,amod -g 0x0 -y raw -a 1
		    -o add-on.avi -u 50 </tr>
	    </table>
	    <p>

	    The resulting file is only a temporary file but enables
	    proper processing with <i>avimerge</i>. The export
	    module "-y raw" is fine, since it writes proper (0 bytes)
	    video frames.
	    Set video import module to "null". If all goes well,
	    both files should be identical with respect to the number
	    of frames. Choose the proper audio track with "-a". Try also to
	    increase the internal buffers "-u" for speedup.<p>

	<li>(2) merge this track into movie.avi
	    <table>
	      <tr>
		<td align=left valign="top" bgcolor="#ccffcc">
		avimerge -i movie.avi -o dualaudiomovie.avi -p add-on.avi
	      </tr>
	</table>
	<p>

    <li> (3) Repeat steps (1-2) for even more audio tracks, if you
	wish.
	For best results, I recommend doing this procedure with a single
	AVI movie file. All <i>avi*</i> post-processing tools now support
	multiple audio tracks.<p>
	--- <br>
	Note: <i>transcode</i> supports reading from multiple-audio tracks
	but only writes (exports) to single audio/video AVI-files.
    </table>
</table>



<!-- hhmts start -->
Last modified: Thu May 16 12:59:16 CEST 2002
<!-- hhmts end -->

</body> </html>