Example transcode (v0.5.x) sessions:
A short overview on the resizing/clipping options of transcode

by Steffen Klupsch <steffen@vlsi.informatik.tu-darmstadt.de>

Boundary Conditions (valid for transcode-0.5.0 and later):

  • maximum image size is 1024x768
  • 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)
  • Shrinking the image with '-B' is not possible if the image width/height is not a multiple of 32.
  • Expanding the image with '-X' is not possible if the image width/height is not a multiple of 32.
  • The final frame width/height should be a multiple of 8. (to avoid encoding problems with some divx codecs)
    1. 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.
    2. Clipping and changing the aspect ratio transcode uses 3 steps to produce the input image for the export modules
      1. Clipping of the input image.
      2. Changing the aspect ratio of the 1) output.
      3. Clipping of the 2) output.

Used Options:

  1. The first clipping is defined by the option
    '-j top[,left[,bottom[,right]]]'
    if you don't specify all parameters, they will be assumed to be symmetric to the others.

    -j 80 is expanded to -j 80,0,80,0 (top,left,bottom,right)
    -j 80,8 is expanded to -j 80,8,80,8
    -j 80,8,10 is expanded to -j 80,8,10,8

  2. Changing the aspect ration can be done in 3 ways:
    • (fast) shrinking the image with option '-B n[,m]'
    • (fast) expanding the image with option '-X n,[m]'
    • (high quality) resizing with option '-Z wxh'

  3. The 2nd clipping is defined by the option
    '-Y top[,left[,bottom[,right]]]'
    if you don't specify all parameters, they will be assumed to be symmetric to the others.

Examples on Usage:

  1. Input data '16:9' 'widescreen' DVD data, output data should have 4:3 aspect ratio without black border.
    Analyze the input data, we assume a black border at the top and bottom of 66 pixel in a 720x576 pixel frame.

    1. 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
    2. Using the fast resizing options -X and -B, removing 1% at the left&right border, expanding the image width to PAL resolution, and shrinking the height to reach a correct aspect ratio:
      '-j 32,8 -X 0,2 -B 3,0 -Y 24,0'
      Final image size: 768x368 Pixel
    3. Using the fast -X resizing, expanding the image width, but removing 3% of the image at the left and the right border:
      '-j 64,24 -X 0,7'
      Final image size: 896x448 Pixel
    4. Using the slower -Z resizing, expanding the image width to PAL resolution:
      '-j 68,0 -Z 768x360'
      Final image size: 768x360 Pixel
    5. Using the slower -Z resizing, 800 Pixel image width:
      '-j 66,0 -Z 800x368'
      Final image size: 800x368 Pixel
    6. Using the slower -Z resizing, expanding the image width:
      '-j 64,0 -Z 960x448'
      Final image size: 960x448 Pixel

  2. Input data '16:9' DVD data without black borders, output data should have 4:3 aspect ratio.

    1. Using the fast resizing option -B,
      shrinking the height to reach correct aspect ratio: '-B 4,0'
      Final image size: 720x448 Pixel
    2. Using the fast -X resizing, expanding the image width, but removing 3% of the image at the left and the right border:
      '-j 0,24 -X 0,7'
      Final image size: 896x576 Pixel
    3. Using the slower -Z resizing, expanding the image width to PAL resolution:
      '-Z 768x472'
      Final image size: 768x472 Pixel
    4. Using the slower -Z resizing, 800 Pixel image width:
      '-Z 800x480'
      Final image size: 800x480 Pixel
    5. Using the slower -Z resizing, expanding the image width:
      '-Z 960x576'
      Final image size: 960x576 Pixel

PAL DVD ---> DivX 4.0 / DivX ;-)
Here is a 3 step guide to convert a PAL DVD to an AVI DivX movie with MP3 (default) sound under linux using transcode:
  • (I) Put the DVD in the drive:
    We assume, that /dev/dvd is a link to the actual device. The disk may be encrypted and we need libdvdcss as a shared library in the default library search path for this. We first do some preprocessing with tcscan to find out the best encoding bitrate and frame parameter to make the main DVD title fit on 1 or 2 CDs with renormalized sound. This is done by invoking the helper programs tccat, tcextract, tcdecode and tcscan:

    • bitrate:
      tccat -t dvd -T 1,-1 -i /dev/dvd | tcextract -x ac3 -t vob | tcdecode -x ac3 | tcscan -x pcm

      We basically pipe all chapters (use "-1" for the chapter argument of option "-T") of the main title (this number may be different on your DVD) through tcextract, where we have to supply the filetype option "-t vob". The extracted AC3 stream is decoded by tcdecode and analyzed by tcscan. The output may look like:

      [tcscan] audio frames=167838.40, estimated clip length=6713.54 seconds
      [tcscan] (min/max) amplitude=(-0.210/0.224), suggested volume [tcscan] rescale=4.470
      [tcscan] length: 167838 frames
      [tcscan] runtime: 6713 sec @ 25.000 fps
      [tcscan] MP3 bitrate: 128 kbps
      [tcscan] audio: 104.89 MB
      [tcscan] disk size: 650 MB | video 545.11 MB | encoder bitrate 681.17 kbps
      [tcscan] disk size: 700 MB | video 595.11 MB | encoder bitrate 743.65 kbps
      [tcscan] disk size: 1300 MB | video 1195.11 MB | encoder bitrate 1493.42 kbps
      [tcscan] disk size: 1400 MB | video 1295.11 MB | encoder bitrate 1618.38 kbps

      and is a simple estimate for the encoder bitrate, using the default values for MP3 sound encoded at 128 kbps. Invoke tcscan -h to learn about more options. The main title runtime is about 1h:52m and a high quality encoded movie deserves a 2 CD burn. As you can see, the unrealistic high bitrate values for the old Win32 dll codecs are no longer valid.

    • frame parameter and aspect ratio:
      tccat -t dvd -T 1,-1 -i /dev/dvd | tcscan -x vob

      and press "^C" after the MPEG frame parameter have been displayed. In this case, the output may look like

      found MPEG-2 video stream [0xe0]
      sequence: 720x576 4:3, 25 fps, ...

      which means, that we need to rescale the frame to obtain the proper aspect ratio "4:3". Another common aspect ratio is "16:9". We show below suggested scaling parameter and two transcode processing modes for both cases.

  • (II) The actual encoding session (parameter grouped by import/processing/export):

    Example: DVD title / aspect ratio "4:3" / letterbox format

    transcode -i /dev/dvd/ -x dvd -T 1,-1 -V
    -B 1,0 -Y 76,8 -s 4.47
    -t 83920,alien -y divx4 -w 1618

    [transcode] video:     import frame | 720 x 576 1.25:1
    [transcode] video: new aspect ratio | 720 x 544 1.32:1 (-B)
    [transcode] video:   clip frame (->) | 704 x 392

    • We use slightly more than 1/2 of the total number of frames "-t" or simply 1 huge file "-o alien.avi" to be split in the last step.
    • We clip off 76 lines at the top and bottom and 8 rows on both sides of the movie "-Y 76,8" before encoding to get rid of the black bars. This is only recommended for letterbox format.
    • In order to use the fast resizing of transcode with option "-B", the height and width must be a multiple of 32. Clipping 8 columns on both sides will do, in most cases they are black anyway. We will get a 704x392 frame with an aspect ratio of 1.32:1, which is acceptable.
    • Optional: We might try to go for better encoding quality. In this case, it is recommended to use the multi-pass encoding feature found in DivX 4.0 with option "-R 1". However, you need a second run with identical transcode options, except "-R 2", instead of "-R 1". The first run produces a logfile, which is analyzed to estimate optimal encoding parameter and to achieve an average encoding bitrate, that is close to the supplied value of "-w" and will fit the result onto 2 CD's.
    • Optional: Use the older DivX ;-) codec provided with the avifile export module "-y af6" instead of DivX 4.0.
    • Optional: Use the high-quality zoom option "-Z 720x544" instead of "-B 1,0".
    • The option "-V" consumes less CPU/PCI bandwidth and gives a big performance increase.

    Example: DVD chapter mode / aspect ratio "16:9" / letterbox format

    transcode -i /dev/dvd/ -x dvd -V
    -j 16,0 -B 5,0 -Y 40,8 -s 4.47
    -U alien -y divx4 -w 1618

    [transcode] video:     import frame | 720 x 576 1.25:1
    [transcode] video:   clip frame (<-) | 720 x 544
    [transcode] video: new aspect ratio | 720 x 384 1.77:1 (-B)
    [transcode] video:   clip frame (->) | 704 x 304

    • We clip off 16 lines at the top and the bottom of the movie to use the fast resizing of transcode to an almost ideal aspect ratio of 1.77:1. Clipping 8 columns on both sides and 40 rows at the top and the bottom removes the remaining black bars prior to encoding.
    • In the chapter mode "-U", the output is split into separate files labeled alien-ch00.avi, alien-ch01.avi, ... which contain the DVD chapters, that are known from the DVD player menu.

    Example: DVD chapter #25 / aspect ratio "16:9"

    transcode -i /dev/dvd/ -x dvd -T 1,25 -V
    -j 0,8 -B 6,1 -Y 40,8 -s 4.47
    -o alien-ch25.avi -y divx4 -w 1618

    [transcode] video:     import frame | 720 x 576 1.25:1
    [transcode] video:   clip frame (<-) | 704 x 576
    [transcode] video: new aspect ratio | 672 x 384 1.79:1 (-B)

    • We clip off 8 columns on both sides of the movie to use the fast resizing of transcode to an almost ideal aspect ratio of 1.79:1. No further clipping necessary for the final frame size of 672x384.
    • The encoding stops after the selected chapter 25 is done.

  • (III) It's almost done:
    The avisplit utility allows to split the AVI file(s) produced by transcode. The utility may not work for other AVI files. If you have one big file, use

    avisplit -i alien.avi -s 700

    to break a huge file (AVI files have a 2 GB limit) into the pieces alien.avi-0 and alien.avi-1 with no more than 700 MB each.

    For the second example above, we now have quite a lot of files, each containing a chapter of the movie. Distribute the files, preserving the order, onto one ore more subdirectories ./CD-N, N=1,2,..., each containing no more than 650 or 700 MB, depending on your choice of CD. Now invoke avimerge for each subdirectory

    avimerge -o movie-disk-N.avi -i ./CD_N/*.avi

    This will glue all the small files to one big AVI file named movie-disk-N.avi, where N is the number of the CD. avimerge supports wildcards and is very careful in not trashing your existing AVI files. Try to play the big files with mplayer and seek around. The audio/video synchronization should be acceptable. If everything seems fine, go ahead and burn your CDs.

NTSC DVD ---> DivX
Here is a 3 step guide to convert a NTSC DVD to an AVI DivX movie with MP3 (default) sound under linux using transcode:
  • (I) Put the DVD in the drive:
    Follow step (I) for the PAL DVD, with option "-f 23.976" for tcscan.

  • (II) The actual encoding session (parameter grouped by import/processing/export) :

    Example: DVD title / aspect ratio "4:3" / letterbox format

    transcode -i /dev/dvd/ -x dvd -T 1,-1 -g 720x480 -M 2 -V
    -X 2,0 -Y 80,8 -s 4.47
    -t 83920,alien -y divx4 -w 1618 -f 23.976

    [transcode] video:     import frame | 720 x 480 1.50:1
    [transcode] video: new aspect ratio | 720 x 544 1.32:1 (-X)
    [transcode] video:   clip frame (->) | 704 x 384

    • We use slightly more than 1/2 of the total number of frames "-t" or simply 1 huge file to be split in the last step.
    • We clip off 80 lines at the top and bottom and 8 rows on both sides of the movie "-Y 80,8" before encoding to get rid of the black bars. This is only recommended for letterbox format.
    • In order to use the fast resizing of transcode with option "-X", the height and width must be a multiple of 32. Clipping 8 columns on both sides will do, in most cases they are black anyway. We will get a 704x384 frame with an aspect ratio of 1.32:1, which is acceptable.
    • We must provide the frame parameter "-g 720x480", the frame rate "-f 23.976" and the demuxer option "-M 2" to obtain a clean stream at a constant frame rate.

    Example: DVD chapter mode / aspect ratio "16:9" / letterbox format

    transcode -i /dev/dvd/ -x dvd -g 720x480 -M 2 -V
    -j 16,0 -B 2,0 -Y 32,8 -s 4.47
    -U alien -y divx4 -w 1618 -f 23.976

    [transcode] video:     import frame | 720 x 480 1.50:1
    [transcode] video:   clip frame (<-) | 720 x 448
    [transcode] video: new aspect ratio | 720 x 384 1.75:1 (-B)
    [transcode] video:   clip frame (->) | 704 x 320

    • We clip off 16 lines at the top and the bottom of the movie to use the fast resizing of transcode to an almost ideal aspect ratio of 1.77:1. Clipping 8 columns on both sides and 32 rows at the top and the bottom removes the remaining black bars prior to encoding.
    • In the chapter mode "-U", the output is split into separate files labeled alien-ch00.avi, alien-ch01.avi, ... which contain the DVD chapters, that are known from the DVD player menu.

    Example: DVD chapter #10 / aspect ratio "16:9" / viewing angle #2

    transcode -i /dev/dvd/ -x dvd -T 1,10,2 -g 720x480 -M 2 -V
    -j 0,8 -B 3,1 -s 4.47
    -o alien-ch10-2.avi -y divx4 -w 1618 -f 23.976

    [transcode] video:     import frame | 720 x 480 1.50:1
    [transcode] video:   clip frame (<-) | 704 x 480
    [transcode] video: new aspect ratio | 672 x 384 1.79:1 (-B)

    • We clip off 8 columns on both sides of the movie to use the fast resizing of transcode to an almost ideal aspect ratio of 1.79:1. No further clipping necessary for the final frame size of 672x384.
    • The encoding stops after the selected chapter 10 is done. Here, we choose a second camera angle, if the DVD has this feature.

  • (III) It's almost done:
    Follow step (III) of the PAL DVD example.

Multiple MPEG program stream chunks (VOB) ---> DivX
Here is a 3 step guide to rip a DVD and convert the multiple VOB chunks, or only a single file, using transcode:
  • We rip the DVD and put all VOB chunks, that make up the actual movie into a subdirectory, denoted here as "my_movie/". For an encrypted DVD, we will need libdvdcss under linux to do this, but this may not be legal.
    If you do not need DVD navigation or multiple angle features, the ripping is done by:

    tccat -i /dev/dvd -T 1,-1 | split -b 1024m - my_movie/movie-

    I assume, "/dev/dvd" is a link to the DVD device and the main title is 1. The DVD does not have to be mounted, just put it in the drive. After some time, we chunks named: movie-aa, movie-ab, ..., which are, but the last, exactly 1GB.

    The following is also valid, if we have used other programs to copy the DVD title VOBs onto the harddisk.
    It's a good idea, to let tcprobe take a look at the files you want to encode. This is done by typing:

    tcprobe -i my_movie/

    assuming that "my_movie/" is a directory in your present work directory. The output may look like

    [tcprobe] MPEG program stream
    [tcprobe] summary for my_movie/, (*) = not default, 0 = not detected
    import frame size: -g 720x480 [720x576] (*)
    aspect ratio: 16:9 (*)
    frame rate: -f 23.976 [25.000] frc=1 (*)
    audio track: -a 0 [0] -e 48000,16,2 [48000,16,2] -n 0x2000 [0x2000]
    detected (6) subtitle(s)

    As you can see, the auto-probing feature has detected a NTSC program stream with a single AC3 audio track. In the following, we only need to take care of the aspect ratio 16:9, but that has already been explained in the previous section.

  • Now we can invoke transcode with the directory mode, that internally concatenates all VOB chunks. If you need more bitrate or audio renormalization information, check the DVD section. The default is for MP3 audio encoding:

    AC3->MP3

    transcode -i my_movie/ -V
    -j 0,8 -B 3,1
    -t 10000,movie -y divx4

    To enable AC3 pass-through, use "-A" and use "-N 0x2000" to set the proper codec in the AVI file and the player. The default audio track is 0, which is in most cases the original language. If you want to have AC3 sound in your AVI-file, use:

    AC3->AC3

    transcode -i my_movie/ -V -A
    -j 0,8 -B 3,1
    -t 10000,movie -y divx4 -N 0x2000

    If you own a DVD with uncompressed PCM audio, e.g., audio track 1, and want to keep the quality, i.e., pass-through the sound, use:

    PCM->PCM

    transcode -i my_movie/ -V -a 1
    -j 0,8 -B 3,1
    -t 10000,movie -y divx4 -N 0x1

    If your DVD has MPEG audio, it's usually MP2 format. This is automatically detected and recompression to MP3 audio is performed with the default settings. However, if you need to resample your sound, here is an example, using audio track 2:

    MP2->MP3

    transcode -i my_movie/ -V -a 2
    -j 0,8 -B 3,1 -E 44100
    -t 10000,movie -y divx4

    The "-t" option splits the output into separate files labeled movie000.avi, movie001.avi,..., with exactly 10000 frames per file. On my CII 533@800 MHz, I get around 11 fps for the encoding, using the "-V" mode, which saves alot of bandwidth. This will take some hours, but since we work with linux, we don't need to care, just wait.

    • If you want to play around with other codecs, use the avifile "-y af6" export module and the option "-F". To learn about available codecs, just use "-F foo" and a list with tons of codecs is displayed.
    • If you have to interrupt your session for some reason, you can always restart with the help of the "-c" option. You only need to count the valid files, i.e., with 10000 frames, already encoded to find out the first parameter for this option. Drop the last AVI file for it may be broken, but this is not the case if you use ^C. Also use some other basename for the "-t", like "-t 10000,movie1" to make sure, not to overwrite your old files. Ok, the braindead seeking implementation takes some time, but this is rarely used anyway.

  • Take a look at the DVD section to learn how to avimerge the AVI-files. After merging, try to play the big files with mplayer and seek around. The audio/video synchronization should be acceptable. If everything seems fine, go ahead and burn your CDs. Note, that AC3 AVI files tend to be up to 25% larger compared to MP3 audio, which is the default for transcode.

Digital Video (DV) ---> DivX 4.0
Here is a 3 step guide to convert a DV tape to a full-screen AVI DivX 4.0 movie clip under linux using transcode
  • You need Arne Schirmacher's nice tool dvgrab to transfer the DV tape to disk. Make sure, you use the "--format dv2" option and maybe "--autosplit" to split the tape into small pieces. Use AVI files, since libdv sound seems to be broken. Optionally, use

    avidump -i   file.avi

    to find out important parameters: For example:

    [audio]: 32000 Hz, format=0x01, bits=16, channels=2, bitrate=1024
    [video]: 25.00 fps, codec=dvsd, frames=360, width=720, height=576

    indicates we need to provide "-e 32000". If the output looks like:

    [audio]: 32000 Hz, format=0x01, bits=16, channels=2, bitrate=1024
    [video]: 29.97 fps, codec=dvsd, frames=372, width=720, height=480

    we also need to correct the frame rate with "-f 29.97" and the NTSC frame size with "-g 720x480" in addition to "-e 32000". Fortunately, the auto-probing feature of transcode available in v.0.5.x takes care of these details.

  • To encode the clips, we have a number of options:
    • writing a shell script, that feeds transcode with each file,
    • using avimerge to create a single input file,
    • using the directory mode with option "-i". This works only in connection with the import module import_dv.so.

    AVI-file

    Here, we use a single AVI-file file.avi with "dvsd" codec as an example:

    transcode -i file.avi -x dv,avi
    -I 1 -C 1 -z -k
    -o file-divxmp3.avi -y divx4

    We use import_avi.so to extract the audio, which works flawless. Note that the audio is found in two places in the AVI-file. Firstly, interleaved in the DV video frame and secondly, the PCM audio track itself. This makes it possible to use the import module "dv" for audio extraction as long libdv is broken.
    Note: some non-dvgrab produced AVI-files may have the audio ripped from the DV frames. In this case, you must use "-x dv,avi" or "-x dv,X", were X is one of (raw,mp3,ac3).
    You can also reduce the picture to a quarter size "-r 2" to get rid of the interlace artifacts and don't need the de-interlace option "-I 1". This option is the fastes de-interlacing available, but is a simple interpolation. You might also want to try out the anti-aliasing feature with "-C 1" to process the whole frame but this is slow. The option "-z -k" flips the frame and make the necessary color space changes for the encoder.

    DV stream

    Put all AVI-files or raw DV stream into a subdirectory, e.g., named "tape/".

    transcode -i tape/
    -I 3 -C 2 -z -k
    -o tape-divxmp3.avi -y divx4

    The necessary import module is autodetected. tccat extracts the video stream of all AVI-files and concatenates them together to make the clips appear as a single DV stream for transcode. Here, the de-interlace option "-I 3", which drops one half-frame and interpolates by zooming to full frame size and, in principle, removes the interlace artifacts. We also try the anti-aliasing feature with "-C 2" to process the full frame afterwards, but this is slow.

  • Well, that's it. Use avimerge to glue the matching clips together and burn the resulting file to CD.
other supported file formats
The following file formats are auto-detected and supported. Some MPEG 1 videos may fail. The basic transcode session needs at least the options "-i" for input, "-o" for output and "-y" with your choice of export module. The following are example outputs:

transcode -i test.X
-o test_divx4mp3.avi -y divx4

MPEG 1 video: X=mpg

transcode v0.5.0-20011105 (C) 2001 Thomas Östreich
[transcode] auto-probing source test.mpg (ok)
[transcode] V: import format | MPEG1 (V=mpeg2|A=mp3)
[transcode] V: import frame | 320 x 240 1.33:1 encoded @ 1:1
[transcode] V: encoding fps | 24.000
[transcode] A: import format | 0x55 MPEG layer-3 [48000,16,2]
[transcode] A: export format | 0x55 MPEG layer-3 [48000,16,2] 128 kbps
[transcode] A: bytes per frame | 8000 (8000.000000)
[transcode] A: adjustment | 0@1000

  • Y'CrCb colorspace processing also available.
  • The import module import_mpeg2.so might read program streams, that fail with import_vob.so

MPEG elementary streams (ES): X=m2v

transcode v0.5.0-20011105 (C) 2001 Thomas Östreich
[transcode] auto-probing source test.m2v (ok)
[transcode] V: import format | MPEG (V=mpeg2|A=null)
[transcode] V: import frame | 720 x 576 1.25:1 encoded @ 4:3
[transcode] V: encoding fps | 25.000
[transcode] A: import | disabled
[transcode] A: export | disabled
[transcode] A: bytes per frame | 7680 (7680.000000)
[transcode] A: adjustment | 0@1000

  • Y'CrCb colorspace processing also available.

NuppelVideo: X=nuv

transcode v0.5.0-20011105 (C) 2001 Thomas Östreich
[transcode] auto-probing source test.nuv (ok)
[transcode] V: import format | RTjpeg NuppelVideo (V=nuv|A=nuv)
[transcode] V: import frame | 352 x 288 1.22:1
[transcode] V: encoding fps | 25.000
[transcode] V: Y'CbCr | YV12/I420
[transcode] A: import format | 0x1 PCM [41000,16,2]
[transcode] A: export format | 0x55 MPEG layer-3 [41000,16,2] 128 kbps
[transcode] A: bytes per frame | 6560 (6560.000000)
[transcode] A: adjustment | 0@1000

  • Only Y'CrCb colorspace processing available.

YUV4MPEG: X=yuv4mpeg

transcode v0.5.0-20011105 (C) 2001 Thomas Östreich
[transcode] auto-probing source test.yuv4mpeg (ok)
[transcode] V: import format | YV12/I420 YUV4MPEG (V=yuv4mpeg|A=null)
[transcode] V: import frame | 720 x 576 1.25:1
[transcode] V: encoding fps | 25.000
[transcode] V: Y'CbCr | YV12/I420
[transcode] A: import | disabled
[transcode] A: export | disabled
[transcode] A: bytes per frame | 7680 (7680.000000)
[transcode] A: adjustment | 0@1000

  • If you have the corresponding audio track in PCM WAV format, add "-p sound.wav" to the command line.

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

replacing audio

creating video clips

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:

transcode -i clip.avi -p clip.mp3
-P 1
-o new_clip.avi -y raw

Note: The MP3 stream must be identified by tcprobe. 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.

audio recompression

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 tcscan.

transcode -i movie128.avi
-P 1 -b 96 -s 2.0
-o movie96.avi -y raw

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.

fixing truncated AVI files

audio only conversion
Audio only conversion is also possible with transcode. 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.

audio track -> MP3

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":

transcode -p /dev/dvd/ -T 1,-1 -a 2
-y raw -m track.mp3

audio track -> PCM

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

transcode -p /dev/dvd/ -T 1,-1 -a 2
-y raw -m track.pcm -N 0x1

ASF audio -> MP3

I had this ASF (advanced stream format) Genesis audio file lying around and tried the avifile 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:

transcode -p carpet_crawler_1999.asf -x null,af6
-e 44100 -E 44100 -b 112
-y null,raw -m carpet_crawler_1999.mp3

Last modified: Mon Nov 26 15:57:09 CET 2001