Jump to content

NextPVR Live TV doesn't work in browser - closing stream from Next Pvr


Go to solution Solved by eddiepropane,

Recommended Posts

Oopsjoppe
Posted (edited)

Hi,

 

I have been running NextPVR for a couple of years and it's working perfectly. I have been tryign to get this plugin to work but I just can't. Everything is setup good except that Live TV stream doesn't wanna play.

 

This works:

  • Status: OK
  • Update Guide
  • Create recordings
  • Watch recordings
  • See all channels and icons and whats on

When I try to play ny channel this is what the Media browser log looks like:

2014-04-12 15:58:08.3520 Info - App: Client connected from 127.0.0.1:52636
2014-04-12 15:58:08.8824 Info - App: ScheduledTasksWebSocketListener Begin transmitting over websocket to 127.0.0.1:52636
2014-04-12 15:58:09.2256 Warn - StringMapTypeDeserializer: Property 'id' does not exist on type 'MediaBrowser.WebDashboard.Api.GetDashboardResource'
2014-04-12 15:58:09.4284 Info - App: HttpClientManager POST: http://192.168.1.107:8866/public/ManageService/Get/SortedFilteredList?sid=76e1b81467d24051af69e61413ba15f7
2014-04-12 15:58:31.5337 Info - App: Opening channel stream from Next Pvr, external channel Id: 7164
2014-04-12 15:58:31.6117 Info - App: C:\Users\Windows7\AppData\Roaming\MediaBrowser-Server\ffmpeg\20140304\ffmpeg.exe -fflags genpts -async 1 -vsync -1 -re -i "http://192.168.1.107:8866/live?channeloid=7164&client=MB3.1"  -vcodec libvpx -force_key_frames expr:if(isnan(prev_forced_t),gte(t,.1),gte(t,prev_forced_t+5)) -vf "yadif=0:-1:0,scale=min(iw\,1280):-1" -speed 16 -quality good -profile:v 1 -slices 8 -crf 18 -maxrate:v 1372000 -bufsize:v (1372000*2) -b:v 1372000 -vsync vfr -map_metadata -1 -threads 2 -acodec libvorbis -ac 2 -ab 128000 -af "adelay=1,aresample=async=1000" "C:\Users\Windows7\AppData\Roaming\MediaBrowser-Server\transcoding-temp\3d219ca8-3db9-a8a9-3e45-2b1fe0183728.webm"
2014-04-12 15:58:35.6365 Info - App: HttpClientManager GET: http://bot.whatismyipaddress.com/
2014-04-12 15:58:35.9173 Info - App: Closing live stream from Next Pvr, stream Id: 1
2014-04-12 15:58:35.9173 Info - App: FFMpeg exited with code 1 for C:\Users\Windows7\AppData\Roaming\MediaBrowser-Server\transcoding-temp\3d219ca8-3db9-a8a9-3e45-2b1fe0183728.webm
2014-04-12 15:58:41.1433 Info - App: Opening channel stream from Next Pvr, external channel Id: 7164
2014-04-12 15:58:41.1433 Info - App: C:\Users\Windows7\AppData\Roaming\MediaBrowser-Server\ffmpeg\20140304\ffmpeg.exe -fflags genpts -async 1 -vsync -1 -re -i "http://192.168.1.107:8866/live?channeloid=7164&client=MB3.2"  -vcodec libx264 -force_key_frames expr:if(isnan(prev_forced_t),gte(t,.1),gte(t,prev_forced_t+5)) -vf "yadif=0:-1:0,scale=min(iw\,1280):trunc(ow/a/2)*2" -preset ultrafast -crf 23 -maxrate 1372000 -bufsize 2744000 -vsync vfr -map_metadata -1 -threads 0 -acodec aac -strict experimental -ac 2 -ab 128000 -af "adelay=1,aresample=async=1000" -f mp4 -movflags frag_keyframe+empty_moov "C:\Users\Windows7\AppData\Roaming\MediaBrowser-Server\transcoding-temp\01ba665e-b77a-b3db-62d2-abfb15d5db3b.mp4"
2014-04-12 15:58:42.1573 Info - App: Deleting partial stream file(s) C:\Users\Windows7\AppData\Roaming\MediaBrowser-Server\transcoding-temp\3d219ca8-3db9-a8a9-3e45-2b1fe0183728.webm
2014-04-12 15:58:51.7964 Info - App: Killing ffmpeg process for C:\Users\Windows7\AppData\Roaming\MediaBrowser-Server\transcoding-temp\01ba665e-b77a-b3db-62d2-abfb15d5db3b.mp4
2014-04-12 15:58:51.7964 Info - App: Closing live stream from Next Pvr, stream Id: 2
2014-04-12 15:58:51.7964 Info - App: FFMpeg exited with code -1 for C:\Users\Windows7\AppData\Roaming\MediaBrowser-Server\transcoding-temp\01ba665e-b77a-b3db-62d2-abfb15d5db3b.mp4
2014-04-12 15:58:51.7964 Info - App: Deleting partial stream file(s) C:\Users\Windows7\AppData\Roaming\MediaBrowser-Server\transcoding-temp\01ba665e-b77a-b3db-62d2-abfb15d5db3b.mp4

Any ideas on what can be wrong? I will attach the full log also.You can also see the two ffmpeg logfiles created on each try.

 

 

mb3_log.txt

mb3_ffmpeg_log1.txt

mb3_ffmpeg_log2.txt

Edited by Oopsjoppe
emveepee
Posted (edited)

Does live tv work in NextPVR? That is always the best start. Sometimes it is as simple as not setting the live tv buffer folder up.

 

Otherwise post the NextPVR logs too.

 

For streaming that would be

 

NRecord.log and web.log*

 

Martin

Edited by emveepee
Oopsjoppe
Posted

Yes ofcourse :) I have been using NextPVR as backend for my Raspberry PI:s for more than a year. Everything else is working perfect! On any XBMC instance, on any Npvr client, on any smart-device using VLC capture from http://192.168.1.107:8866/live?channel=" . $number; etc etc.

 

Attached is the Npvr logs! Thanks.

nrecord.txt

web_npvr.txt

emveepee
Posted

There is a bit of a problem, your SVT1 channel isn't growing beyond 1MB so there is nothing to stream. Can you send the same logs plus NDigitalHost showing it working in NextPVR and then not working in MB3

 

Martin

Posted

what browser are you testing with?

Oopsjoppe
Posted

I have been testing with Firefox only but since you asked I tried with both IE and Chrome also with the exact same result. IE rendered a new message though: "Video error - There was an error playing the video. Please ensure there is an open tuner availalble."

emveepee
Posted

Do you have recordings from the channel? It might be worth passing a file not live stream to ffmpeg

 

C:\Users\Windows7\AppData\Roaming\MediaBrowser-Server\ffmpeg\20140304\ffmpeg.exe -fflags genpts -async 1 -vsync -1 -re -i "input.ts"  -vcodec libvpx -force_key_frames expr:if(isnan(prev_forced_t),gte(t,.1),gte(t,prev_forced_t+5)) -vf "yadif=0:-1:0,scale=min(iw\,1280):-1" -speed 16 -quality good -profile:v 1 -slices 8 -crf 18 -maxrate:v 1372000 -bufsize:v (1372000*2) -b:v 1372000 -vsync vfr -map_metadata -1 -threads 2 -acodec libvorbis -ac 2 -ab 128000 -af "adelay=1,aresample=async=1000" "output.webm"

 

Martin

Oopsjoppe
Posted

I am not really sure what you wanted me to do. Should I do anything with that code you gave me? or was is just an example?

 

Anyhow, I do have a recording so I attached new logs when I run them. There is no problem at all viewing the recordings!

 

 

web_recording.txt

emveepee
Posted

I was showing the transcoding line used for live tv. Anyway everything points to an ffmpeg problem in MB3 so I can't be much of a help.

 

Martin

Oopsjoppe
Posted

Alright i see! THank you very much for your effort anyways :)

Posted (edited)

I have exactly the same issue

Edited by Vidman
Ronjohnson
Posted

I have the exact same issues as well, except I am using serverwmc. Can play recorded tv, but not live (on any client including Roku, chrome, ie and safari). I can get live tv to work on occasion on Roku, but mostly not at all and only SD channels. It is also very slow to load, while recorded shows are very quick. I am using a wired connection, not wifi.

 

This live TV function is very cool. I really appreciate all the work. Thank you.

Oopsjoppe
Posted

I just though of one thing when Ronjohnson said "only SD".

 

I am using multideck for coded channels in NextPVR, if that could be related. Don't know if that has been tested duing development.

Posted (edited)

I just though of one thing when Ronjohnson said "only SD".

 

I am using multideck for coded channels in NextPVR, if that could be related. Don't know if that has been tested duing development.

 

Seems the problem is related to transcoding or the feature that keeps the stream alive. I see backend starting stream over and over and ffmpeg not starting, sometimes ffmpeg start and I get a few seconds video in the browser but then stream is cut again.

 

oh, and yes, SD channels works fine, but then FFMPEG is barely working, something like 5% cpu.

Edited by KRA
eddiepropane
Posted

Hi all,

 

First of all, thanks for all the effort involved by everyone involved in this project. I have just donated and got a shiny gold badge on my server dashboard now :)

 

I will haved move completely from MediaPortal when the NextPVR plugin is working better (really happy with progress so far :) )with MBS3, well that support for live streaming TV in MBT or another client as there is no point transcoding when I am in the room next to my server which I guess will be coming a bit further down the line.

 

Just wanted to post to say I am having the same issue as above with a similar setup.

 

I use NPVR backend with multidec that works fine for NPVR client or any other client apart from MB3, for me it will work for the odd channel SD or HD but for very few channels.

 

The server previously ran MPExtended and Webmediaportal before I moved to MBS3 so I know that the CPU can handle the transcode fine for HD channels.

 

I'm not an expert but am thinking FFMPEG subtitles, digging about in the transcode logs I can see that on one of my few channels that works, History SD, the logs shows this:

 

  Metadata:
    encoder         : Lavf55.33.101
    Stream #0:0: Video: vp8 (libvpx), yuv420p, 544x576 [sAR 32:17 DAR 16:9], q=-1--1, 1372 kb/s, 1k tbn, 25 tbc
    Stream #0:1: Audio: vorbis (libvorbis), 48000 Hz, stereo, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> libvpx)
  Stream #0:1 -> #0:1 (mp2 -> libvorbis)

 

Whereas the channels that don't work show this (In this case it was BBC One NE&C):

 

    Stream #0:0: Video: vp8, yuv420p, 720x576 [sAR 64:45 DAR 16:9], q=-1--1, 200 kb/s, 90k tbn, 25 tbc
    Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp (clean effects)
    Stream #0:2: Subtitle: none, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> libvpx)
  Stream #0:1 -> #0:1 (mp2 -> libvorbis)
  Stream #0:2 -> #0:2 (? -> ?)

 

Which looks subtitle related?

 

I can see there is no language identified in the subtitle stream so that may create an issue?

 

As a suggestion, even if this bug turns out unrelated, from using various other TV backend/client setups over the years, I think it would be better for the live TV side of the server to not automatically encode the subtitle stream (like MKV's etc where this is needed for forced subs) and all audio streams, instead having an option for subtitle transcoding and preferred audio language (in order, so for me, AC3 if available then Stereo but none of the audio descriptive audio streams).

 

Any foreign language etc would be hardcoded so the subs are not needed under normal circumstances (I understand the option is 100% needed for hearing ipmared viewers) so a check box option for transcoding subtitles for live TV would work, if you are never going to use the subtitles there is no need to use the CPU cycles encoding them, this doubles up with the audio streams within the .ts stream, a preferred audio choice so that FFMPEG is only transcoding the video stream and a single audio stream saving resources.

 

Cheers, Bob.

Posted

Thanks Bob, we're working on it.

krustyreturns
Posted

@@Ronjohnson

 

Please post the serverwmc log (see debug tab) after a live tv stream fails.  But I don't want to derail this thread from nextpvr, so please post a link to it in a new thread.

Oopsjoppe
Posted (edited)

Cheers Bob, I did the exact same analysis when I examined the ffmpeg logs. I also have this parts in mine:
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> libvpx)
  Stream #0:1 -> #0:1 (mp2 -> libvorbis)
  Stream #0:2 -> #0:2 (? -> ?)
Seems like it's looking for subs transcoding but can't find any.

Thanks for all your efforts!

Edited by Oopsjoppe
emveepee
Posted

Yes mine is no longer working and I think it fails because of option -map -0:s There's a whole lot of spew in the server logs too because of errors with DLNA I guess being on the dev stream for the server is a bad idea.

 

Martin

Posted

Todays dev server seems to work fine. 

 

Also CPU use is way down when transcoding.

emveepee
Posted (edited)

Yes it is working for me know too, and transcoding mpeg2 is just 10%SD and 25% 1080i CPU on an i7. For h264 it is lower but still 50% for ffmpeg and the fan is going high speed so I know it's really working hard until the remuxing is implemented.

 

Martin

Edited by emveepee
  • Solution
eddiepropane
Posted

Yep, all working for me now also :)

 

Would have confirmed earlier but my NPVR install screwed up for some unknown reason, I could view the EPG but would hang trying to watch a stream on any client!!

 

Couldn't figure it out so done a reinstall and all sorted.

 

Bob.

  • Like 1
Oopsjoppe
Posted

Yep, works perfectly for me too know - wonderful work. Thank you all.

emveepee
Posted

Would have confirmed earlier but my NPVR install screwed up for some unknown reason, I could view the EPG but would hang trying to watch a stream on any client!!

If you are running the dev MB3 server streaming was broken by MB3 for a couple of days.

 

Martin

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...