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

HLS stream is not showing all audio tracks #1043

Open
skogl opened this issue Jan 29, 2024 · 11 comments
Open

HLS stream is not showing all audio tracks #1043

skogl opened this issue Jan 29, 2024 · 11 comments

Comments

@skogl
Copy link

skogl commented Jan 29, 2024

So I'm having a scenario with a HLS stream that doesn't show all of the audio tracks and my guess is that this is according to specs but either I can't figure out what I can do about it.

I've searched this github as well as the old exoplayer github for answers but it's difficult to sort out anything that can be of interest for this topic.

What I have is:

  • Adaptive HLS with muxed video and audio streams
  • Audio contains multiple tracks

What I get is:

  • Demo app only shows 1 audio track (first in list)

If I extract one of the streams from the adaptive HLS I get a mpeg-ts stream and if I try to play that I get all the tracks. There is no definition of the tracks in the HLS using any metadata keywords. Is this what is lacking, and if so can it be fixed?

I have followed the code all the way from TsExtractor where it doesn't store the track pid but instead gets the stream type using
int trackId = false && mode == MODE_HLS ? streamType : elementaryPid;
Fast forward into HlsSampleStreamWrapper it seem to filter the tracks using 'sampleQueues' and basically group the audio tracks together so even if I override the code in TsExtractor to output all the tracks it doesn't get past this.

So I stopped debugging and seeing how it is grouped together I figured there might be a flag or something else I missed? Or maybe most likely the HLS is not well formed and will not work. The question is: how can I then make the HLS well formed?

@FongMi
Copy link

FongMi commented Jan 29, 2024

Please provide test url let me test.

@tianyif
Copy link
Contributor

tianyif commented Jan 30, 2024

Hi @skogl,

Thanks for reporting! Could you please provide a sample url so that we can debug from it? Thanks in advance!

@skogl
Copy link
Author

skogl commented Jan 30, 2024

Hi, thank you for responding. Should I take this as "it doesn't sound right"?

I can't share this stream directly with you but I can setup a test stream just for a section/window or the stream. Would that be enough for debugging?

@tianyif
Copy link
Contributor

tianyif commented Jan 30, 2024

Hi @skogl,

Should I take this as "it doesn't sound right"

I haven't been sure to be honest, but a test stream should be helpful to identify it.

@skogl
Copy link
Author

skogl commented Feb 1, 2024

I uploaded a test stream to [email protected]. I was wrong in assuming that it was adaptive though, not sure if that changes anything. I'm obviously not familiar with the different formats a hls stream can have.
Playing the hls directly results in only 1 audio track being found where's playing any of the sections as progressive stream finds 4 tracks.

@tianyif
Copy link
Contributor

tianyif commented Feb 5, 2024

Hi @skogl,

Thank you for the test stream! However, later I've looked at the previous issue, and found that it had been discussed widely before (google/ExoPlayer#2014). The ExoPlayer doesn't show multiple tracks muxed is an intended behavior, and it remains as low-priority enhancement per the HLS spec:

9.7. If you have alternative audio content (languages/commentary/DVS), you MUST use separate audio streams.

I'm seeing the other people provided their solution and they said it was working, so you can probably try them. Some examples:

@skogl
Copy link
Author

skogl commented Feb 5, 2024

Thank you for looking this up. I must have browsed for hours in order to find related questions and didn't find the one you link. Sorry about that.

The specs you reference indicates a multivariant playlist though and the one I'm trying to use seem to be a media playlist. I'm going over the specs as we speek to see if I can find something.

I appreciate the links to the workarounds as well but personally I feel they are too intrusive and will break compatibility with main branch too much. Maybe I can continue the path I was into before giving up to start this issue.

I'm not finished reading the specs and you may be correct in that it is not allowed, but then other players does allow this use case and according to that other thread even the apple player that you refer to does.

So, I'll see what the specs say and possibly form a workaround on my own. Either way I appreciate that you've taken your time.

@FongMi
Copy link

FongMi commented Feb 6, 2024

It's like my problem
#999

@FongMi
Copy link

FongMi commented Feb 6, 2024

I can provide solution, please give me your mail.

@skogl
Copy link
Author

skogl commented Feb 6, 2024

If you have a solution I'd rather see that you provide it here so more users can take part of it.

@JaroslavHerber
Copy link
Contributor

I can provide solution, please give me your mail.

You would be a hero, if you provide your solution here :)

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

5 participants