Jump to content

NextPVR Dumb Tuner


Carlo

Recommended Posts

This is just a few of the currently recording OTA Broadcasts from one 4 tuner Quatro:
Currently there are 14 shows recording but only 12 are shown here (1080 laptop) :(
5bb78ff39683a_dumb1.png
 
Next PVR status doesn't allow the dialog to be resized so I had to grab screen shots in two passes. The box on the right is scrolled down view continuing the first box.  You can see 14 streams used on one tuner.
 
5bb7906d12db4_dumb2.png

Here is what the one tuner looks like in the HDHomeRun web view:

So all 4 tuners are being used to record 14 shows thanks to "multi-rec".

5bb790e6f0b3f_dumb3.png

 

This doesn't use a middle piece, plugin or proxy and is just Emby and NextPVR. Yep not using NextPVR plugin.

All EPG, recording and control is all Emby like any other tuner!!!

This allows watching live streams or recordings in progress just like normal Emby tuners.

 

Essentially this is NextPVR acting as a "dumb tuner" for Emby and it's easy. :)

Edited by cayars
  • Like 2
Link to comment
Share on other sites

Nope, uninstalled. :)

This is I believe exactly what you were talking about with a "dumb tuner" option.

I set this up via "tuners",

Then loaded an XML EPG guide in Emby and it mapped the channels.

 

The EPG is from Emby and not a plug in (not loaded) so no goofy ID issues.

All recording is solely controlled by Emby thus no quirks I've found.

 

Of course since this is all Emby, the recordings show up in my Recording Library just like they would if they were recorded with an HDHomeRun.

 

This is what you were thinking when you wanted to use it as a "dumb tuner" correct?

 

Carlo

Edited by cayars
Link to comment
Share on other sites

MikePlanet

sounds interesting! So you use nextpvr as tuners only and let emby do all the rest?!

Can you give some details about how you installed/configured it?

Link to comment
Share on other sites

It's actually quite easy Mike & Luke.  This could be added very easily @@Luke as a default tuner type taking care of the one manual step I had to make.
 
Next PVR has a URL you can call that will return an M3U list.
http://NextPvrIP:8866/channels
 
There is one flaw with this which I'll cover in a minute.
 
So for me on my system I can setup an M3U tuner and input http://192.168.100.11:8866/channels
and Emby will import the channel list just like any other IPTV source.
 
I can then view or record any SINGLE channel perfectly.  That's the problem.  The default channel list will only work for one channel at a time. As soon as you record a second channel or another Emby client tries to use the tuner it will stop the first and start the second.
 
When you call the /channels url above it returns a series of entries that look like this:

(sorry, the forum is truncating the URL)
 

How to fix this. NextPVR has a "client" option you can set as part of the URL request.  If the client ID is the same it will always "change channels" when a new request comes in.  HOWEVER if you make sure every channel has it's own unique ID then NextPVR thinks it's a different ID and opens a new stream as we want.  So what I did was just use the channel number as the unique ID as follows:

 

#EXTM3U
#EXTINF:0, 3.1 - KYW-TV
http://192.168.100.11:8866/live?channel=3.1&client=3.1
#EXTINF:0, 3.2 - Start
http://192.168.100.11:8866/live?channel=3.2&client=3.2
 
In testing I just opened a browser put in the URL and then saved the M3U file, edited it to add the "client" and then used this file for the M3U tuner and it gave the results in the OP post.
 
So if Luke were to add this "Next PVR Tuner" directly in Emby all that has to be done is modify the URL during import to add the unique ID parameter similar to what I just did.
 
As you can tell at this point, to Emby it's just an IPTV source and everything about Emby works the same.  I've been playing with this for a bit and haven't found any issues.  When I abort Emby recordings Next PVR frees the stream up as expected.

 
What I haven't tested yet is trying to use the same URL from two different Emby installs on the same channel. We may need/want to change the Client setting to servername-channel to make it more unique OR it may be best as is.  Needs testing to see the best way to share channels but this will only affect a minute amount of the base who would use this.

Edited by cayars
Link to comment
Share on other sites

We could transform the next pvr plugin to just do this instead of what it is currently doing.

  • Like 1
Link to comment
Share on other sites

No need for a plugin at all.  It's just IPTV as far as Emby is concerned.

The only thing needed is during import of the m3U list to add the client string to the end of the URL OR just append the client string when ever it's being used.

 

I'd do it during import as I think it's cleaner and doesn't change any code down the line.

But this should be a very trivial change to add this "dumb tuner" functionality.

 

So IMHO just add a new tuner type called Next PVR and ask for the URL with the hint for format like: http://NextPvrIP:8866/channels

then when pulling in the M3U list add the client string to each URL and you're done.

 

The user then does everything as normal including setting up EPG, etc.

 

I'd leave the Plug In as is for now since people will be using it to retrieve recordings already stored with Next PVR data and what not.  This way they could migrate at their own leisure.

Edited by cayars
Link to comment
Share on other sites

Well I'd disagree for a couple of reasons.

As far as Emby is concerned it will treat the operation as any other IPTV source which is all core.

 

You already have 4 tuner types built in (Hauppauge, HDHomeRun, M3UTuner, Other) and these are part of the core.  This would just add a 5th type of "Next PVR".  The Next PVR is just an encapsulated version of the M3UTuner and works exactly as the import for it, except for adding the client id string to the end of the URL during the import of each entry which is cake.

 

Way, way less code involved this way.  As I already have shown, if you save the results of the URL call to Next PVR to a file and modify each line yourself it works perfectly fine in Emby as IPTV so no plugin required or needed.  So to me a plug in just complicates the setup and there are two places needed for the setup.  They would need to use the plugin to import the URL list, then go to a different section of the admin to setup the EPG. That to me just complicates the process.

 

This of course is just my opinion and you can implement it any way you want.  But what happens if you modify the plug in and there is an issue or users prefer the old functionality of the Next PVR plugin?  They would no longer have a choice of methods to use.

Link to comment
Share on other sites

Realistically we don't really have the bandwidth to accommodate two different ways, so we need to just pick one or the other, and I think this is the best way forward.

Link to comment
Share on other sites

On a separate note from how to implement this in Emby itself.

If anyone wants to try this in order to exploit the ability to have multi-rec (recording main plus sub channels using one tuner) you need to be careful where you scan your channels in Next PVR.

 

In NextPVR's setup.  On NextPVR's Settings->Devices screen, you need to have setup the channels using the ATSC or QAM device types, not the HDHR device type.

 

The HDHR type will use virtual channels and only supports one tuner per channel but the ATSC/QAM type uses BDA and DOES support multi-rec.

If you get an error when you try to scan channels for ATSC then that usually means you don't have BDA drivers available (ie windows server) so they need to be loaded.  If you get stuck with this, post and I'll dig up and post drivers.

Link to comment
Share on other sites

Realistically we don't really have the bandwidth to accommodate two different ways, so we need to just pick one or the other, and I think this is the best way forward.

So why not implement it as a core feature and let the plugin "die" so people can migrate  That should work for everyone.

Then you don't need to support the plugin anymore. :)

Link to comment
Share on other sites

Yep same idea.  Dang, wish I would have seen that thread before I started trying to figure out a way to do this.  Glad I came to the same conclusion however.

I just read all 20 posts and don't see any issues with the current DVR in Emby.

 

I really don't see a down side.  As far as not knowing the "true" tuner count, you never know this unless you assume all tuners are always under Emby control which of course is never the case anyway as a user could use HDHomeRun software, Live Channels, Plex or any other app that grabs a tuner including a user in Emby watching live tv.

 

Scheduling and conflict resolution will always have to take such things into consideration.  Scheduling routines in the future can be smarter and start recordings in order or priority based on things such as alternate airings and whatnot.  Same as any other DVR that uses network tuners and can't guarantee exclusive access.

 

Did I miss something?

Carlo

 

PS thanks for the link to that thread!

Link to comment
Share on other sites

pir8radio

Yep same idea.  Dang, wish I would have seen that thread before I started trying to figure out a way to do this.  Glad I came to the same conclusion however.

I just read all 20 posts and don't see any issues with the current DVR in Emby.

 

I really don't see a down side.  As far as not knowing the "true" tuner count, you never know this unless you assume all tuners are always under Emby control which of course is never the case anyway as a user could use HDHomeRun software, Live Channels, Plex or any other app that grabs a tuner including a user in Emby watching live tv.

 

Scheduling and conflict resolution will always have to take such things into consideration.  Scheduling routines in the future can be smarter and start recordings in order or priority based on things such as alternate airings and whatnot.  Same as any other DVR that uses network tuners and can't guarantee exclusive access.

 

Did I miss something?

Carlo

 

PS thanks for the link to that thread!

 

I don't recall all of the issues,  @@sub3 is on the team that develops NextPVR I believe, maybe he will have better input than I.

Link to comment
Share on other sites

arrbee99

What about that thing pir8radio said in post #11 of the other thread about it not working for dvb users. If thats still true and you're presumably talking about dvb-s/dvb-t thats how (more or less) the whole of our little country gets TV, and I should imagine quite a lot of the planet as well.

 

Also, you need to use an xml guide, which seems a waste as NPVR gets the OTA guide for me just fine, and I have no idea how to get an xml guide, except for pasting a link to one that someone else has done, which I have done, but so far non of them provide any artwork, which NPVR does.

 

And Luke's thing about bandwidth, I presume that means extra stuff to maintain. If any of this happens, there definitely needs to be at least an overlap, and preferably just maintaining it as before shouldn't be to difficult if its true that this new thing is so much easier/requires so much less troubleshooting.

Link to comment
Share on other sites

What about that thing pir8radio said in post #11 of the other thread about it not working for dvb users. If thats still true and you're presumably talking about dvb-s/dvb-t thats how (more or less) the whole of our little country gets TV, and I should imagine quite a lot of the planet as well.

I just re-read it.  Is that inferring this doesn't work with DVB?  Is that saying Next PVR works with DVB but this command doesn't or something? 

What's the issue with DVB?

 

I understand we would not know the amount of "tuners" available but that's a given.  We don't know that now.

 

Also, you need to use an xml guide, which seems a waste as NPVR gets the OTA guide for me just fine, and I have no idea how to get an xml guide, except for pasting a link to one that someone else has done, which I have done, but so far non of them provide any artwork, which NPVR does.

That's part of the point of this. Using the NextPRV EPG data is very problematic. Every reload of the data gets new IDs in NextPVR so if you don't immediately follow the NextPVR update with an Emby plugin update you get IDs out of wack and no live or recording ability since the ID doesn't exist.

 

So this to me is a major benefit and not a negative. I don't see why the same source you use in Next PVR wouldn't be usable in Emby as well if it's just an XML source file.

 

And Luke's thing about bandwidth, I presume that means extra stuff to maintain. If any of this happens, there definitely needs to be at least an overlap, and preferably just maintaining it as before shouldn't be to difficult if its true that this new thing is so much easier/requires so much less troubleshooting.

There would literally be nothing to maintain. The basic change is take the IPTV import routine and use as is with the exception of adding client=value to it which is one added routine.  This is nothing in coding terms to worry about bandwidth wise and certainly far less bandwidth then keeping a plugin updated.  But this would be a Luke decision of course.

Edited by cayars
Link to comment
Share on other sites

arrbee99

I just re-read it.  Is that inferring this doesn't work with DVB?  Is that saying Next PVR works with DVB but this command doesn't or something? 

What's the issue with DVB?

 

I understand we would not know the amount of "tuners" available but that's a given.  We don't know that now.

 

That's part of the point of this. Using the NextPRV EPG data is very problematic. Every reload of the data gets new IDs in NextPVR so if you don't immediately follow the NextPVR update with an Emby plugin update you get IDs out of wack and no live or recording ability since the ID doesn't exist.

 

So this to me is a major benefit and not a negative. I don't see why the same source you use in Next PVR wouldn't be usable in Emby as well if it's just an XML source file.

 

There would literally be nothing to maintain. The basic change is take the IPTV import routine and use as is with the exception of adding client=value to it which is one added routine.  This is nothing in coding terms to worry about bandwidth wise and certainly far less bandwidth then keeping a plugin updated.  But this would be a Luke decision of course.

 

It seems to infer it wouldn't work with DVB. Whether that true or not, no idea, just saying if it doesn't, what then.

 

Personally don't see any problem with NPVR's guide, you just schedule a guide refresh in Emby after a NPVR guide update. As NVPR, as far a I'm aware, gets the guide OTA for me via DVB-S I assume its not a xml anything. I have used xml versions though I don't get artwork anywhere, and I like my eye candy.

 

Am sure as it would require zero maintenance Luke wouldn't have any problem keeping the plugin going 'for a significant period'  ;)

 

So anyway, if it does work with dvb-something, and there's a decent guide for New Zealand (and I guess Azerbaijan, etc) then sounds terrific.

Link to comment
Share on other sites

It seems to infer it wouldn't work with DVB. Whether that true or not, no idea, just saying if it doesn't, what then.

We need someone who has Next PVR setup using DVB to test it.  hint, hint :)

 

Personally don't see any problem with NPVR's guide, you just schedule a guide refresh in Emby after a NPVR guide update. As NVPR, as far a I'm aware, gets the guide OTA for me via DVB-S I assume its not a xml anything. I have used xml versions though I don't get artwork anywhere, and I like my eye candy.

If you get the refresh of Emby to follow Next PVR and don't have anything to record during that time frame you're fine.  If you're like me I have stuff recording around the clock so it could mess me up on occasion.

 

You bring up a good point and one reason why this should be separate from the plugin.  NextPVR can pull EPG data right from the tuner itself as it's part of a standard.  We can do this in the US as well.  Unless Emby was to add this natively then users who use this now would need to stay with the plugin or have to source an XML source (if possible).

Am sure as it would require zero maintenance Luke wouldn't have any problem keeping the plugin going 'for a significant period'  ;)

 

So anyway, if it does work with dvb-something, and there's a decent guide for New Zealand (and I guess Azerbaijan, etc) then sounds terrific.

I'm actually not worried about this.  Luke will figure out the best way to implement it that works for Emby.  IMHO it would be best to have both methods so no one gets burnt or forced to switch assuming this would work for DVB which we need to test.

 

Obviously this is a work in progress at this point in time and anyone can do this now with the instructions given in the thread.  So if a few people were to test this method we could learn what pitfalls exist like what you just mentioned about EPG from the tuner itself.

 

I've been playing with this on my Emby test server a bit today.  I'm now trying to bring one of my Prime units into the mix to play with the combining channels that are in common between the OTA and cable for maximum flexibility.  Still trying to figure this out.  Once I've got this setup and tested in Next PVR I'll be trying it on my main Emby server and record a ton of stuff to see if anything breaks.  :)

Link to comment
Share on other sites

arrbee99

Yes I could probably give it a go, though be warned, something that starts off with 'Its actually quite easy' is probably going to lead to a deluge of 'don't get this bit', 'what does that mean', 'mine doesn't look the same', etc, etc.

 

So, to start off...

 

- that network recorder thing MikePlanet linked to is irrelevant ?

 

- I don't have to redo channels and stuff in NPVR, I 'just' access them differently ?

 

- the client stuff you talk about doesn't have anything to do with client settings in NVPR...

 

5bb7ce731c17d_EmbyNPVRclient1.jpg

 

5bb7ce8c9848d_EmbyNPVRclient2.jpg

 

ps I imagine the plugin could be reduced to being a guide provider for those who need it / want it...

Link to comment
Share on other sites

Let's do this in steps to make it easy:

Open a web browser and enter http://NextPvrIP:8866/channels

Obviously substitute your ip address above.

 

Hopefully your browser will allow you to save this as a text file.  If not and you have VLC open that. Go to MEDIA menu and open a network stream menu option and use the URL.

VLC will probably open the first stream and start playing a channel.  That's fine.

Click the VIEW menu option and select PLAYLIST.

You should now get a full playlist.

You can now click MEDIA menu then SAVE PLAYLIST TO FILE

 

You now have this file saved to disk.

Open it in a text editor such as NotePad + and you'll see lines similar to:

You'll see some lines like:

#EXTINF:0, 6.1 - WPVI-HD
#EXTVLCOPT:network-caching=1000
#EXTINF:0, 6.2 - LiveWel
#EXTVLCOPT:network-caching=1000
#EXTINF:0, 6.3 - LAFF-TV
#EXTVLCOPT:network-caching=1000
 
You want to modify each of the http lines and add the client to it such that it ends/looks like this:
#EXTINF:0, 6.1 - WPVI-HD
#EXTVLCOPT:network-caching=1000
#EXTINF:0, 6.2 - LiveWel
#EXTVLCOPT:network-caching=1000
#EXTINF:0, 6.3 - LAFF-TV
#EXTVLCOPT:network-caching=1000
 
Just use the channel number as the client number and this should work just fine.
 
That's the manual part of the process.  Post back when you have this done as it's then just a matter of setting this file up as an IPTV tuner in Emby just as you would any other IPTV source (and adding an EPG).
 
BTW, for just testing to see if this works for DVB you don't need to edit the whole playlist.  You can truncate it down to 5 channel or so to save editing. :)
5 channel is plenty to make sure it works.  You can always go back and edit the full file later.
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...