table of contents   --> next chapter   <-- previous chapter  last modified on August 23, 2002

6. Additional tricks

There are some more topics involved in video production.

6.1. Fixing desynched audio

This does not work with AVIs that use VBR/ABR MP3s. This step uses avisync which is part of the transcode package.

avisync is easy to use: just provide an input file (-i name.avi), an output file (-o newname.avi) and the synchronization offset in frames (-n count). From avisync's help: count>0: audio starts with frame 'count'. count>0: prepend 'count' padding audio frames. An example:
avisync -i ally-not-synched.avi -o ally-synched.avi -n -2

6.2. Splitting AVIs

This does not work with AVIs that use VBR/ABR MP3s. This step uses avisplit which is part of the transcode package. Use it only with AVIs generated by transcode.

avisplit is easy to use: just provide an input file (-i name.avi) and when it should split. You can split after a fixed size (-s size_in_megs), after a number of frames (-f f1-f2) or after a number of seconds (-t s1-s2). An example:
avisplit -i ally-big-file.avi -o ally -s 700
This will produce files named ally-0000.avi, ally-0001.avi etc. that are each 100megs big at most.

6.3. Extracting audio from VOBs/MPEGs/AVIs

MPlayer can be used easily to extract sound. The -vo null options tells MPlayer not to show the video. I'm not listing all possible options. Generally use -dumpaudio -dumpfile newaudio.extension if you want to extract the audio without processing and -ao pcm -aofile newaudio.wav if you want the WAV itself.

6.4. Using separate audio files

Sometimes you want to play another audio file along with your video. MPlayer makes this rather easy: mplayer -audiofile anotherlang.mp3 myvideo.avi plays video from myvideo.avi and audio from anotherlang.mp3. A lot of Windows media players support external audio files, too. This way you can provide several language versions as separate audio files. A combination often used is to have the AVI include the English audio track and to provide additional audio tracks in separate files.

6.5. A visual AVI editor: avidemux

If you've done video editing with Windows before you probably know the excellent OpenSource editor
VirtualDub. An OpenSource utility for Linux that aims at providing the user with a similar set of features is avidemux. You can use it in order to easily cut specific parts from a movie, to apply filters, to reencode movies and to do a lot more. I suggest you take a look at it even if using the command line is as natural to you as it is for me.


table of contents   --> next chapter   <-- previous chapter  this guide was written by Moritz Bunkus