Automator + FFMPEG for audio/video work with locked endpoints

Hey, y’all! Just did something that some of you might find interesting (and maybe even helpful!)

I just got a job doing some sound editing and design for a small production company here in Nashville. I frequently get locked picture edits with set endpoints which get imported into Ableton. I then do all my audio work underneath that video clip and export based on the the time region created by selecting that video clip. From there, I usually used Premiere/Media Encoder for a faster encode when merging the new audio with the video (Ableton’s video encoding is… just awful tbh).

But after my fourth try at a particularly challenging mix (the client was very very picky) I got a bright idea while watching that encode bar creep across the screen: if the video is just an MP4 containing a video and an audio stream, why can’t I just replace the audio stream and without re-encoding video?

So I built an Automator script to do just that! I’ve included a link to a download of the Automator service so you can install it in your ~/Library/Services and use it right from Finder context menus. To use it you just right click the audio you want to swap in, choose the “audioswap” service, then select the video file you want to swap it into from the Finder window that pops up.

The only caveats are as follows:

  1. you gotta have ffmpeg installed
  2. the video and audio need to be synced beforehand
  3. you’ll need to be using a container format that ffmpeg likes (I’ve only tested it with .mov and .mp4)
  4. the script automatically converts your audio to an m4a just in case you, like me, are working with .wav files that don’t like being put inside mp4 containers
  5. the outputs (m4a audio and mp4 video container) are dumped to your home directory, so you’ll have to move them from there

Hope this helps someone save time! It’s a very specific workflow but I’m so proud I just had to share.