Notes on synchronising RiffTrax Just the Jokes with a movie.
.m4vAudacity project with movie audioAudacity project.mp3Audacity - for audio editingffmpeg - for audio extraction and final construction of the video (installable with brew)Handbrake - to rip the video from the original media source (if necessary)Homebrew - to install packages on the Macmkvtoolnix - for inspection of media files (installable with brew)I’ll be using the movie Gravity as an example, but you should change filenames, accordingly.
As the focus of RiffTrax is really the jokes, we take some liberties with the movie audio - compressing the loud and quiet sections, and mixing down from surround/5.1 to stereo.
ffmpegFor these instructions, ffmpeg needs to be built with the Fraunhofer AAC codec libfdk_aac. Since version 2.0, homebrew no longer allows installation/compilation options for core packages, so this needs to be installed from a third-party tap. On the Mac, this can be done in homebrew using
brew tap homebrew-ffmpeg/ffmpeg
brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-fdk-aac
mkvtoolnixThis package needs to be installed in order to manipulate .mkv files and extract streams. It is available via homebrew:
brew install mkvtoolnix
srt_presync and srt_postsyncThese applications can be installed by cloning this GitHub repository and using pip as follows:
git clone git@github.com:widdowquinn/sync_rifftrax.git
cd sync_rifftrax
pip install .
You can check that the installation completed successfully by issuing, e.g.
% srt_presync --help
Usage: srt_presync [OPTIONS]
Entry point for sre_presync
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ * --moviepath PATH Path to movie for extraction [required] │
│ --outpath PATH Directory for output files [default: .] │
│ --outstem TEXT Stem for output files [default: movie] │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or customize the installation. │
│ --help Show this message and exit. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
.m4vIf you need to do this, HandBrake may be useful.
Use the srt_presync.py script to extract video, audio, and subtitle streams. The command below:
srt_presync.py --moviepath Gravity.m4v --outstem Gravity --outpath movie_export
will extract these files into the movie_export folder, with filestem Gravity.
Note that all subtitle streams will be extracted with names like Gravity_subs2.ass, Gravity_subs3.ass and so on.
Audacity project with movie audioAudacity (this will create a new project)


To even up the loud and quiet parts of the movie track, we use compression.
Effects->Compressor... to compress the movie audio

Audacity project.mp3 file. I’ve found that the US .mp3s work best for blu-ray, and the PAL .mp3s for DVD.


README file for the movie is very useful, and it’s handy to have it open in a text editor windowsolo the RiffTrax audio for this stage


Selection Start manually to zero and cut the section

Tracks->Add New->Mono Track) and paste in the audio you cut, then export the selected audio to a new file (e.g. rifftrax_intro.wav), if you want to preserve it. Then delete that track.Using the RiffTrax README (here Gravity_RiffTraxReadme.txt) locate the first Disembaudio line

Here, this is at 1:56.042 (after trimming, it tends to be slightly earlier than the movie time)

Solo the movie audio, and identify the line in the movie - here it is at 2:05.125

Select the zero point at the start of the Rifftrax

Add 9.083s of silence at the beginning of the RiffTrax audio using Generate->Silence

README file, locate and select each Disembaudio line

Generate->Silence while the line is selected



Effect->Amplify to add or remove gain.

Effects->Auto-duck... to quieten the movie track whenever the RiffTrax commentary audio is playing. For this to work, have the movie audio positioned above the RiffTrax audio in the Audacity window.

Effects->Auto-duck... and set the ducking parameters

.mp3Tracks->Mix and Render

.mp3 file

Use srt_postsync.py to compile desired video, audio, and subtitle streams into a new output file. The srt_postsync.py application can combine multiple audio and subtitle streams (with language metadata) if desired, as in the example below. This allows you to keep the commentary and original audio, and any subtitles you wish.
srt_postsync.py --videopath movie_export/Gravity.mkv \
--audiopaths movie_export/RiffTrax_Gravity.mp3,Gravity.wav \
--subspaths movie_export/Gravity_subs2.ass,movie_export/Gravity_subs3.ass \
--audiolangs eng,eng \
--subslangs eng,fra \
--title "RiffTrax: Gravity: \
--outdir riffed_movies \
--outstem RiffTrax_Gravity
srt_presync.py --moviepath Gravity.m4v \
--outstem Gravity \
--outpath movie_export
srt_postsync.py --videopath movie_export/Gravity.mkv \
--audiopaths movie_export/RiffTrax_Gravity.mp3,Gravity.wav \
--subspaths movie_export/Gravity_subs2.ass,movie_export/Gravity_subs3.ass \
--audiolangs eng,eng \
--subslangs eng,fra \
--title "RiffTrax: Gravity: \
--outdir riffed_movies \
--outstem RiffTrax_Gravity
In some cases, there is no PAL audio available for a RiffTrax commentary (e.g. single-disc Lord of the Rings, Part One). In these cases, it is possible to use the NTSC-synced audio, and speed it up in order to match PAL framerates.
.mp3 trackAudacity, use Effects -> Change Tempo and set the percentage change to 4.271 (if you want to convert PAL to NTSC, the change is -4.096)OKSome RiffTrax PAL audio (e.g. Return of the King) is not quite synced with PAL DVDs. These often need a small speed-up, with a tempo change of ≈0.125 as above.