kodi-pvr / pvr.iptvsimple

IPTV Simple client for Kodi PVR
GNU General Public License v2.0
782 stars 372 forks source link

IPTV Stream stopped randomly while VLC plays them without any problem #908

Open tudstudent opened 1 month ago

tudstudent commented 1 month ago

Been busy with this topic now for 2 days and no idea what is going wrong. From my IPTV supplier I have a m3u8 link. Downloaded etc.

If I then start a channel (doesn't matter which one) it is like lottery if it remains working in Kodi. Sometimes it wont start, sometimes it plays 1 hour, sometimes 15sec.

However same link in VLC, no problem at all (it just always runs).

What I found in the logs (only was this part): 2024-10-10 15:25:53.531 T:43400 info : Skipped 5 duplicate messages.. 2024-10-10 15:25:53.531 T:43400 warning : CVideoPlayerVideo::OutputPicture - timeout waiting for buffer 2024-10-10 15:25:54.067 T:43400 info : CDVDVideoCodecFFmpeg::CDropControl: calculated diff time: 39999 2024-10-10 15:26:13.545 T:35176 info : CVideoPlayerAudio::Process - stream stalled 2024-10-10 15:26:13.632 T:34792 info : CVideoPlayer::Process - eof reading from demuxer 2024-10-10 15:26:13.632 T:34792 info : CVideoPlayer::OnExit() 2024-10-10 15:26:13.632 T:34792 info : VideoPlayer: eof, waiting for queues to empty 2024-10-10 15:26:13.632 T:34792 info : Closing stream player 1 2024-10-10 15:26:13.632 T:34792 info : CDVDMessageQueue(audio)::WaitUntilEmpty 2024-10-10 15:26:13.633 T:34792 info : Waiting for audio thread to exit 2024-10-10 15:26:13.633 T:35176 info : thread end: CVideoPlayerAudio::OnExit() 2024-10-10 15:26:13.633 T:34792 info : Closing audio device 2024-10-10 15:26:13.635 T:34792 info : Deleting audio codec 2024-10-10 15:26:13.636 T:34792 info : Closing stream player 2 2024-10-10 15:26:13.636 T:34792 info : CDVDMessageQueue(video)::WaitUntilEmpty 2024-10-10 15:26:13.668 T:34792 info : waiting for video thread to exit 2024-10-10 15:26:13.668 T:43400 info : thread end: video_thread 2024-10-10 15:26:13.668 T:34792 info : deleting video codec 2024-10-10 15:26:13.670 T:34792 info : Closing stream player 4 2024-10-10 15:26:13.670 T:34792 info : waiting for teletext data thread to exit 2024-10-10 15:26:13.670 T:35476 info : thread end: data_thread 2024-10-10 15:26:13.674 T:14984 info : Deleting settings information for files pvr://channels/tv/%7cEU%7c%20NEDERLAND%204K%20ULTRA@2/2@pvr.iptvsimple_925827646.pvr 2024-10-10 15:26:13.693 T:28448 info : CVideoPlayer::CloseFile() 2024-10-10 15:26:13.694 T:28448 info : DXVA::CDecoder::Close: closing decoder. 2024-10-10 15:26:13.694 T:28448 info : DXVA: closing decoder context. 2024-10-10 15:26:13.717 T:28448 info : VideoPlayer: waiting for threads to exit 2024-10-10 15:26:13.717 T:28448 info : VideoPlayer: finished waiting 2024-10-10 15:26:13.717 T:28448 info : CVideoPlayer::CloseFile() 2024-10-10 15:26:13.717 T:28448 info : VideoPlayer: waiting for threads to exit 2024-10-10 15:26:13.717 T:28448 info : VideoPlayer: finished waiting 2024-10-10 15:28:17.483 T:2640 info : CActiveAESink::OpenSink - initialize sink

I tried setting user agent VLC (however without it also works (more or less). m3u8 HLS setting (not applicable so noting works) ffmpeg disabled, no result. inputstream.adaptive in advanced field. Also no result.

As I see this issue on Windows, Linux OSMC and Android I am posting it here as it might be something deeper (or hopefully somewhere a setting that I have missed).

phunkyfish commented 1 month ago

Please post a full debug log using a paste site.

phunkyfish commented 1 month ago

Please add a full debug log for both plain kodi and using inputstream.adaptive.

tudstudent commented 1 month ago

I will make them tomorrow. For the record (in the GUI configured):

auto refresh is disabled streaming ffmpeg on inputstream adaptive for hls off

user agent: empty inputstream name: inputstream.adaptive

Any specific option to be set before making the log (tomorrow)?

phunkyfish commented 1 month ago

You should use adaptive for HLS on and leave the inputstream name blank.

tudstudent commented 1 month ago

Well I have done my best, as M3U8 is super large I have removed all that info. Then uploaded to the kodi log site: Kodi Log

Hope this works and has all info you need. The 2 tests are both in this logfile, furthermore I noticed some streams are mkv and some mp4. If the source is needed (kodi.log source) I can share to the developer 1-on-1 as I do not see value to share that to the world.

tudstudent commented 1 month ago

Is there an update/did you check?

phunkyfish commented 1 month ago

Your getting an eof, which means the stream data has stopped.

have you tried setting the user agent to vlc?

tudstudent commented 1 month ago

I will try (again) this evening. Also in parallel I will test to start the same stream with VLC (just to be sure it does not fail).

Is it possible VLC buffers more and reconnects (in this vacuum) that will not be noticed by users?

phunkyfish commented 1 month ago

Yes, it’s very possible, reconnection logic will be very different in vlc and kodi. With VLCs being far more robust I’d imagine.

tudstudent commented 1 month ago

2 questions:

  1. Are you interested in VLC log of the same stream?
  2. Is the reconnection/buffer logic part of IPTV Simple or is it part of the Kodi Core (in first case I can image it could be "patched" and second will be more complex never happen)?
phunkyfish commented 4 weeks ago
  1. No, that won’t really help.
  2. All that can be done in the addon has been done. Kodi doesn’t really have reconnection logic, it relies on reliable streams.

Have you tried playback with ffmpegdirect instead of adaptive?

goldengate2121 commented 3 weeks ago

I ran into a similar issue. I literally didn't change anything. Didn't do any updates. I started getting 429 errors and can't determine codec to use. Using Kodi 22 and SIPTV 22.2.2. The link works in VLC. I tried upgrading to the latest SIPTV 23 but still didn't solve the problem. I tried many different user agents (VLC, Chrome). I recompiled Kod and this didn't fix it. I keep a copy of my good .kodi and I tried this still same error. I thought it was a change in the URL but my other microSD has Kodi 21 with SIPTV ver 21.8.2 and it works. Don't know how it could break without doing anything.

phunkyfish commented 3 weeks ago

This is not the same error. Too many requests is very different to a stream stalling.

goldengate2121 commented 1 week ago

I was using system-ffmpeg. I re-emerged my Gentoo install to not use system-ffmpeg and now it works.

goldengate2121 commented 4 days ago

Out of the blue now I am getting eof and CVideoPlayerAudio::Process - stream stalled. I installed Jelllyfin to test and I don't get the eof issues after 30 seconds which takes me back to the EPG. I didn't upgrade anything or make any changes. I don't know why this is happening out of nowhere. I tried forcing ffmpegdirect in the m3u file but it didn't fix anything. Running Gentoo on a Rpi5. I also tried on my Arch install that I hadn't used in a month and the same issue.