Efficiently trim a ton of video files, using Adobe Premiere, NodeJS, and ffmpeg

I recently shot forty 360º videos with the Freedom360 rig. The rig holds 6 GoPros, so I have 40 * 6 = 240 video files.

I’m using Autopano Video Pro to stitch the 6 angles into a single composed, stitched, blended, projected 360º video file. Autopano is doing everything automatically, out of the box, *except* time-sync (I manually pressed record on each camera, so the start times are stuttered). I made sure to clap once or twice near the rig on most shots, thinking Autopano’s audio-analyzing sync feature could latch on to that, but I’ve had no luck.

I decided to synchronize the angles manually* in Adobe Premiere, which is pretty straightforward and quick once you look at the waveforms:
* Apparently Premiere has a multi-cam feature which can auto-synchronize by analyzing the audio track!

Six angles manually synchronized by eyeballing the clap waveform

There’s just one problem: in order to export all 6 channels of time-trimmed video, you have to solo a video track, click File → Export, deal with whatever dialog appears, solo the next video track, click File → Export, deal with the dialog again, and then do it all again, and again, and again, and … again!

Sigh.

Luckily, Premiere can export a sequence to the “Final Cut Pro XML” format, which might as well be called “XML” because who uses Final Cut Pro anymore, amirite!?!?

With XML in hand, one terminal command trims all six videos, at blazing fast ffmpeg+SSD speeds (ffmpeg is smart enough to not re-encode the video; I get >3,000 frames per second on my Retina 13"!).

$ fcptrim sequence.xml | bash

fcptrim is a NodeJS script I wrote, and published on npmjs.org. If you have NodeJS installed, installing fcptrim is as easy as:

$ npm install -g fcptrim

You need NodeJS and ffmpeg installed. I recommend installing NodeJS from nodejs.org, and installing ffmpeg via Homebrew.

And… that’s about it! Here’s fcptrim on GitHub: https://github.com/gimlids/fcptrim


Oh, I almost forgot. If you’re actually doing 360º video, there are camera options that require less post-processing than the 6 GoPro rig. One interesting recent development in this space: Facebook plans to release designs for a 360º video camera (using off the shelf cameras from Point Grey) that attacks the stitching and sync issues head on, negating the need for most of the complicated post-processing.

Read: https://code.facebook.com/posts/1755691291326688/introducing-facebook-surround-360-an-open-high-quality-3d-360-video-capture-system/

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.