kodi-pvr / pvr.iptvsimple

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

[Catchup] Cannot rewind or pause catchup, buffering #832

Closed pgranat closed 7 months ago

pgranat commented 7 months ago

EDIT: Turning on inputstream adaptive for HLS resolved issue. Stream rewinds correctly

From my provider I have catchup in form of:

my-url.com:8080/timeshift/user/pass/{M}/{Y}-{m}-{d}:{H}-{M}-{S}/111746.m3u8

(I figured it out from tcpdump using another app, not received in original m3u)

  1. Watching from EPG option irrelevant - same behavior
  2. Stream starts correctly
  3. After pausing it plays for some short time and then endless buffering with Error demux packet doesn't belong to a valid stream
  4. After trying to rewind: Error demux packet doesn't belong to a valid stream, stream cannot be unpaused, nothing can be done except stopping
  5. After doing nothing stream is playing for some time, then EOF and going back to EPG (last log excerpt)

Maybe someting more, other should be added to catchup in m3u, will be thankful for any tips

2024-02-04 19:34:09.007 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: DemuxSeekTime - Seek successful. m_seekOffset = 151000000.000000, m_currentPts = 39042667.000002, time = 150557.191944, backwards = 1, startpts = 18442240474082181120.000000
2024-02-04 19:34:09.008 T:21272    info <general>: AddOnLog: inputstream.ffmpegdirect: OpenWithFFmpeg - IO handled by FFmpeg's AVFormat
2024-02-04 19:34:09.009 T:21272   debug <general>: easy_acquire - Created session to http://my.url.com
2024-02-04 19:34:11.980 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: Open - avformat_find_stream_info starting
2024-02-04 19:34:12.172 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: Open - av_find_stream_info finished
2024-02-04 19:34:12.173 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: CDVDDemuxFFmpeg::AddStream ID: 0
2024-02-04 19:34:12.173 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: CDVDDemuxFFmpeg::AddStream ID: 1
2024-02-04 19:34:12.173 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: CDVDDemuxFFmpeg::AddStream ID: 2
2024-02-04 19:34:12.173 T:21272   debug <general>: demuxer seek to: 150557.191944, success
2024-02-04 19:34:12.174 T:21272   debug <general>: CVideoPlayer::FlushBuffers - flushing buffers
2024-02-04 19:34:12.175 T:21273   debug <general>: CDVDAudio::Flush - flush audio stream
2024-02-04 19:34:12.175 T:21273   debug <general>: CDVDAudio::Pause - pausing audio stream
2024-02-04 19:34:12.211 T:21278   debug <general>: CDVDVideoCodecDRMPRIME::Reset - flush buffers
2024-02-04 19:34:12.218 T:21278   debug <general>: CVideoPlayerVideo - CDVDMsg::GENERAL_SYNCHRONIZE
2024-02-04 19:34:12.218 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: GetTimes - startTime = 1707067800        ptsStart = 0    ptsBegin = 0    ptsEnd = 3300000000
2024-02-04 19:34:12.218 T:21273   debug <general>: CVideoPlayerAudio - CDVDMsg::GENERAL_SYNCHRONIZE
2024-02-04 19:34:12.219 T:21272    info <general>: AddOnLog: inputstream.ffmpegdirect: DemuxSetSpeed - DemuxSetSpeed 1000
2024-02-04 19:34:12.220 T:21278   debug <general>: CVideoPlayerVideo - Stillframe left, switching to normal playback
2024-02-04 19:34:12.229 T:21273    info <general>: ProcessDecoderOutput: Changed max allowed Out-Of-Sync value to 42 ms due self-learning
2024-02-04 19:34:12.234 T:21272   debug <general>: CVideoPlayer::HandleMessages - player started 1
2024-02-04 19:34:12.234 T:20761   debug <general>: OnAVChange: CApplication::OnAVChange
2024-02-04 19:34:12.351 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: CDVDDemuxFFmpeg::ParsePacket() fetching extradata, extradata_size(53)
2024-02-04 19:34:12.352 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: CDVDDemuxFFmpeg::AddStream ID: 0
2024-02-04 19:34:12.352 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: CDVDDemuxFFmpeg::AddStream ID: 1
2024-02-04 19:34:12.352 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: CDVDDemuxFFmpeg::AddStream ID: 2
2024-02-04 19:34:12.352 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: GetStreamIds()
2024-02-04 19:34:12.353 T:21272    info <general>: Skipped 1 duplicate messages..
2024-02-04 19:34:12.353 T:21272    info <general>: Closing stream player 2
2024-02-04 19:34:12.353 T:21272   debug <general>: CVideoPlayer::SetCaching - caching state 0
2024-02-04 19:34:12.353 T:21272   debug <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2024-02-04 19:34:12.353 T:21273   debug <general>: CDVDAudio::Pause - pausing audio stream
2024-02-04 19:34:12.354 T:21272    info <general>: waiting for video thread to exit
2024-02-04 19:34:12.354 T:21278    info <general>: thread end: video_thread
2024-02-04 19:34:12.355 T:21278   debug <general>: Thread VideoPlayerVideo 2575393024 terminating
2024-02-04 19:34:12.358 T:21272    info <general>: deleting video codec
2024-02-04 19:34:12.367 T:21272    info <general>: Closing stream player 1
2024-02-04 19:34:12.367 T:21272    info <general>: Waiting for audio thread to exit
2024-02-04 19:34:12.367 T:21273    info <general>: thread end: CVideoPlayerAudio::OnExit()
2024-02-04 19:34:12.367 T:21273   debug <general>: Thread VideoPlayerAudio 2813325568 terminating
2024-02-04 19:34:12.367 T:21272    info <general>: Closing audio device
2024-02-04 19:34:12.368 T:21272   debug <general>: CDVDAudio::Flush - flush audio stream
2024-02-04 19:34:12.369 T:27806   debug <general>: CActiveAE::DiscardStream - audio stream deleted
2024-02-04 19:34:12.369 T:27806   debug <general>: CActiveAE::ClearDiscardedBuffers - buffer pool deleted
2024-02-04 19:34:12.371 T:27807    info <general>: Skipped 2 duplicate messages..
2024-02-04 19:34:12.371 T:27807    info <general>: CActiveAESink::OpenSink - initialize sink
2024-02-04 19:34:12.371 T:27807   debug <general>: CActiveAESink::OpenSink - trying to open device ALSA:sysdefault:CARD=vc4hdmi1
2024-02-04 19:34:12.371 T:27807    info <general>: CAESinkALSA::Initialize - Attempting to open device "sysdefault:CARD=vc4hdmi1"
2024-02-04 19:34:12.375 T:21272    info <general>: Deleting audio codec
2024-02-04 19:34:12.376 T:21272    info <general>: Closing stream player 3
2024-02-04 19:34:12.377 T:27807    info <general>: CAESinkALSA::Initialize - Opened device "sysdefault:CARD=vc4hdmi1"
2024-02-04 19:34:12.377 T:21272   error <general>: ReadPacket - Error demux packet doesn't belong to a valid stream
2024-02-04 19:34:12.378 T:27807    info <general>: Skipped 3 duplicate messages..
2024-02-04 19:34:12.421 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: GetTimes - startTime = 1707067800        ptsStart = 0    ptsBegin = 0    ptsEnd = 3300000000
2024-02-04 19:34:12.421 T:21272   error <general>: ReadPacket - Error demux packet doesn't belong to a valid stream
2024-02-04 19:34:12.623 T:21272   debug <general>: Skipped 498 duplicate messages..
2024-02-04 19:34:12.623 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: GetTimes - startTime = 1707067800        ptsStart = 0    ptsBegin = 0    ptsEnd = 3300000000
2024-02-04 19:34:12.625 T:21272   error <general>: ReadPacket - Error demux packet doesn't belong to a valid stream
2024-02-04 19:34:12.823 T:21272   debug <general>: Skipped 336 duplicate messages..
2024-02-04 19:34:12.823 T:21272   debug <general>: AddOnLog: inputstream.ffmpegdirect: GetTimes - startTime = 1707067800        ptsStart = 0    ptsBegin = 0    ptsEnd = 3300000000
2024-02-04 19:34:12.824 T:21272   error <general>: ReadPacket - Error demux packet doesn't belong to a valid stream
2024-02-04 19:48:55.364 T:21783   debug <general>: AddOnLog: inputstream.ffmpegdirect: CheckReturnEmptyOnPacketResult - isEOF: 1, terminates: 0, isOpening: 0, lastSeekWasLive: 0, lastLiveOffset+duration: 14400 > currentDemuxTime: 2120
2024-02-04 19:48:55.364 T:21783    info <general>: Process - eof reading from demuxer
2024-02-04 19:48:55.364 T:21783    info <general>: CVideoPlayer::OnExit()
2024-02-04 19:48:55.364 T:21783    info <general>: VideoPlayer: eof, waiting for queues to empty
2024-02-04 19:48:55.364 T:21783   debug <general>: CVideoPlayer: updating file item stream details with available streams
2024-02-04 19:48:55.365 T:22191   debug <general>: Thread JobWorker start, auto delete: true
phunkyfish commented 7 months ago

Having this working all depends on the type of catchup supported by your provider.

from your edit it appears like your provider allows you to start a stream. Then you can navigate within the stream.

Do you have some other example M3U entries? Also a full debug log would be useful if you’d like to try and this to work when not using adaptive.

pgranat commented 7 months ago

Actually I did some more testing and I found out that the problem happened only on some streams. Maybe they are damaged or something like that - If so - sorry for bother. Nevertheless both are working on inputstream, only one on ffmpeg

M3U Entry look like that. I figured it out basing on tcpdump from provider app and your post from kodi tv here Entered catchup, catchup-source and catchup-days manually to my m3u. Every entry looks the same

#EXTINF:-1 catchup="default" catchup-source="http://my.provider.com/timeshift/myuser/mypassword/{M}/{Y}-{m}-{d}:{H}-{M}-{S}/880380.m3u8" catchup-days="3" tvg-chno="360" tvg-id="" tvg-name="TVP 1" tvg- group-title="ARCHIWUM",TVP 1
http://my.provider.com/live/myuser/mypassword/880380.m3u8

kodi_log_working.txt kodi_log_noworking.txt

phunkyfish commented 7 months ago

Cool, once you have something that works. From the log nothing stands out to me. Maybe just a stream adaptive can play and ffmpeg cannot.

On Mon, 5 Feb 2024 at 10:21, Pawel Granat @.***> wrote:

Actually I did some more testing and I found out that the problem happened only on some streams. Maybe they are damaged or something like that - If so

  • sorry for bother. Nevertheless both are working on inputstream, only one on ffmpeg

M3U Entry look like that. I figured it out basing on tcpdump from provider app and your post from kodi tv here https://forum.kodi.tv/showthread.php?tid=351431&pid=3079922#pid3079922 Entered catchup, catchup-source and catchup-days manually to my m3u. Every entry looks the same

EXTINF:-1 catchup="default" catchup-source="http://my.provider.com/timeshift/myuser/mypassword/{M}/{Y}-{m}-{d}:{H}-{M}-{S}/880380.m3u8" catchup-days="3" tvg-chno="360" tvg-id="" tvg-name="TVP 1" tvg-logo="http://logo.protv.cc/picons/logos/POLAND/TVP--1-HD.png" group-title="ARCHIWUM",TVP 1http://my.provider.com/live/myuser/mypassword/880380.m3u8

kodi_log_working.txt https://github.com/kodi-pvr/pvr.iptvsimple/files/14164235/kodi_log_working.txt kodi_log_noworking.txt https://github.com/kodi-pvr/pvr.iptvsimple/files/14164236/kodi_log_noworking.txt

— Reply to this email directly, view it on GitHub https://github.com/kodi-pvr/pvr.iptvsimple/issues/832#issuecomment-1926651364, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDDKYZ6JZNTVVHJOVQXWULYSCXEBAVCNFSM6AAAAABCZCDNJSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRWGY2TCMZWGQ . You are receiving this because you commented.Message ID: <kodi-pvr/pvr. @.***>

pgranat commented 7 months ago

Thanks for your time I guess it can be closed