Rotating capture system with HDHomeRun

This is Carlos' quick and dirty solution to have a grid with captions from all stations using a few tuners, obviously by rotating them to cover all channels.

File directories:


The /channels/ directory contains one file per channel. When a channel is being recorded its file must be renamed to $name.inuse. When done, touched, then renamed back to $ If a process attempts to rename a channel file and fails it must assume that some other process picked up that channel and must continue to the next one.

The cc_capture script always reads contents of /channels/ and picks the oldest file that is free (meaning there isn't another process capturing it).