kodi-pvr / pvr.hts

Kodi's Tvheadend HTSP client addon
GNU General Public License v2.0
135 stars 93 forks source link

Stutters when playing BBC channels #233

Closed Leatherface75 closed 7 years ago

Leatherface75 commented 8 years ago

I have problems with stutters with BBC streams from IPlayer added in TVheadend. Same streams works as it should with BBC Iplayer WWW addon and VLC. Same streams works if i add url in a .m3u file and opens it in Kodi. But if i open same stream in pvr.hts addon it stutters. Using current git versions.

Here is a few examples: http://vs-hls-uk-live.edgesuite.net/pool_30/live/bbc_one_hd/bbc_one_hd.isml/bbc_one_hd-pa4%3d128000-video%3d5070000.m3u8 http://vs-hls-uk-live.edgesuite.net/pool_1/live/bbc_parliament/bbc_parliament.isml/bbc_parliament-pa3%3d96000-video%3d1604000.norewind.m3u8 http://vs-hls-uk-live.edgesuite.net/pool_34/live/bbc_news_channel_hd/bbc_news_channel_hd.isml/bbc_news_channel_hd-pa4%3d128000-video%3d5070000.m3u8

Leatherface75 commented 8 years ago

I tried same streams with IPTV Simple Client and no problem with playback there. So the problem is with pvr.hts client.

ksooo commented 8 years ago

So the problem is with pvr.hts client.

wrong. the problem is almost 100% with tvheadend.

Jalle19 commented 8 years ago

Does the same thing happen if you play the stream from tvheadend in VLC?

Leatherface75 commented 8 years ago

No it's not tvheadend It works if i add tvheadend url in VLC. It works if i add tvheadend url in m3u file and opens i Kodi. It works if i add tvheadend url in Simple IPTV addon in Kodi. But if i open in pvr.hts it stutters so yes it's a problem with pvr.hts. Same thing happens with some other streams. What i don't understand is what pvr.hts does with the stream that not m3u file or iptv simple client does? I thought everything was using same player.

Jalle19 commented 8 years ago

Can you post a Kodi debug log where you play one of these streams?

FernetMenta commented 8 years ago

truncated logs are worth nothing

Leatherface75 commented 8 years ago

That's the relevant part of the log when playing that stream. But you maybe can tell me what's missing?

FernetMenta commented 8 years ago

The entire log is missing. If you claim to know what is relevant and what is not, you should be able to track down and fix the issue yourself. If this is not the case only post complete logs.

Leatherface75 commented 8 years ago

Jalle19 told me to post where i play one of these streams and i did that. It's not a problem with drivers or anything like that either because it works perfectly with everything else except pvr.hts so it's not a Kodi problem itself. But as you wish i can try to fix another log later.

Jalle19 commented 8 years ago

I meant the complete log too, sorry for the confusion.

Jalle19 commented 8 years ago

Looked through the log briefly and I can't see any glaring issues. Have you tried turning off predictive tuning from the addon settings?

Leatherface75 commented 8 years ago

I tried that now and still same problem. Same problem with dutch NPO channels for other examples so not only BBC channels. And bandwidth shows about half the bitrate than it should.

Jalle19 commented 8 years ago

Can you try disabling trace debugging and predictive tuning in the addon and post a new debug log?

Leatherface75 commented 8 years ago

I see one difference now compared to VLC, Simple IPTV client etc. pvr.hts uses htsp profile and the others pass profile. Maybe htsp protocol does something with the stream that some streams doesn't like?

Jalle19 commented 8 years ago

@FernetMenta there's a lot of this in the logs:

DEBUG: ffmpeg[7FE5DA50E980]: [swscaler] Forcing full internal H chroma due to input having non subsampled chroma

and this:

DEBUG: ffmpeg[7FE50F648700]: [h264] nal_unit_type: 9, nal_ref_idc: 0
DEBUG: ffmpeg[7FE50F648700]: [h264] nal_unit_type: 1, nal_ref_idc: 1
DEBUG: Previous line repeats 3 times.

@perexg I'm assuming that tvheadend doesn't properly parse these streams? AFAIK the streams in this case are HLS.

Jalle19 commented 8 years ago

@Leatherface75 I hate to break it to you but apparently a bug has snuck into Kodi which has caused your tvheadend password to appear in your debug log. I suggest you remove the logs and/or change your password.

FernetMenta commented 8 years ago

@Jalle19 I don't think that ffmpeg swscale logs belong to video playback. I would have looked into the log but I don't download and extract logs.

Jalle19 commented 8 years ago

@FernetMenta I sent you a link on Slack

Leatherface75 commented 8 years ago

Yes it's HLS streams and it seems they works as it should with pass option but not with htsp for some reason. Didn't work to force it to htsp with VLC etc to see if it's same there with htsp. Tried to use pass with pvr.hts but that seems to not work for me.

Leatherface75 commented 8 years ago

@FernetMenta reason i did that was because it was too big to paste on pastebin and that page crashed for me when trying especiallt the first one that was 11MB big..` @Jalle19 removed links

Jalle19 commented 8 years ago

@Leatherface75 there's a HTSP plugin for VLC (https://github.com/BtbN/vlc-htsp-plugin), you could try that and see how it works.

FernetMenta commented 8 years ago

looks like tvh parser does something wrong. this looks like an invalid sequence of nal units:

20:52:55 T:140621782484736   DEBUG: ffmpeg[7FE50F648700]: [h264] nal_unit_type: 9, nal_ref_idc: 0
20:52:55 T:140621782484736   DEBUG: ffmpeg[7FE50F648700]: [h264] nal_unit_type: 1, nal_ref_idc: 1
20:52:55 T:140621782484736   DEBUG: Previous line repeats 3 times.
20:52:55 T:140621782484736   DEBUG: ffmpeg[7FE50F648700]: [h264] nal_unit_type: 7, nal_ref_idc: 1
20:52:55 T:140621782484736   DEBUG: ffmpeg[7FE50F648700]: [h264] nal_unit_type: 8, nal_ref_idc: 1
20:52:55 T:140621782484736   DEBUG: ffmpeg[7FE50F648700]: [h264] nal_unit_type: 9, nal_ref_idc: 0
Leatherface75 commented 8 years ago

This was strange. I compiled that plugin for VLC and i see same problem there when streaming from tvheadend but profile is still pass and not htsp. If i remove htsp plugin for VLC the stream works as it should again. Seems it doesn't need to use htsp profile to have problem just have support for htsp. edit: maybe was something else now it works again and can't get htsp profile to work in VLC.

Jalle19 commented 8 years ago

I think we should wait and see if @perexg can chip in on this. This would not be the first time we've barked up the wrong tree.

Leatherface75 commented 8 years ago

I have played a little more with this and seems to be same problem if i transcode the stream so it seems to be wrong when tvheadend does something with the stream. The strange thing is that htsp doesn't transcode the stream just add some things if i understand right?

Jalle19 commented 7 years ago

Like so many other playback related issues I think this is down to tvheadend not parsing the input stream properly. This means Kodi gets "junk" and playback doesn't work correctly. The fact that the VLC HTSP plugin behaves the same is indicative of this.

I would suggest you transcode the input tvheadend into pure MPEG-TS, the more like a standard-compliant DVB stream you make your input the bigger the chance that tvheadend can parse it properly.

Closing as invalid.

Leatherface75 commented 7 years ago

I am trying to use pass profile in pvr.hts like VLC uses as standard and other PVR addons like IPTVSimple but profiles doesn't seem to work anymore. Only HTSP works with pvr.hts. I know i had it working before so seems to be broken now.

This is what i use to use in tvheadend with pipe livestreamer --ringbuffer-size 128M --hls-live-edge 3 --hls-segment-threads 4 --player-passthrough hls -O "$1" best || ffmpeg -loglevel fatal -i "pipe:0" -vcodec copy -acodec copy -metadata service_provider="$2" -metadata service_name="$3" -f mpegts -tune zerolatency -bsf h264_mp4toannexb,dump_extra pipe:1

As you can see it's already converted to mpegts stream and it works as long the stream is pass. HTSP or any sort of transcoding doesn't work.

Same thing happens if i put stream directly in TVheadend.

If it doesn't parse the stream properly why does it work with pass profile then? Seems it's when it does something with the stream something happens.

ghost commented 6 years ago

I was still having this problem with libreelec on an amlogic s912 box. disabling hardware decoding of h264 has fixed it for me, but increased cpu load a lot