Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only play the first five seconds even if audio is longer #6422

Open
Impre-visible opened this issue May 16, 2024 · 4 comments
Open

Only play the first five seconds even if audio is longer #6422

Impre-visible opened this issue May 16, 2024 · 4 comments

Comments

@Impre-visible
Copy link

What do you want to do with Hls.js?

I want to only play the first 5s for each audio segments in the HLS, cause ffmpeg is making longer audio segments, so it's making the audio out of sync, if the audio is 5.02s it's playing 5.02s instead of 5s, the audio segments are never lower than 5s.

What have you tried so far?

Nothing, cause I didn't found anything on internet about that.

@Impre-visible Impre-visible added Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. Question labels May 16, 2024
@robwalch robwalch added Stream Issue and removed Question Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels May 16, 2024
@robwalch
Copy link
Collaborator

robwalch commented May 16, 2024

You need to fix the encoding/segmenting issue. HLS.js does not edit segment length.

Note that if the timestamps at the start of each segment are correct, any overlapping samples may be either dropped or appended over. (However, with audio-only, hls.js may ignore unmarked discontinuities and overlapping sample timestamps, assuming segments are meant to be buffered in sequence).

@Impre-visible
Copy link
Author

Sadly I didn't managed to, it's been some weeks know, and even the ffmpeg community can't find a way, I tried other things, everytime it's the same issue

@robwalch
Copy link
Collaborator

Sadly I didn't managed to, it's been some weeks know, and even the ffmpeg community can't find a way, I tried other things, everytime it's the same issue

Have you filed an issue?

Providing a sample source and HLS asset is essential. Maintainers and contributors need to analyze and compare your source material to the encoder/segmenter output.

@Impre-visible
Copy link
Author

I have filled an issue, they sadly can't help, cause it's an issue with AAC and ADTS, you can't have a precise file duration, but if the audio is not forced to be adts, I can't play it, I tried flac, ogg, wav, with various codecs, nothing works until I force it to be adts... I opened a discussion to talk about other audio codecs #6435 . Maybe it will be implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants