-->

Boundary Labs Blog

An eclectic mix of product and industry news, software development stuff, and technical topics of interest.

November 19, 2021

If you’ve tried exporting video in Focus (or any of the other Tesla video exporters on macOS), you've probably run into videos that cannot be decoded. In Focus you'll see a "Cannot Decode" error, and in other apps you may just have an export that hangs forever. The issue is due to subtle corruptions in the video stream that the car writes. You can usually detect them visually by scrubbing through the video until you come upon a black frame. The player doesn’t have issues with these corruptions, it just presents them as black frames. However, the built in framework for video export chokes on these frames and presents a “Cannot decode” error, which is unrecoverable.

In the past, I’ve advised people to use Focus’s video scrubber to edit out the corrupt frames (outlined here). However, I’ve found this to be at best a tedious workaround, and an unsatisfying answer to give people who just want to export their videos. The process can be especially time consuming when there are multiple corrupt frames per video. Additionally, it seems that this problem is getting worse over time. This is now the number 1 support request I receive.

The good news is that Focus 2.5 solves the issue in two ways.

First, it introduces a transcoder. The transcoder takes the original videos, decodes them, then writes them out into a new folder. Focus gives you the option of setting the transcoder quality. By default, it will encode the video in about the same quality as the source material. Choosing a lower quality allows you to produce usable video that takes up a fraction of the space, which is good for archival purposes.

The transcoder analyzes each frame as it is decoding. If it finds a corrupt frame, it is discarded. The resulting transcoded video is free of defects, and can be exported as desired. The original video is kept, stored in a folder with the same event name as the original, with the text “-original” as the suffix. Focus will then use the new transcoded video for all operations. The original can be kept or discarded at your discretion.

Second, the export function uses the transcoder automatically when it detects corrupt frames. It attempts to use the original video from the car, but if it detects bad frames, the source material in the exported time series is transcoded in place. No new folder is created, but new transcoded files appear alongside the source video. These files are then used for the export, and removed when the export completes.

Transcoding time will depend heavily on the computer you are using. New Macs using Apple Silicon can transcode 40 minutes of video (10 minutes from each camera) in a little over 2 minutes. Older Macs can be substantially slower.

If you have questions on the new functionality in Focus, or suggestions on how to improve it, you can email me at rob@boundarylabs.com or find me on Twitter at @rminerick.

Help