video-dev / hls.js

HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
https://hlsjs.video-dev.org/demo
Other
14.81k stars 2.57k forks source link

Audio & Video not synchronized on 1.1.2, but it synchronized on 0.14.17 #4476

Closed Vladislavik closed 2 years ago

Vladislavik commented 2 years ago

What version of Hls.js are you using?

1.1.2

What browser (including version) are you using?

Chrome/96.0.4664.110 Safari/537.36

What OS (including version) are you using?

Mac OS 12.1

Test stream

https://h4ahsm.cfeucdn.com/test/2/test.mp4.m3u8

Configuration

{}

Additional player setup steps

No response

Checklist

Steps to reproduce

  1. Check video on hls-js.netlify.app

  2. Try to move to 1:06:00 for example and see on actors, they talk witout voice sound, voice goes from another time

  3. Same video on HLS.js 0.14.17 work normal example

Expected behaviour

Sync Audio and video

What actually happened?

Async audio and video on lates 1.1.2 HLS.js but this not happend on old 0.x.x version

Console output

No errors

Chrome media internals output

No response

Vladislavik commented 2 years ago

@robwalch why you labeled it as Stream Issue if it work fine on 0.14.17 and bad on 1.0.0+ did you check video on 1:06:00 it is too big async between video and audio

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

FlantasticDan commented 2 years ago

I'm also experiencing this sort of issue with v1.1.5 (latest) when compared to v0.14.17 where the longer my live stream goes, the more the audio drifts out of sync from the video. The latest version has the audio drifting out of sync much faster but ultimately v0.14.17 drifts as well.

I am able to replicate @Vladislavik's described audio sync issue in their steps to reproduce on Windows 11 Chrome 100.0.4896.127 (Official Build) (64-bit).

robwalch commented 2 years ago

Please try with v1.2.4.

The stream issue that impacted v1.1.2 (unless the stream has changed since) was likely related to the segments not starting with a video I-frame (see the logs for "dropped [number] video samples due to a missing keyframe") and/or an issue with audio "PTS" timestamp sync in the remuxer. v1.2.0 simplified and improved handling of streams segmented this way (see release notes).

Vladislavik commented 2 years ago

yes, now better

robwalch commented 2 years ago

Fixed by #4808