Three Red Frames: Building an Automated QC Check for Media Offline

Overview

A short post about a mistake that made it onto the big screen, and the small tool I built so it doesn’t happen again.

Recently I handled all of the DCP encoding for a screening of films from the Encounters Films Collective. The screening went well, with one exception: sitting in the theater, I (along with everyone else) watched three separate single frames of red “Media Offline” flash up on the screen, across two separate films.

Each one lasted about 1/24th of a second. That’s not long, but a solid red frame in a dark theater is hard to miss, and once I’d seen it, I couldn’t stop watching for the next one.

What Happened

My DCP pipeline for these films had three steps:

  1. Start with a ProRes master at the native resolution and frame rate (4 of the films were at 23.976, one was at 29.97).
  2. Re-encode that master at the round number frame rates that the DCP requires, (24 or 30 fps), in DaVinci Resolve 20. (I made an assumption that Resolve would be better at a frame rate conversion)
  3. Build the DCP in DCP-o-Matic, which handles scaling to the DCP resolution and adds the black pillarboxing as needed for the flat containers these films all used.

After the screening, I assumed this may be a projector playback issue, as I had carefully spot checked the ProRes masters, the converted frame rates, and the DCPs. But did not watch them end to end.

When I went back to troubleshoot, I found that at none of the red frames were in the original frame rate masters at all. It showed up in the whole number frame ProRes files, so Resolve created it during the frame rate conversion. I had done that conversion on the Deliver page, by changing the frame rate in the render settings of a 23.976fps timeline to 24fps for example, rather than conforming anything in the timeline itself.

I don’t have a definitive answer for why Resolve does this. What I do know is why I didn’t catch it before the screening: the delivery schedule was extremely tight this year, and I ended up spot-checking the files instead of watching each one top to bottom. (Rookie mistake, I know). A single offline frame is exactly the kind of thing a spot check will walk right past.

Building an automated QC Check

Once I knew where the problem came from, I wanted a way to catch it automatically. I worked with Claude on this, asking how to detect these frames using ffmpeg, and iterating from there into a small Python tool built on it.

The approach is simple. ffmpeg’s signalstats filter measures the average color of every frame in a file, and the script then looks at those numbers for two things:

  • Red frames: a frame whose average color is strongly red, which is what Resolve’s offline slate looks like.
  • Isolated outliers: a frame that looks very different from both the frame before it and the frame after it, while those two neighbors look similar to each other. That catches any one-frame flash or glitch, not just red ones, and it doesn’t trigger on normal cuts.

Here is how the script is run:

python find_offline.py --input-directory /path/to/masters

It runs ffmpeg, reading the frame rate, bit depth, codec and pixel format from each file, and checks every video in the folder. For each file you get a report listing the frame number and timecode of anything suspicious, and the raw stats are saved alongside it so you can dig in later. It also returns an exit code, so it can sit in a delivery checklist or script.

Across the 5 films that screened, it found exactly the 3 bad frames I had remembered. So two films were affected, the other three were clean.

The script, is available over on GitHub. It only needs Python3 and ffmpeg.

Here is an example of the script catching the media offline frames:

And here is an example of running against the three clean films:

Takeaways

  • Watch the whole film, every time. Spot-checking isn’t QC. A compressed schedule is exactly when it’s tempting, and exactly when it bites.
  • Add automated checks on top. A person can miss a 1/24th-of-a-second flash. A script looks at every frame, every time. Run it on the output of each stage (the master, the 24 fps version, any DCP review export), so that if something shows up, you know which step introduced it.
  • Don’t trust the Deliver page for frame rate conversion. I don’t plan to use Resolve’s Deliver page frame rate conversion for this again. I’ll be looking at alternatives: conforming the timeline to 24 fps before rendering, or letting DCP-o-Matic handle the 23.976 to 24 change itself.

Three red frames in a theater is a humbling way to learn this, and is something that should have been avoided with proper delivery time and QC. But at least I have learned form it, and have additional tooling to help catch this issue in the future.

New Tutorials

I’ve been experimenting a bit recently with documenting things I’m learning in After Effects.  Last week, I animated the background of a text logo for a software project, and thought I’d record how it was done:

 

 

I also did a follow up video showing how you can take an AE composition with transparency, resize it, and export it to an animated GIF using both AE and Photoshop:

Enjoy!

Fun with Eclipses

In 2015, I photographed the total lunar eclipses of April 4 and September 27. The first I shot from Treasure Island in San Francisco at both 400mm and 24mm. The second eclipse I shot from Colorado Springs, and opted for a 200mm timelapse and stills at both 200mm and 400mm. A mixture of both eclipses is featured in the film below.

Music: “Long Journeys” by James Driscoll – handsomemusic.com.

 

Between the Moon and the Tide – a New Short Film

I recently completed my second short timelapse film, “Between the Moon and the Tide“.   This film documents my favorite moments captured in 2015 and early 2016, as well as a few shots taken earlier. I had so much fun chasing fog and night skies in the hills of Big Sur, seeing the fall colors in Colorado, the annual light on Horsetail Falls in Yosemite, the lush beauty of Kauai, and all the great scenery local to me in the San Francisco Bay Area.  Original music was composed by Zack Hexum.

 

My Timelapse Editing Workflow, v1

Background

Back in March 2013, I was starting to spend more time traveling to remote places for photography adventures.  I realized it would probably be smart to start collecting timelapse sequences along the way, given the effort and travel expense I was putting in, just in case I wanted to learn to put together films in the future.  In the beginning, I had no idea how I was going to process and assemble these clips.  I really just knew that I could connect an intervalometer to one camera and let it run while I used my second camera to take still shots.  By March 2015, I had collected enough material and learned enough about timelapse processing that I could release my first timelapse film, the Watchers.  Below I’ll walk through the editing workflow that I eventually arrived at and used on the film.

First, some thoughts on gear and shooting

I generally always shoot raw.  This will take up more storage, but gives you more flexibility in processing.  You may want to shoot JPEG if you have storage constraints, or if the frequency of shots required is less than your camera can save raw files.  (I generally cannot shoot more quickly than 3-4 second intervals with raw).  If shooting JPEG, take extra care to get your exposure correct and white balance set properly.

When starting out, I recommend an inexpensive intervalometer.  (I use ones by Aputure for use with my Canon 6D bodies.)  If you get into more complex day-to-night or night-to-day scenes, or are using a motion control system, you may need something more intelligent.  But you can do a lot with a cheap intervalometer.  Some newer cameras have this built in now as well.

Once you get into processing, save yourself some headache and get one or two high performance drives for editing.  When editing video, you often want to have your operating system on one drive (usually your main internal drive), your application cache on another drive, and your files on a third.  In my case, I only have one high performance external drive, where I keep my cache and files.  Initially I started on one internal drive, and also experimented with cheap external USB drives, which was painfully slow.  Eventually I settled on an external 3TB Thunderbolt G-Drive.  You can also try the free utility Blackmagic Disk Speed Test (for mac) to see how your existing drives perform.

Continue reading “My Timelapse Editing Workflow, v1”