appsvideo , 4 min read

I keep every meeting recording, so I made them small

Four hours of calls a day at up to 2.7 GB an hour fills a laptop fast. Live HEVC and an AV1 pass after each note cut 85 old recordings from 22.9 GB to 9.3 GB, and the replace step checks five things before it touches the original.

My meeting recorder's agent notes have one rule I care about more than the rest. Recordings are never deleted. Not old ones, not duplicates, not the blurry copy from the previous tool when a better one exists. The blurry copy can turn out to be the only one that survived, and I'd rather pay for disk than find that out.

The cost of that rule is easy to work out. I record about four hours of calls a day. The old setup wrote H.264 at 6 Mbit/s from a Retina screen, which came to between 1.6 and 2.7 GB an hour. That's up to 10 GB on a heavy day, and it never goes away.

So on November 29 I stopped trying to save space by deleting, and made the files smaller instead. It went in as one commit at 23:35, 534 lines, most of them in a new file called Compact.swift.

Smaller at the source

The live recording switched to HEVC on the Mac's hardware encoder, capped at 1920 pixels wide, 30 fps and 900 kbit/s. Screen shares are mostly static text and slides, so a modest bitrate keeps text sharp. The audio tracks dropped to speech quality: the mix at 48 kbit/s mono, my mic and the call audio at 32 kbit/s mono each. Those two separate tracks exist only so the transcript can tell me apart from everyone else, and that only needs to be good enough to re-transcribe.

That alone brings an hour to about 450 to 500 MB. Better, still a lot for files I'll keep forever.

Smaller again, after the note exists

AV1 compresses much better than HEVC, but encoding it in real time would load the Mac during the call, which is the worst time to do it. Nothing needs the recording to be AV1 during the call, though. So the recording stays HEVC until the transcript and the note are done, and a background job converts it later with SVT-AV1 at preset 9 and CRF 42.

On a five minute sample of a real call, that came out at about 135 MB an hour of video, with text at least as sharp as the live HEVC. It costs about 3.5 minutes of CPU per hour of meeting on an M4 Pro, at nice 15.

The job is picky about when it runs:

  • only on a recording that already has its note, is at least 5 MB, hasn't changed in 10 minutes and isn't AV1 yet;
  • only while the app is idle and the Mac is on power;
  • only on a Mac that decodes AV1 in hardware, which means M3 or later, so QuickTime still plays the result. Older Macs keep HEVC;
  • one file at a time, and a call starting kills the encoder and throws away the partial file. The file gets another try later.

Replacing a file I promised never to delete

Compaction is the one exception to the never-delete rule that I signed off on, and I agreed to it on the condition that the replace step can't lose anything. The only other files the app removes are its own captures with under 30 seconds of activity, which never become recordings. The original is swapped for the AV1 copy with a single rename, and only after the copy passes all of these:

  • it has the same streams as the original;
  • its duration is within 2 seconds of the original's;
  • every stream decodes cleanly from start to end;
  • each audio track is within 4 dB of the original's loudness;
  • it is smaller.

On top of that, the original must not have changed while the job ran, and the partial file must still be the one this job wrote. The file dates carry over, so the recording still sorts where it happened. If any check fails, the original stays and the copy goes.

The loudness check is there because a copy can decode without errors, have the right duration and still be silent on one track. A silent "Others" track would make every line in a re-run transcript read as me.

One small trap on the way

The app finishes every recording with an ffmpeg pass that copies the streams into the final file. Once the live video became HEVC, that pass started producing files QuickTime wouldn't open. ffmpeg tags copied HEVC as hev1 by default, and QuickTime and Quick Look refuse to play hev1. They want hvc1. The file is fine and the bytes are the same, only the four-letter tag differs, so it looked like a corrupt file until I checked the tag:

// ffmpeg tags copied HEVC as hev1, which QuickTime and Quick Look refuse
// to play; hvc1 is what Apple's players expect.
if hasVideo && videoCodec(claim) == "hevc" { args += ["-tag:v", "hvc1"] }

The numbers so far

The job also works through old recordings from before this app existed, going back to August. By the next morning it had converted 85 files, and the log totals 22,931 MB before and 9,282 MB after. The old files gain less than new ones, because some were already compressed. A 345 MB recording from August 4 came out at 179 MB, after 7 minutes of encoding.

A new hour of meeting now ends up at about 135 MB of video plus speech-quality audio, against 1.6 to 2.7 GB before. Four hours a day comes to roughly 200 GB a year instead of 2 to 4 TB.

There's also a disk guard now. Below 10 GB free, a recording doesn't start, and I get one notification about it. Below 3 GB, a running recording stops. Neither one deletes anything to make room.

More writing

All posts