Unofficial Kodi HDHomeRun DVR PVR Client

Kodi Community Development

Moderator: TVJunkie198

Post Reply
johnny_swindle
Posts: 29
Joined: Tue Mar 24, 2015 11:38 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by johnny_swindle » Sun Dec 01, 2019 5:46 pm

Out of desperation, I started making changes mentioned on the Libreelec site in hopes of improving the situation. In fact nothing they suggested worked. I was staring at the player settings and noticed "sync playback to display". I am sure that it has always been there, I just have never needed to change the settings.

Enabled the option and problems went away (at least I don't notice any video/audio lag...I am a bit ADD with things like that).

Will let you "borrow" a rPi4 for testing as per your suggestion. Just have to recover from working all of the holiday break and get it into the mail.

Thanks for all the work that you have done and continue to do on this project.

Johnny
djp952 wrote:
Sat Nov 30, 2019 9:04 pm
johnny_swindle wrote:
Sat Nov 30, 2019 6:35 pm
@djp952

Thanks. I will make a post over in the Libreelec forums.

PM me your mailing address.....I will gift you one of the rPi 4s that I have. It will be my contribution to further development.

Johnny
Oh! Um, I very very sincerely appreciate the offer but I just wouldn't feel right accepting any donations for this project. How about "borrowing" it to see if I can help you replicate/resolve the issue you're having for a bit, and then send it back? I would be fine with that :) I'm PM you.

djp952
Posts: 991
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Sun Dec 01, 2019 9:41 pm

johnny_swindle wrote:
Sun Dec 01, 2019 5:46 pm
Out of desperation, I started making changes mentioned on the Libreelec site in hopes of improving the situation. In fact nothing they suggested worked. I was staring at the player settings and noticed "sync playback to display". I am sure that it has always been there, I just have never needed to change the settings.

Enabled the option and problems went away (at least I don't notice any video/audio lag...I am a bit ADD with things like that).

Will let you "borrow" a rPi4 for testing as per your suggestion. Just have to recover from working all of the holiday break and get it into the mail.

Thanks for all the work that you have done and continue to do on this project.

Johnny
No worries! The RPI4 is unnecessary since you found the magic switch :) I assure you that I'll end up with one at some point anyway, and all I could have done is the same thing(s) that you did. The PVR addon is, in essence, a rather simple go-between from the HDHomeRun data and Kodi (although the amount of code involved might lead to a different conclusion) and has zero input into how the data is decoded/presented to you.

gamaru
Posts: 10
Joined: Wed Nov 28, 2018 9:20 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by gamaru » Mon Dec 02, 2019 1:10 pm

signcarver wrote:
Sat Nov 30, 2019 12:02 pm
http://ipv4-api.hdhomerun.com/discover renders only a page with blank brackets.
To show up the above and my.hdhomerun.com (which uses such) the hdhomerun devices must have internet access. There have been some routers that prevent such without a reboot. The client, browser, or whatever is trying to use such must also connect from the same public ip address so no proxy, vpn, etc.
Sorry for the extra late response but thanks for the help. I realized that I do have a VPN installed on the device in question as well as a few other devices. Once I turned it off, my.hdhomerun.com started working. I'll have to do some more testing once I get home from work tonight but if the VPN is what's screwing everything up, I'll have to figure out something.

Thanks for the help though and pointing me to where to look.

djp952
Posts: 991
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Mon Dec 02, 2019 8:58 pm

Hi everyone, I have an important favor to ask:

>> Please turn DOWN the Kodi setting "PVR & Live TV / Guide / Future days to display" to the lowest number of days you can realistically live with (I personally use 5 days)
>> Please turn UP the Kodi setting "PVR & Live TV / Guide / Update interval" to either 240 minutes (4 hours) or ideally 480 minutes (8 hours)

It turns out that my original concerns with the full EPG data causing too much load on SiliconDust's servers were pretty valid. SiliconDust very sincerely wants to provide a path forward for us to be able to keep this data accessible for everyone, but it's going to take me a bit of time to work that all out in the code.

No hard details at the moment to share, I inadvertently ended up playing phone tag (my fault) recently and I would really appreciate it if everyone could think about these settings and if they can be changed for a while without messing you up too much.

Why it will help:
  • Reducing the number of "Future days to display" will lessen the load on SiliconDust's backend by (3 x days x channels) web requests during a full EPG load.
  • Increasing the "Update interval" to 480 minutes will also lessen the load on SiliconDust's backend from (12 x channels) web requests per day to (3 x channels) web requests per day, but more importantly this eliminates throwing out 75% of the retrieved data.
I've already made a change for the next version (v2.4.2) to enable retrieving the data in a compressed form, which will help a little, but voluntarily reducing the number of times this PVR addon is hitting SiliconDust's backend for guide data as much as possible will give us the most bang for the buck short-term, while a more permanent long-term solution is being worked on.

Thank you all so much as always!

clarkss12
Posts: 1208
Joined: Sat May 11, 2013 11:51 am
Device ID: 104CBEA5 ;1055A951
Location: Michigan, USA
Contact:

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by clarkss12 » Tue Dec 03, 2019 8:07 am

Roger, WILCO.............. thanks for this fantastic PVR............

Ken.F
Posts: 2164
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F » Tue Dec 03, 2019 10:20 am

I just checked my clients and lowered the number of days to download. I already had them set to either 1440 or 2880 for the update interval. Why would anyone need the guide data to be updated multiple times per day?

djp952
Posts: 991
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Tue Dec 03, 2019 11:07 am

Ken.F wrote:
Tue Dec 03, 2019 10:20 am
I just checked my clients and lowered the number of days to download. I already had them set to either 1440 or 2880 for the update interval. Why would anyone need the guide data to be updated multiple times per day?
Kodi is a bit aggressive with trying to keep the EPG up to date. I think this mostly stems from the original PVR addons having data available at a very low "cost" (fast, local to the machine/network, etc). I've run into a lot of things where truly expensive operations weren't really considered in the design. I forget the specific user that found it, but at one point Kodi was checking the "last played position" attribute for recordings with every single UI frame render (so like 60-75 times a second) slamming the RECORD engine to death :) Good times!

Ken.F
Posts: 2164
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F » Tue Dec 03, 2019 11:40 am

I've been playing around with Matrix and Comskip the past couple of days. I like how it puts red marks over the commercial breaks on the seek-bar when using EDL files. EDL seems to be hit or miss for me. They work for some recordings but not all of them. It seems to help on some of them if I add "always_keep_first_seconds=5" to the comskip.ini file. That makes it so there's at least 5 seconds of video to play at the beginning of the recording before it tries to skip a commercial.

Image

johnny_swindle
Posts: 29
Joined: Tue Mar 24, 2015 11:38 am

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by johnny_swindle » Tue Dec 03, 2019 6:33 pm

Done....
djp952 wrote:
Mon Dec 02, 2019 8:58 pm
Hi everyone, I have an important favor to ask:
.............

djp952
Posts: 991
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Tue Dec 03, 2019 7:56 pm

Thanks guys! Every little bit helps!

I'm pretty much done with the first part of using the new format (parsing it all out), I may be able to have a prototype/alpha type build for people to test by this weekend. I wasn't aware SD had made mention of the XMLTV payload public, but you can also watch this thead in the Development area if you want to see how things are going: viewtopic.php?f=125&t=72813. No show-stoppers yet.

The plan is to kick off the load on startup after device discovery and verification of DVR subscription status, and process it as it comes in as a stream so the EPG would fill in as it goes instead of waiting to retrieve the entire file and then processing it. All the necessary bits and pieces already exist, just have to put them together in a slightly different way for this :)

djp952
Posts: 991
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Wed Dec 04, 2019 2:53 pm

Update on the new EPG stuff; I got it hooked up end-to-end and it's looking great! It's FAST compared to the current method. It's fun to watch too since the data doesn't come in by channel order, so if you have the EPG up you can see Kodi fill it in like a puzzle :)

The new data set is delivered as a full 14-day load, too, so once I get this out there you can crank your Kodi Guide up to 14 days, and there will be little to no reason not to. I have to push 14 days worth of data to it regardless of that setting so you may as well take advantage :) Kodi seems to hold onto the "extra" data as well if you are set under 14 days, which is nice, I hate throwing data away.

Some notes:

- I have to redo the "genre map" completely, I think that may end up hit-and-miss since I only have so many programs to look at in my own data
- I have to figure out what to do about non-DVR subscribers since that data will still need to come from the current method
- This is probably not going to work out at all for Krypton, v2.4.2 is still looking like the end for our old friend. If Krypton can be made to work, I promise to try.

Still thinking I might have something for people to test by the end of the week! I may pause and finish up v2.4.2 and release that in the meantime just to close that out. Having the backend data compression enabled will be nice and help SiliconDust a bit.

starslayer74
Posts: 14
Joined: Thu Jul 06, 2017 2:50 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by starslayer74 » Wed Dec 04, 2019 8:00 pm

Ken.F wrote:
Tue Dec 03, 2019 11:40 am
I've been playing around with Matrix and Comskip the past couple of days. I like how it puts red marks over the commercial breaks on the seek-bar when using EDL files. EDL seems to be hit or miss for me. They work for some recordings but not all of them. It seems to help on some of them if I add "always_keep_first_seconds=5" to the comskip.ini file. That makes it so there's at least 5 seconds of video to play at the beginning of the recording before it tries to skip a commercial.

Image
I would love to play around with this but I don't fully understand where EDL files come from or how you generate them....any tips?

starslayer74
Posts: 14
Joined: Thu Jul 06, 2017 2:50 pm

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by starslayer74 » Wed Dec 04, 2019 8:00 pm

Ken.F wrote:
Tue Dec 03, 2019 11:40 am
I've been playing around with Matrix and Comskip the past couple of days. I like how it puts red marks over the commercial breaks on the seek-bar when using EDL files. EDL seems to be hit or miss for me. They work for some recordings but not all of them. It seems to help on some of them if I add "always_keep_first_seconds=5" to the comskip.ini file. That makes it so there's at least 5 seconds of video to play at the beginning of the recording before it tries to skip a commercial.

Image
I would love to play around with this but I don't fully understand where EDL files come from or how you generate them....any tips?

djp952
Posts: 991
Joined: Wed Oct 01, 2008 8:46 pm
Device ID: 131EB7F7;131ED0E0
Location: Elkridge, MD

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by djp952 » Wed Dec 04, 2019 8:12 pm

starslayer74 wrote:
Wed Dec 04, 2019 8:00 pm
Ken.F wrote:
Tue Dec 03, 2019 11:40 am
I've been playing around with Matrix and Comskip the past couple of days. I like how it puts red marks over the commercial breaks on the seek-bar when using EDL files. EDL seems to be hit or miss for me. They work for some recordings but not all of them. It seems to help on some of them if I add "always_keep_first_seconds=5" to the comskip.ini file. That makes it so there's at least 5 seconds of video to play at the beginning of the recording before it tries to skip a commercial.

Image
I would love to play around with this but I don't fully understand where EDL files come from or how you generate them....any tips?
I'm not a big user myself, but I just used the comskip application from their web site. I believe MCEBuddy is still a thing for generating them as well.

Basically, you run a tool against the .MPG file and it scans it for commercial breaks and spits out an .EDL file, which is really nothing more than a set of start/end timestamps (in seconds) and a flag indicating what to do. Here is a sample:

Code: Select all

172.06	306.82	0
686.57	911.48	0
1386.30	1566.98	0
1952.18	2012.94	0
If you set something up to periodically scan your HDHomeRun RecordedTV share and generate the .EDL files for it, either in the same directory or lump them all into a single directory, the PVR addon can be configured to look for them and report the information back to Kodi. Getting something set up to do that automatically is out of my pervue, I've only done it manually to date to test the functionality in the PVR.

The tricky part with this PVR, at least, is that the HDHomeRun directory on your NAS needs to be accessible to Kodi via a normal share. That way the PVR can go out and get the .EDL files. Normally Recorded TV is just streamed from the RECORD engine over HTTP, no shares required.

Ken.F
Posts: 2164
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA

Re: Unofficial Kodi HDHomeRun DVR PVR Client

Post by Ken.F » Thu Dec 05, 2019 2:51 pm

djp952 wrote:
Wed Dec 04, 2019 8:12 pm
If you set something up to periodically scan your HDHomeRun RecordedTV share and generate the .EDL files for it, either in the same directory or lump them all into a single directory, the PVR addon can be configured to look for them and report the information back to Kodi. Getting something set up to do that automatically is out of my pervue, I've only done it manually to date to test the functionality in the PVR.
I'm using MCEBuddy on my HTPC to scan the HDHomeRun folder over the network and create .edl files. I haven't had any luck getting commercial skipping to work unless the .edl files are all in the same folder. MCEBuddy wants to put the .edl files in the same folder as the recording files so I had to get creative. Since my record engines run on Linux I wrote a script to find and move the .edl files to their own directory, then set up a cron job to run it every few minutes.

Code: Select all

#!/bin/bash

find /drives/Leapfrog/HDHomeRun -maxdepth 2 -iname "*.edl" -type f -exec mv "{}" /drives/Leapfrog/EDL/ \;

Post Reply