Jump to content

Direct play of Nextpvr live tv


crazybbs

Recommended Posts

Sounds more than fair enough :)

 

May I also ask  - it should be doable (nothing insurmountable) ?

 

Admittedly I would use it for OTA NZTV, which can be somewhat underwhelming on occasion, but would be nice....

Link to post
Share on other sites
  • 3 weeks later...
  • 2 weeks later...

@@sytone

 

This is the input from the PM

 

Here is the code to probe  a live tv stream.

All credits go to t.andre!

 

In your LiveTvService.cs or Plugin.cs constructor add IMediaEncoder _mediaEncoder.

probeUrl: is the stream url.

Source : for dvbLink is LiveTV or Recording, I use the same code to probe the two options. It’s just for logging.

 

private async Task ProbeStream(MediaSourceInfo mediaSourceInfo, string probeUrl, string source, CancellationToken cancellationToken)

        {

            Plugin.Logger.Info("Probe stream for {0}", source);

            MediaInfoRequest req = new MediaInfoRequest

            {

                MediaType = Model.Dlna.DlnaProfileType.Video,

                InputPath = probeUrl,

                Protocol = MediaProtocol.Http,

                ExtractChapters = false,

                VideoType = VideoType.VideoFile,

            };

 

            var originalRuntime = mediaSourceInfo.RunTimeTicks;

            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();

            MediaInfo info = await _mediaEncoder.GetMediaInfo(req, cancellationToken).ConfigureAwait(false);

            stopWatch.Stop();

            TimeSpan ts = stopWatch.Elapsed;

            string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);

            Plugin.Logger.Info("Probe RunTime " + elapsedTime);

 

            if (info != null)

            {

                mediaSourceInfo.Bitrate = info.Bitrate;

                mediaSourceInfo.Container = info.Container;

                mediaSourceInfo.Formats = info.Formats;

                mediaSourceInfo.MediaStreams = info.MediaStreams;

                mediaSourceInfo.RunTimeTicks = info.RunTimeTicks;

                mediaSourceInfo.Size = info.Size;

                mediaSourceInfo.Timestamp = info.Timestamp;

                mediaSourceInfo.Video3DFormat = info.Video3DFormat;

                mediaSourceInfo.VideoType = info.VideoType;

                mediaSourceInfo.RequiresClosing = true;

                mediaSourceInfo.RequiresOpening = true;

                mediaSourceInfo.SupportsDirectPlay = true;

                mediaSourceInfo.SupportsDirectStream = true;

                mediaSourceInfo.SupportsTranscoding = true;

 

 

                mediaSourceInfo.DefaultSubtitleStreamIndex = null;

 

                if (!originalRuntime.HasValue)

                {

                    mediaSourceInfo.RunTimeTicks = null;

                }

                var audioStream = mediaSourceInfo.MediaStreams.FirstOrDefault(i => i.Type == Model.Entities.MediaStreamType.Audio);

 

                if (audioStream == null || audioStream.Index == -1)

                {

                    mediaSourceInfo.DefaultAudioStreamIndex = null;

                }

                else

                {

                    mediaSourceInfo.DefaultAudioStreamIndex = audioStream.Index;

                }

            }

            else

            {

                Plugin.Logger.Error("Cannot probe {0} stream", source);

            }

        }

 

 

This is how it would look in the MediaPortal plugin:

https://github.com/p...45376a5884a55de

Link to post
Share on other sites
  • 4 months later...

Was any progress made with this?  Recently moved from wmc/windows 7 to nextpvr/windows 10. Getting the same incredibly long delay before emby live tv plays (web version).  Emby Theater not playing at all.

Link to post
Share on other sites
  • 2 weeks later...

Was any progress made with this?  Recently moved from wmc/windows 7 to nextpvr/windows 10. Getting the same incredibly long delay before emby live tv plays (web version).  Emby Theater not playing at all.

Re-installed Nextpvr 3.7.7, Emby Theater now working, which is a bonus, but is still transcoding.  Even (in my limited understanding) tried making the live tv buffer a network share.  Fingers crossed something gets worked out.

Link to post
Share on other sites
arrbee99

Re-installed Nextpvr 3.7.7, Emby Theater now working, which is a bonus, but is still transcoding.  Even (in my limited understanding) tried making the live tv buffer a network share.  Fingers crossed something gets worked out.

Just wondering if I could ask if you did anything in particular to get NPVR working in Theater  - also tried re-installing 3.7.7 after a 4 month gap and its the same as before for me, works in Chrome, but in Theater just get a spinning circle.

Link to post
Share on other sites

Just wondering if I could ask if you did anything in particular to get NPVR working in Theater  - also tried re-installing 3.7.7 after a 4 month gap and its the same as before for me, works in Chrome, but in Theater just get a spinning circle.

No. It would appear to have been random luck.  Hasn't worked since.  Web version is still pretty sluggish.

Link to post
Share on other sites
arrbee99

Oh well, that's a pity. Mediaportal worked OK for me but I was, and still am, hoping that NPVR will work at some point. Maybe I'll ask on the NPVR forum.

Link to post
Share on other sites
arrbee99

Asked at NPVR forum http://forums.nextpvr.com/showthread.php?58532-Emby-Theater butthis seems to be the best place. Still not working in ET but I see it plays TV in 7llusions Windows app, though trancsoding...

 

57b9136830894_EmbyTVinWindowsapp.jpg

 

Though I could try changing ET's video playback settings, but if I change them they don't stick - they revert to Auto.

 

Any logs required / ideas ?

Link to post
Share on other sites

Asked at NPVR forum http://forums.nextpvr.com/showthread.php?58532-Emby-Theater butthis seems to be the best place. Still not working in ET but I see it plays TV in 7llusions Windows app, though trancsoding...

 

57b9136830894_EmbyTVinWindowsapp.jpg

 

Though I could try changing ET's video playback settings, but if I change them they don't stick - they revert to Auto.

 

Any logs required / ideas ?

 

 

Does it play in windows media player via file -> open url? Just to give you a point of comparison, the hd homerun url works.

Link to post
Share on other sites
arrbee99

Sorry have no idea what to type in where it asks for the url in wmp. Could you please explain what it would typically look like or where I would find it.

Link to post
Share on other sites

Then I would ask next pvr to get their url working with windows media player. not only will it fix it for emby theater but it will make playback much easier with any other player on windows. We built a video player based on directshow because that's what the community wanted. On Windows it is the best option, but it also means we inherit many of the same limitations of Windows Media Player, which we can easily fix with transcoding, but I know you guys don't want that.

Link to post
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...