Archive for January, 2010

Converting video for my DVD player

Tuesday, January 5th, 2010

The movies i shoot with my digital camera have to be converted to play on my TV using my DVD player (using the USB functionionality of the DVD player).
My DVD player accepts video encoded in DivX and audio in MP3. The movies shot by my digital camera are encoded using Motion JPEG and the audio is PCM (yes even PCM is not supported!)

Digital camera output format

Digital camera output format

To convert the video to DivX and MP3 i use the following tools:

Before converting make sure the DivX codec is installed.

Converting video’s is done in two steps:

  1. Converting the audio to MP3
  2. Converting the video to DivX

This could be done with VirtualDub only but for some reason i could not encode the audio to MP3 (using the default Fraunhofer MP3 codec which is installed on Windows). I also tried the Lame MP3 codec without results. The codecs show up when you select the audio compression but you have to check the ‘show all formats’ checkbox to see the different output modes.¬† If they don’t show up without checking it (in my case), encoding will not work.

I have installed WinFF, which is a frontend for ffmpeg but also installs ffmpeg.

The first step in decoding is converting the audio to MP3. This is done using ffmpeg on the commandline:

C:\Program Files\WinFF>ffmpeg.exe -i input.avi -vcodec copy -acodec libmp3lam
e -ar 11025 output.avi

This will convert the audio to MP3 with a output sample rate of 11.025KHz (the same as in the input file) and will not touch the video stream (just copy it).

After that start up VirtualDub and open the video file  (File->open).
VirtualDub might give a warning that the audio has a variable bitrate. If it does we will also rewrite the MP3 stream. First we are going to change the video codec. Make sure that Video -> Full Processing Mode is selected. After that go to Video -> Compression…

A popup will apear with the video compression options.
Select DivX Codec from the list. To change any options, click configure.
In my case this was not nessesary. Finally click OK.

VirtualDub Video Compression Options

VirtualDub Video Compression Options

If VirtualDub gave a warning that the audio has a variable bitrate we also change the audio.

Make sure Audio -> Full Processing Mode is selected (not by default).

Click Audio – > Compression…

A popup will apear with a list of codecs. Select ‘MPEG Layer 3′ and select one of the output formats in the list at the right. Hit OK when done.

VirtualDub Audio Compression Options

VirtualDub Audio Compression Options

Now we can start converting the file.

Click File -> Save as AVI… and start converting…

Result after converting

Result after converting