sync_rifftrax

Notes on synchronising RiffTrax Just the Jokes with a movie.

View the Project on GitHub widdowquinn/sync_rifftrax

Syncing RiffTrax to Ripped Video (Mac)

Table of Contents

Requirements

Notes on installation

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.

ffmpeg

For 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

mkvtoolnix

This 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_postsync

These 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.                                                                       │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Instructions

1. rip the video to .m4v

If you need to do this, HandBrake may be useful.

2. extract movie to .mkv (video), .ac3 (audio), and .ass (subtitles)

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.

5. create new Audacity project with movie audio

6. compress movie audio

To even up the loud and quiet parts of the movie track, we use compression.

7. import RiffTrax audio to the Audacity project

8. trim RiffTrax intro

9. initial RiffTrax sync

10. silence Disembaudio

11. balance riff and movie volume

12. auto-duck the movie

13. merge the audio and export to .mp3

14. multiplex (mux) the movie and audio

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

15. check the final output

Summary

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

Extras

NTSC to PAL audio tempo change

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.

Correcting RiffTrax PAL speed

Some 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.