Distributed Channels DVR instances / Collaborative CDVR Libraries

So here’s a use case…

TrueNAS server that’s just fine for storage, etc…not a super beefy CPU, but works well for most things (think TrueNAS mini). I’d like to use that as a Channels DVR server, recording to the large storage pool that’s on-device.

Now…I want better performance characteristics when streaming and I don’t want to peg the CPU of the TrueNAS because it needs to do other things as well. Enter an Apple Silicon Mac mini.

What I want to be able to do:

Use CDVR on the TrueNAS to RECORD all shows/movies.
Use CDVR on the M2 Mac mini to access that library (shared via SMB) and do all the heavy lifting when needed: commercial detection, all streaming / transcoding to clients, etc.

Why do I want to do something like this? Well…SMB connections can fail for a variety of reasons (reboots, network, etc…). The most reliable way to record the shows is to write them to local media whenever possible.

The “cost” of that reliability of recording, in the example above, is performance characteristics when streaming / detecting commercials. I’d like to get the best of both worlds.

It seems to me to do this, CDVR would need to be able to do two things:

  1. Have a way to share libraries across CDVR instances while maintaining state and avoiding race conditions.
  2. Have a way to communicate between CDVR instances recording status (e.g. when a recording is complete triggering commercial detection on the Mac in the example above). This I believe is somewhat available through the API right now, I believe…it would just need to be incorporated into the logic of this feature.

Is there any way to do this currently? Is this a feature request that’s valuable for other folks?

You want to run 2 CDVR servers. 1 that does recording (TNAS) and 1 that conects to you TV (mac)

From my understanding CDVR servers dont comunicate, sync, integrate with other CDVR servers. But they can both point to same media library.

So you would just set your Mac-CDVR point local content/imports to the TrueNas Storage. Then using WebUI you would setup all your DVR recording on TrueNas-CDVR.

All your dvr content will now show up in your Mac-CDVR automatically.

You will have to have 2 subscription to CDVR.

Im not sure how to tell the mac-cdvr to do comskip on imports automatically. I think automatic comskip on imports is the only issue/problem you will have.


Im not going to tell you not to do it this way. Its your server do as you wish. It seems overly complicated. You could just use the 1 copy of CDVR on TrueNas only. CDVR isnt really intensive. Unless your doing lots of transcoding. Is upgrading the cpu possible?


¿Idea?
Only run CDVR on mac. Setup a script that automatically move files older then "X" hours to your TrueNas. Point your imports to TrueNas.

Now TrueNas does not need to run CDVR at all. Comskip will run on the mac. Dvr recording will go to local drive (temporarily).

Then setup a cron job to prune recordings.

This would be less CPU overhead on your TrueNas.

Just a idea. Maybe its good, maybe its bad.

Good point.
But just add an additional storage path for recordings on the mac that points to the nas.
Then move older recordings off from the mac to it occasionally.
No need to deal with local content imports and matching or pruning recordings.

If your main DVR drive is filling up, you can move existing recording folders over to a new drive and add that as an additional storage path.
Note that new recordings will still be created on the primary DVR storage drive. Old recordings can be manually moved over, and will automatically play from the secondary drive if the video is not found on the main drive.

1 Like

Appreciate the feedback and suggestions about achieving some elements of the outcome I’m trying to achieve…I’ll need to take a closer look at the secondary library support that’s already builtin to CDVR. Would be lovely to have CDVR prune/offload older recordings to a different library, but I’ll write a tiny script to prune/move those older recordings and see how well that setup works.

Lovely community suggestions.

BTW: comskip in particular does have a significant CPU hit on a TrueNAS mini. When you record multiple simultaneous shows (think 5+ on at the same time on certain days), and you want to watch some of those streams in realtime, with realtime comskip…you very quickly (as in starting with two streams) run into CPU issues. That’s also ignoring the other activities the TrueNAS mini is trying to run at the same time that also consumes CPU. The mini’s a great NAS, but it’s not intended to do what I’m admittedly abusing it for…that Mac mini is a far better solution for those needs and it doesn’t break a sweat. And a one-hour show will comskip in 3 minutes on the Mac vs 8-10 minutes on the NAS. Very low transcoding latency (for remote use) and very rapid comskips are the most important factors to me. I’m trying to have my cake and eat it too here. :smile: I do think the secondary library support is the right path here overall…let’s see how it goes.

Keep us updated. I love hearing about peoples oddball solutions. Never know what will come of it.

1 Like

You are over complicating things and will increase the odds of issues. If your TrueNAS box dose not have the power you want, do one of the following:

  1. Upgrade processor and/or GPU
  2. Use NAS as storage and SMB share to another box that runs Channels

Twisting Channels into a unsupported configuration will eventually result in problems and moving to one of the above solutions or you will run a dedicated box with dedicated storage.

Ooh I'd love to see the same feature set, I have things mostly working the way I want with a local caching SSD on the Mac Mini and then mounting the NAS over SMB and using it as the media library storage along with a basic shell script/LaunchAgent to remount the SMB share if it's unexpectedly disconnected.

It's not perfect but the older 2018 Mac Mini I'm using is a huge step up when it comes to transcoding performance over the ASUSTOR NAS thanks to the T2 Chip and Intel QuickSync, I'm sure the M1/M2 Mac Mini would be an even bigger step up while sipping 1/3-1/4th the power.