Raspberry Pi 4 DVR server - speed of commercial detection?

I have it and like it; see this link for more info. Commercial detection runs about 7-8min/hr for over-the-air MPEG source data, and about twice as slowly for TVE H264 files (not sure why, there). COMSKIP works on a single thread leaving plenty of other resources.

Also, with recent beta builds, hardware acceleration is enabled and it can transcode and stream 720p and 1080i with fairly low loads (<150%).

Awesome thanks. Curious, how do I access beta builds once I get the rpi4 up and running?

The RPI changes are in the stable build, so no beta necessary.

To update to beta you would click-and-hold the Check for Update button.

Thanks all. One other question. I noticed that since I got my rpi4 up and running, none of my new recordings have commercials detected. When I click edit commercials on that recording in the server website, I get "Error retrieving commercial details".

Appreciate any help to debug this further.

What does the log say about commercial detection?

Looks like some kind of seg fault? Here's a snippet:

2019/12/07 08:00:00 [DVR] Finished job 1575702000-43 American Ninja Warrior
2019/12/07 08:00:00 [DVR] Waiting 4h24m59.433907709s until next job 1575721500-49 Premier League Soccer
2019/12/07 08:00:00 [DVR] Processing file-1282: TV/American Ninja Warrior/American Ninja Warrior 2019-12-07-0700.mpg
2019/12/07 08:00:01 [DVR] Running commercial detection on file 1282 (TV/American Ninja Warrior/American Ninja Warrior 2019-12-07-0700.mpg)
2019/12/07 08:00:01 [DVR] Commercial detection failed with signal: segmentation fault

Are you running raspbian or something else?

Might be worth doing a sudo rpi-update

It's raspbian - it's Linux Raspbian 10.2 (kernel: 4.19.75-v7l+) .

I just ran the rpi-update and rebooted - is there something I need to do to re-initiate commercial skipping detection for all recordings? Or do I have to do something one recording at a time?

A new build is available with a button to "Redetect Commercials" for a recording.

awesome - just upgraded to v2019.12.09.2122 and clicked the Redetect Commercials option - looks like it worked on one recording. But then I run it on a 2nd recording and I get the following error:

2019/12/09 22:21:28 [DVR] Running commercial detection on file 1281 (TV/Stumptown/Stumptown S01E08 The Other Woman 2019-12-05-0300.mpg)
2019/12/09 22:21:34 [DVR] Commercial detection failed with exit status 255

also - when I force redecting of commercials on another show, I'm now getting the error below - thoughts on this plus my previous post? It seems to be episode dependent for some reason (some work fine, others not)

2019/12/10 14:57:45 [DVR] Running commercial detection on file 1279 (TV\American Ninja Warrior\American Ninja Warrior 2019-12-01-2100.mpg)
2019/12/10 14:57:45 [DVR] Commercial detection failed with open /mnt/nfsdvr/recordings/Logs/comskip/1279/comskip.ini: permission denied

Sounds like some of the permissions on your (NFS?) directory are wrong.

I use an NFS mount (to a Synology NAS). How do I know if the permissions are wrong? What should they be? Here's some ls -al outputs.

Highest level recordings folder:

drwxrwxrwx 8 1024 users 4096 Dec 4 20:29 recordings

And here's of the /mnt/nfsdvr/recordings/Logs/comskip/1279 folder where this specific error is coming from (note: that's a folder that channels DVR auto-created - is the auto creation of folders not setting permissions correctly? Or do I need to look into something on my end?):

drwx------ 2 1025 users 4096 Dec 4 21:19 1279

One directory is owned by user 1024 and the other by user 1025

They should all be owned by the user that's running the dvr.

OK - I'll look into that. And did something change on Dec 9/10 with the newer version? For the shows that I forced a redetect, it looks like those folders are owned by yet a different user (my default pi user).

drwx------ 2 1025 users 4096 Dec 4 21:19 1279
drwxrwxrwx 2 pi pi 4096 Dec 9 17:21 1281
drwxrwxrwx 2 pi pi 12288 Dec 10 09:58 1282

EDIT: I think I know the issue - when I setup my rpi4 server, I copied over some TV/Movie files as well as Log files from my older server. I guess doing that used a different user... but looks like channels DVR auto creates folders using my "pi" user. I'll see if I can change folder ownership and hopefully that will fix things

You can run:

sudo chown -R pi /mnt/nfsdvr/recordings

Yep - all set! Thanks

1 Like

rpi-update warns that it will install a prerelease version of the kernel and shouldn't generally be run. Is there a chance that there will be a fix in the commercial detection tool on the channels-dvr side, so that users can avoid prerelease kernels?

The bug is in the rpi kernel- nothing we can do on our side to fix it.

See discussion in https://github.com/raspberrypi/linux/issues/3271#issuecomment-562454081

Ah, that makes sense. Thanks for the reference!