Like a lot of people these days, I spend a huge amount of time each week on video calls for work. During the height of the pandemic, I put a fair amount of effort into video hardware in my home office, with a nice camera feeding video into a Blackmagic Design ATEM video controller and then feeding Zoom or Google Meet from it over USB. Originally I was using still photos as backdrops, but about a year ago I started a recording subtle video backgrounds to use instead of stills. Streams flowing in slow motion, landscape scenes with clouds blowing, trees subtly blowing in the wind – that sort of thing. I added a used Blackmagic HyperDeck video recorder for playing back videos that the ATEM could use as a background. I could have used a Raspberry Pi or something similar, but I decided that buying a box that Just Worked in this case was better than spending a half hour debugging the Pi every other month.

My basic workflow was pretty simple – record something, load it into DaVinci Resolve, edit it until I’m happy with it, and then export two copies. One at 4k (or higher) resolution and one as a 1080P H.264 video for the HyperDeck. Then copy the HyperDeck one onto the HyperDeck’s SD card using FTP. That worked fine – Resolve has a preset for the HyperDeck, but little problems kept creeping in. Half of my videos ended up being exported at 30 FPS and half at 29.97 FPS, for example. They both work, but the HyperDeck wants me to pick one or the other, and its list of playable videos only includes ones that match the current video mode. Every other file is invisible. So at any given time only half of my backgrounds are playable without minor tweaking. Also, it’s way too easy to accidentally export videos as 4k, which my HyperDeck can’t play, or in H.265 (ditto). There’s no error or anything – the files just aren’t visible. Plus exporting two copies from Resolve, into different directories with different filenames is generally a hassle.

If only I had a tool that coud transform a directory full of video files, skipping files that have already been transformed. Then I could just export videos from Resolve once, in whatever format makes the most sense, and have videos make their way to the HyperDeck automatically.

Let’s break this into three pieces:

  1. Transform the video files from whatever format I decide to export from Resolve into something that the HyperDeck can play.
  2. Automate transforming a whole directory’s worth of files.
  3. Automate getting them into the HyperDeck.

The first bit – transform video files – is a job for FFMPEG. FFMPEG is sort of the swiss army knife of video transformation. it can do almost anything, but actually finding the right mess of weird command line flags for it is a pain. It doesn’t help that the HyperDeck is very picky about video formats.

A bit of experimentation showed that using -vcodec libx264 -vprofile main -level 4.0 -r 60 -maxrate 16M -crf 23 -bufsize 32M -s 1920x1080 -acodec aac -f mov seemed to produce working files for my HyperDeck Studio HD Mini running firmware 8.4. YMMV. I haven’t verified that audio works with this because I’m not using audio in my files.

The second bit – transform a directory full of video files – sounds like a job for make. Here’s a Makefile that will run ffmpeg over all .mov or .mp4 files in the current directory and produce a .mov file in the Hyperdeck/ subdirectory for each:

FFFLAGS=-vcodec libx264 -vprofile main -level 4.0 -r 60 -maxrate 16M -crf 23 -bufsize 32M -s 1920x1080 -acodec aac -f mov

all-src-vids := $(wildcard *.mov *.mp4)
all-hd-vids := $(patsubst,Hyperdeck/, $(all-src-vids)) $(patsubst %.mp4,Hyperdeck/, $(all-src-vids))

ALL: $(all-hd-vids)

	ffmpeg -i $< ${FFFLAGS} $@

Hyperdeck/ %.mp4
	ffmpeg -i $< ${FFFLAGS} $@

Now I can just run make on the command line and everything gets re-rendered as needed. If an output file is newer than the input file, then it won’t be re-processed. So in general rerunning make is free, and if I find a problem with a video and re-export it from Resolve, then make will see that the source file is now newer than the destination and rebuild it.

Finally, there’s the issue of getting these onto the Hyperdeck. I have a relatively small SD card on mine; I could just FTP everything from the Hyperdeck/ subdirectory over, but eventually it’ll end up filling up and I’ll have to do some amount of manual cleanup.

Fortunately, the latest software release for the HyperDeck includes NAS support. I set up a guest user in Samba, exported the Hyperdeck/ directory, and then used the screen on the HyperDeck to select my file server and my Hyperdeck/ share. And Voila – every properly-formatted video that gets dropped into the subdirectory is automatically available to play with no extra steps and no worry about disk capacity.

Since the videos are encoded at a max of 16 Mbps and the HyperDeck can pretty easily use most of 1 Gbps when writing to its SD card, it’s probably going to be okay streaming video over Ethernet. At max, it should only be 2% utilized.