shaka-player icon indicating copy to clipboard operation
shaka-player copied to clipboard

Audio and video are out of sync with a VOD content in HLS format

Open FelipeAndresLopez opened this issue 1 year ago • 6 comments

Have you read the FAQ and checked for duplicate open issues? yes

What version of Shaka Player are you using? 4.3.8

Can you reproduce the issue with our latest release version? yes

Can you reproduce the issue with the latest code from main? yes

Are you using the demo app or your own custom app? Demo App

If custom app, can you reproduce the issue using our demo app? yes

What browser and OS are you using? Chrome - MacOS

What are the manifest and license server URIs? The HLS manifest was shared by email

What did you do?

  1. Open the Shaka Player DEMO v4.3.8
  2. Add the above manifest as a custom content
  3. Play the VOD content
  4. Advance the content until the 30 minute

What did you expect to happen? Audio and video should keep synchronized

What actually happened? Audio and video are not synchronized

FelipeAndresLopez avatar Aug 14 '23 20:08 FelipeAndresLopez

@FelipeAndresLopez can you try with the main branch? Yesterday I fixed some AV sync issues.

avelad avatar Sep 15 '23 13:09 avelad

@FelipeAndresLopez can you try with the main branch? Yesterday I fixed some AV sync issues.

Hi @avelad, first of all, thanks for answering and checking this issue. can this bug fix be testable with the Shaka Player Demo v4.4.2? If yes, the issue persists and I can send you the manifest in HLS that we are using. If not, let me know how I can test it.

FelipeAndresLopez avatar Sep 15 '23 15:09 FelipeAndresLopez

You can use: https://nightly-dot-shaka-player-demo.appspot.com/demo/

avelad avatar Sep 15 '23 15:09 avelad

I just tested and the result is this: When playback starts goes well, and as long as nothing changes, it continues working normally. However when I change the language to Spanish (for instance) or I fast-forward the movie, the audio and video synchronization issue starts appearing. Let me know if you need the HLS file that I'm testing for better debugging. I could send you by email.

FelipeAndresLopez avatar Sep 15 '23 16:09 FelipeAndresLopez

Looks like this issue is being mitigated by new configs. Setting manifest.hls.sequenceMode to false and manifest.hls. ignoreManifestTimestampsInSegmentsMode to true the video and audio are in sync.

cristian-atehortua avatar Nov 14 '23 21:11 cristian-atehortua

I have reproduced the same error with the streams from https://github.com/shaka-project/shaka-player/issues/5445

avelad avatar Dec 05 '23 15:12 avelad

@FelipeAndresLopez Can you send the manifest url to [email protected] ? Thanks!

avelad avatar Jul 01 '24 13:07 avelad

@avelad we also have some streams where this issue occurs. The HLS manifests are only valid for an hour, but you can always get a fresh manifest by doing this:

  • open https://www.buzzfeed.de/meinung/verbale-sexuelle-belaestigung-spd-gesetzesvorschlag-gesetz-catcalling-kommentar-video-92353864.html?info
  • mouse over the video-player
  • check the network tab for the stream.m3u8 file

When the stream gets seeked to the end, the issue becomes noticeable.

klipstein avatar Jul 01 '24 17:07 klipstein

@avelad we also have some streams where this issue occurs. The HLS manifests are only valid for an hour, but you can always get a fresh manifest by doing this:

* open https://www.buzzfeed.de/meinung/verbale-sexuelle-belaestigung-spd-gesetzesvorschlag-gesetz-catcalling-kommentar-video-92353864.html?info

* mouse over the video-player

* check the network tab for the `stream.m3u8` file

When the stream gets seeked to the end, the issue becomes noticeable.

Your stream is wrong, audio and video playlist duration is different 101 vs 105 (adding all EXTINF values), that causes the player to be out of sync, fix that and the player will work properly. Thanks!

avelad avatar Jul 03 '24 10:07 avelad

@avelad thanks for having a closer look. I actually did not check it further because this stream got generated via AWS Elemental MediaConvert (using default settings) and it plays back without audio/video drift in hls.js. Will open a ticket with AWS, but I'm wondering what kind of error correction hls.js applies.

klipstein avatar Jul 03 '24 16:07 klipstein

@robwalch How does hls.js work when the EXTINF is bad? (see my previous comment)

avelad avatar Jul 03 '24 16:07 avelad

Shaka is appending media according to playlist durations and not media timestamps so drift in the playlist is not corrected. You have to talk to your provider to correct this. This is the way Shaka works, sorry!

avelad avatar Jul 04 '24 10:07 avelad

Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen in a comment.

shaka-bot avatar Jul 11 '24 11:07 shaka-bot

@shaka-bot reopen

This issue was opened before new discussion this months.

@avelad said that he replicated the issue.

It should keep opened until fixed.

Just to recap, there's a workaround:

Setting manifest.hls.sequenceMode to false and setting manifest.hls.ignoreManifestTimestampsInSegmenstMode to true

@avelad commented that it should work without those configs

cristian-atehortua avatar Jul 11 '24 14:07 cristian-atehortua

@shaka-bot reopen

cristian-atehortua avatar Jul 11 '24 14:07 cristian-atehortua

@cristian-atehortua Just because it works by chance with some configuration (some errors are displayed in the console) does not mean that the stream is correct.

imagen

You have to talk to your provider to correct this. Sorry!

avelad avatar Jul 11 '24 14:07 avelad

I attach the mediaStreamValidator report:

validation_data.html.zip

I attach the two main problems reported by the Apple tool:

imagen

avelad avatar Jul 11 '24 14:07 avelad

I opened a ticket with AWS and I am awaiting feedback. But maybe the issue of @cristian-atehortua and @FelipeAndresLopez is a different one. Then sorry for hijacking this ticket.

klipstein avatar Jul 11 '24 14:07 klipstein

https://github.com/shaka-project/shaka-player/issues/5445#issuecomment-1841050557

cristian-atehortua avatar Jul 11 '24 15:07 cristian-atehortua

#5445 (comment)

If someone wants to provide a stream, I can look at it again, but the only functional stream for this issue has those problems.

avelad avatar Jul 11 '24 15:07 avelad

@avelad I have a stream that's falling out of sync when the bitrate changes. I've attempted to validate the stream but I can't find the same mediastreamvalidator you referenced above. I downloaded a tool from apple but its not generating the same reporting as you sent along.

I'd be happy to privately send you an HLS stream for testing.

jspizziri avatar Aug 02 '24 19:08 jspizziri

Maybe interesting for someone else who also has an issue with AWS MediaConvert and a Video/Audio drift with HLS in Shaka: We got the feedback from AWS that we should use fixed segment length for transcoding (setting SegmentLengthControl to EXACT).

klipstein avatar Aug 05 '24 10:08 klipstein

FWIW, I'm using shaka-streamer/shaka-packager which, in turn is using ffmpeg. One of the things I noticed about my HLS manifest files is that the length of the audio segments is ever so slightly different from the length of the video segments.

jspizziri avatar Aug 05 '24 14:08 jspizziri