I'm making myself a compilation DVD from downloaded videos. Some of the downloaded videos are AVI with AC3 audio and others are MPEG-1 with MP2 audio @ 44.1kHz.

The main video is the AVI with AC3 audio and for that one I don't need to re-encode the audio at all, I am just taking the AC3 file out of the AVI and reusing it as is for the new DVD. The other videos however I obviously have to resample up to 48kHz and then re-encode to AC3 for the DVD.

The MPEG-1 video's MP2 audio tracks are fairly heavily compressed already so sound considerably louder then the better mixed AC3 track of the AVI file. What do I need to perform a replaygain analysis of the AC3 together with the resampled WAV files of the demuxed MP2s so I can adjust the volumes and make everything sound roughly the same volume when it's all authored back together for the DVD I make?