inputstream.adaptive icon indicating copy to clipboard operation
inputstream.adaptive copied to clipboard

[HLS, live stream] problem with synchronization audio and video

Open mtr81 opened this issue 1 year ago • 3 comments

Bug report

Describe the bug

Here is a clear and concise description of what the problem is:

HLS live stream is playing without audio and video synchronization. Playback in Kodi 20 and 19 without problems.

Expected Behavior

Here is a clear and concise description of what was expected to happen:

Playback with audio and video synchronization.

Actual Behavior

Playing without audio and video synchronization.

Possible Fix

Unknown.

To Reproduce

Steps to reproduce the behavior:

  1. Start playback live stream (HLS protocol)
  2. Stream is playing without audio-video synchronization.

Debuglog

The debuglog can be found here:

log.txt

MPD/M3U8s/ISM

An example or copy of a manifest (or manifests for HLS - master and variants) can be found here:

manifest_1714509295_master.txt manifest_1714509296_child-video.txt manifest_1714509297_child-audio.txt manifest_1714509297_child-subtitle.txt manifest_1714509300_child-video.txt manifest_1714509301_child-audio.txt manifest_1714509309_child-audio.txt manifest_1714509309_child-video.txt manifest_1714509313_child-audio.txt manifest_1714509313_child-video.txt manifest_1714509317_child-audio.txt manifest_1714509317_child-video.txt manifest_1714509326_child-audio.txt manifest_1714509326_child-video.txt manifest_1714509330_child-audio.txt manifest_1714509330_child-video.txt manifest_1714509334_child-audio.txt manifest_1714509334_child-video.txt manifest_1714509342_child-audio.txt manifest_1714509342_child-video.txt manifest_1714509350_child-video.txt manifest_1714509351_child-audio.txt

Screenshots

Here are some links or screenshots to help explain the problem:

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

Your Environment

Used Operating system:

  • [ ] Android

  • [ ] iOS

  • [ ] tvOS

  • [ ] Linux

  • [ ] OSX

  • [x ] Windows

  • [ ] Windows UWP

  • Operating system version/name: Windows 10 22H2, kernel: Windows NT x86 64-bit version

  • Kodi version: 21.0

  • inputstream.adaptive version: 21.4.5

note: Once the issue is made we require you to update it with new information should that be required. Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

mtr81 avatar Apr 30 '24 21:04 mtr81

im not sure that both cases have the same problem, i was not able to figure out the problem on issue log above

but for https://hugh.cdn.rumble.cloud/live/3fms19g4/slot-129/fpd5-jyun/chunklist_DVR.m3u8 its possible this use case has been broken with recent fixes where AdaptiveStream::ensureSegment now make use of GetSegmentByPts to find the segment so i suspect that after a manifest update, segments lost their pts and then GetSegmentByPts select a wrong segment

CastagnaIT avatar May 02 '24 14:05 CastagnaIT

Another case - look at the counter: Screen from Kodi 20: K20_hls_static Screen from Kodi 21: K21_hls_static

The same content was playback...

Manifests: manifest_1715135428_master.txt manifest_1715135429_child-audio.txt manifest_1715135429_child-video.txt

mtr81 avatar May 08 '24 02:05 mtr81

Similar (this time live stream):

Kodi 20 K20_hls_live_counter

Kodi 21 K21_hls_live_counter

Manifests:

manifest_1715136532_master.txt manifest_1715136534_child-video.txt

mtr81 avatar May 08 '24 03:05 mtr81

here you are collecting different cases on same issue despite can be similar at screen, could be not so on source code and its needed investigate on each case so it's starting to make it hard for me to follow this issue please do not add other cases here otherwise it becomes a mess

now, i found a problem, the datetime was incorrectly parsed and it could, maybe, cause some problems on some posted streams #EXT-X-PROGRAM-DATE-TIME:2024-04-30T20:19:53.145433Z

try test PR #1552 test build: https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-1552/2/artifacts let me know if you find some difference

CastagnaIT avatar May 10 '24 16:05 CastagnaIT

Without changes - same situation as https://github.com/xbmc/inputstream.adaptive/issues/1544#issuecomment-2099627994

mtr81 avatar May 11 '24 04:05 mtr81

there is a website where get an updated url of https://hugh.cdn.rumble.cloud/live/3fms19g4/slot-129/fpd5-jyun/chunklist_DVR.m3u8 or to get another similar? because looks like expired

CastagnaIT avatar May 13 '24 12:05 CastagnaIT

i found that "DVR" live service has inaccurare EXT-X-PROGRAM-DATE-TIME values between manifest updates so its possible that this is the cause of the wrong selected segments i will try investigate better

previous aac child manifest

#EXTM3U #EXT-X-VERSION:4 #EXT-X-TARGETDURATION:4 #EXT-X-MEDIA-SEQUENCE:1245154 #EXT-X-PROGRAM-DATE-TIME:2024-05-14T06:17:19.180Z // 1715667439180 #EXTINF:2.00533, master_a1_20240514T061719_1245154.aac // 1715667439180 #EXTINF:1.98400, master_a1_20240514T061721_1245155.aac // 1715667441185 #EXTINF:2.00533, master_a1_20240514T061723_1245156.aac // 1715667443169 #EXTINF:2.00533, master_a1_20240514T061725_1245157.aac // 1715667445174 #EXTINF:2.00533, master_a1_20240514T061727_1245158.aac #EXTINF:1.98400,

next aac child manifest #EXTM3U #EXT-X-VERSION:4 #EXT-X-TARGETDURATION:4 #EXT-X-MEDIA-SEQUENCE:1245157 #EXT-X-PROGRAM-DATE-TIME:2024-05-14T06:17:25.180Z // 1715667445180 #EXTINF:2.00533, master_a1_20240514T061725_1245157.aac // 1715667445180 #EXTINF:2.00533, master_a1_20240514T061727_1245158.aac #EXTINF:1.98400, master_a1_20240514T061729_1245159.aac #EXTINF:2.00533, master_a1_20240514T061731_1245160.aac #EXTINF:2.00533, master_a1_20240514T061733_1245161.aac #EXTINF:2.00533,

CastagnaIT avatar May 14 '24 07:05 CastagnaIT

I see that the default player skips these tags and that's why it works fine info <general>: ffmpeg[0x16d29b218c0]: [hls] Skip ('#EXT-X-PROGRAM-DATE-TIME:2024-05-14T15:26:36.000+0200')

mtr81 avatar May 14 '24 13:05 mtr81

i made a fix, at least HLS "PVR" live now seem to works correctly but i will need more time to test it to check for regressions for others use cases hoping my old test streams still works

EDIT: builds: https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-1555/2/artifacts

CastagnaIT avatar May 15 '24 13:05 CastagnaIT

Issue https://github.com/xbmc/inputstream.adaptive/issues/1544#issue-2272463886 seems fixed but https://github.com/xbmc/inputstream.adaptive/issues/1544#issuecomment-2099627994 not at all. Also https://github.com/xbmc/inputstream.adaptive/issues/1544#issuecomment-2099650763 still without changes. In all the above cases ISA for Kodi 20 works without problems...

mtr81 avatar May 15 '24 16:05 mtr81

Issue https://github.com/xbmc/inputstream.adaptive/issues/1544#issue-2272463886 seems fixed but https://github.com/xbmc/inputstream.adaptive/issues/1544#issuecomment-2099627994 not at all. Also https://github.com/xbmc/inputstream.adaptive/issues/1544#issuecomment-2099650763 still without changes. In all the above cases ISA for Kodi 20 works without problems...

because these cases "works" on kodi 20 dont means that was working because correctly implemented, on Kodi 20 ISA have tons of bugs, hacks, workaround.. these mentioned are two examples so

for https://github.com/xbmc/inputstream.adaptive/issues/1544#issuecomment-2099650763 is a live with multiple periods, and the last period has no defined duration, so no total time (GUI right time) will be shown on Omega is intended as is for now, no changes are intended to do.

for the https://github.com/xbmc/inputstream.adaptive/issues/1544#issuecomment-2099627994 is another story, this a weird case at least on my eyes looks as a VOD stream, but have EXT-X-PROGRAM-DATE-TIME that should be used with live streams some services may assume this like a "live to VOD" transition, but nothing of this is declared on official docs, and i dont think this case has been really tested on ISA from our part. The weird GUI time on Omega more likely is shown due to new EXT-X-PROGRAM-DATE-TIME implementation, i dont see this like a real bug seem to be more a provider customization, that cause this side effect, would better if you open a separate issue for this case

CastagnaIT avatar May 15 '24 18:05 CastagnaIT

for the #1544 (comment) is another story, this a weird case at least on my eyes looks as a VOD stream, but have EXT-X-PROGRAM-DATE-TIME that should be used with live streams some services may assume this like a "live to VOD" transition, but nothing of this is declared on official docs, and i dont think this case has been really tested on ISA from our part. The weird GUI time on Omega more likely is shown due to new EXT-X-PROGRAM-DATE-TIME implementation, i dont see this like a real bug seem to be more a provider customization, that cause this side effect, would better if you open a separate issue for this case

I won't waste any more time. I will solve the problem using a HTTP server...

mtr81 avatar May 16 '24 11:05 mtr81