Adjusting audio of a video file

Many digital photo camera's produce movies in MJPEG avi-format with 8 bits audio. Unfortunately, Cinelerra (video editing software) appearently can only handle 16 bits audio in MJPEG avi's. If you load an MJPEG avi with 8 bits audio and play it back, you will get lots of noise. Also, digital photo camera's often use a low samplerate for audio, like 11024Hz. If you set the samplerate of your Cinelerra project to 48000Hz, for example to make a DVD, a samplerate conversion occurs automatically. However, there is a bug in current versions of Cinelerra which causes dropouts at the end of every scene when resampling takes place during rendering. A quick workaround for all of these problems is to convert the audio of the avi file before editing.

The command for converting the audio to 16 bits with a given samplerate (for example 48000Hz) is:

mencoder -ovc copy -oac pcm -af resample=48000:0:2 -o outfile.avi infile.avi