Monday, October 12, 2009

Quick & Dirty Rifftrax Re-Author

This guide is for creating a Rifftrax video in Ubuntu utilizing an AVI source file. As the title says, this is a 'quick & dirty' method. I'm not going to go over audio ducking or Disembaudio muting. Perhaps I'll include these in a future tutorial.

First off, we're going to need to acquire three programs: mencoder, ffmpeg, and audacity. These can be installed the normal way either through the Synaptic Package Manager or via command line.

sudo apt-get install audacity
sudo apt-get install mencoder
sudo apt-get install ffmpeg

(If you need to generate an AVI file from your DVD, I recommend Handbrake.)

Once you have all three programs, we'll begin by extracting the MP3 audio file from the AVI. Make sure you're in the proper directory and from the command line enter:

ffmpeg -i room.avi room.mp3

As you can see, my input file is called room.avi. You'll, of course, have to change to the name of your file. The audio output is room.mp3. You can call this file whatever you please. (Note: You can use mencoder to extract the audio, but it generates a much bigger file and takes longer.)

Next, we're going to remove the audio track from our video source. (That is we want a video with no sound on it so there's no conflict when we recombine.) Again, you can name the output whatever you feel like.

mencoder -ovc copy -nosound room.avi -o room_mute.avi

Along with the Rifftrax mp3, we should have all the files we need. Now comes the tricky part. Fire up Audacity. Import your movie's audio by choosing File-->Import-->Audio or by simply dragging the files onto Audacity. Our sound waves are a bit mashed together, so click the + magnifying glass several times.

Now we need to find the spot on the Rifftrax audio where Mike tells you to pause. This usually occurs around the 2 minute mark. It also might be helpful to mute the movie audio for now. Click the area just after the 'pause.' Press Shift + J to select the area from your cursor to the start of the track. You should have something that looks a bit like this:

Press the Delete key to remove this selection. Un-mute the movie audio if you muted it before. Press play and note down the time of Disembaudio's first sync line and also time for the corresponding line in the movie. The movie audio line might be obscured by sound effects/music, so zoom in more if necessary. (Use the counter down at the bottom left to get very precise time measurements.)



In my example, I found that Disembaudio's sync started at 2 minutes 8.155 seconds. The corresponding movie line occured at 2 minutes 27.340 seconds. By subtracting, we can determine that Disembaudio is 19.185 seconds ahead of the movie.

Go back to the beginning of the Rifftrax audio and place the cursor in the area with no sound. From the menu choose Generate-->Silence. From the drop down choose hh:mm:ss + milliseconds. Enter the amount you want to offset, in this case 19.185. You should be fairly spot on with this method, but if you're off for some reason, just add or subtract silence from the beginning of the track. One final thing you might want to do is adjust the gain from the -/+ slider to the left of the track. I like to make my Rifftrax audio somewhat louder than the movie.


Finally, the hard part is over. Choose File-->Export-->Ok. Name your file something like room_mixed.mp3 and click Ok.

Once this is done exporting, all we need to do is combine our mixed audio with our audioless video source. For this we turn back to our old friend mencoder. From the command line type:

mencoder -ovc copy -audiofile room_mixed.mp3 -oac copy room_mute.avi -o room_rifftrax.avi

And there you have it. Enjoy!

2 comments:

  1. This is a great tutorial, it was turbo helpful!

    I found that you do not really need to make a copy of video with no sound.

    You can also do the syncing with a video editing Linux application called kdenlive

    Thanks!

    ReplyDelete
  2. Thanks this is helpful. It might be worth mentioning that running the autoducking over the lined up audio file will produce a good result and you don't need to do anything other than actually just select it and run it.

    Then the movie audio gets pulled down when the riff happens.

    ReplyDelete