You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on the HlsPlaylistParser (line 514), if an audio track has no URI defined, then it will be stored in the muxedAudioFormat. However in this case, whenever we query the audio tracks, the muxed one has no id/label in the Format.
This is causing a problem for us, as we would need to select the tracks based on the labels. The question is whether the missing labels of muxed audio tracks is intentional or if it's a bug? How could we workaround this issue on our side (without changing the manifest itself)?
Do you see this with 2.15.1 (i.e., the latest release)? I took a quick look at the code, and it seems to be written so that the label should be picked up. If that's not happening then I'm probably missing something, and it's probably a bug.
If you can reproduce with 2.15.1, could you provide a complete HLS sample that we can use to easily reproduce the issue, either as a link to an accessible test stream or as a zip file containing the necessary files? The master playlist alone isn't sufficient. Thanks!
@ojw28 We can't really provide a clear sample stream easily, however we have found a solution that we can apply on our forked version. You can see the change in the linked pull request, feel free to give us a feedback on that.
I'm not sure, but that commit doesn't seem to make much sense to me. I don't understand why you'd want to set primaryExtractorTrackType = C.TRACK_TYPE_VIDEO for an audio only stream.
We can't really provide a clear sample stream easily
Can you provide a DRM protected stream easily, even without the corresponding DRM server information? I'm not sure, but I suspect that the tracks are determined before the player needs the DRM keys, so that might be sufficient to be able to reproduce. Thanks!
The primaryExtractorTrackType is set to C.TRACK_TYPE_VIDEO because otherwise the muxedAudioFormat won't be used at all, see the logic a few lines below the change in the PR (line 1371-1381).
I apply and test this commit locally, seems it also works for me, thanks very much!
Now we get two following muxed tracks, but the id is same, because we use one muxedAudioFormat, but from our master m3u8 it included two tracks which has no URI defined.
I also add comment for commit 45857b5,
line 1398, playlistFormat = playlistFormat.withManifestFormatInfo(muxedAudioFormat);
In here the language attribute of muxedAudioFormat may be miss, because of the playlistFormat.sampleMimeType is null.
For above audio-only case, it will output the expected result
In my commit I enhance it to support multiple muxed audio tracks - change the single Format muxedAudioFormat to List<Format> muxedAudioFormats. I also merge this 45857b5 commit. Now I can get the expected output
In here the language attribute of muxedAudioFormat may be miss, because of the playlistFormat.sampleMimeType is null.
This is a good observation. We'll take a look; thanks!
In my commit I enhance it to support multiple muxed audio tracks
There is a TODO about this here. If you've implemented it, please feel free to send us a pull request. If you've implemented it in a different way then that might also be interesting, or you could try and adapt your approach to match what's written in the TODO.
Activity
ojw28 commentedon Oct 27, 2021
Do you see this with 2.15.1 (i.e., the latest release)? I took a quick look at the code, and it seems to be written so that the label should be picked up. If that's not happening then I'm probably missing something, and it's probably a bug.
If you can reproduce with 2.15.1, could you provide a complete HLS sample that we can use to easily reproduce the issue, either as a link to an accessible test stream or as a zip file containing the necessary files? The master playlist alone isn't sufficient. Thanks!
szaboa commentedon Oct 29, 2021
@ojw28 We can't really provide a clear sample stream easily, however we have found a solution that we can apply on our forked version. You can see the change in the linked pull request, feel free to give us a feedback on that.
ojw28 commentedon Nov 1, 2021
I'm not sure, but that commit doesn't seem to make much sense to me. I don't understand why you'd want to set
primaryExtractorTrackType = C.TRACK_TYPE_VIDEOfor an audio only stream.Can you provide a DRM protected stream easily, even without the corresponding DRM server information? I'm not sure, but I suspect that the tracks are determined before the player needs the DRM keys, so that might be sufficient to be able to reproduce. Thanks!
szaboa commentedon Nov 2, 2021
The
primaryExtractorTrackTypeis set toC.TRACK_TYPE_VIDEObecause otherwise themuxedAudioFormatwon't be used at all, see the logic a few lines below the change in the PR (line 1371-1381).ojw28 commentedon Nov 3, 2021
Ah, I see. Could you try applying this change locally, to see whether it also resolves the issue correctly: 6b78164
Thanks!
guoen21 commentedon Nov 8, 2021
I apply and test this commit locally, seems it also works for me, thanks very much!
Now we get two following muxed tracks, but the id is same, because we use one muxedAudioFormat, but from our master m3u8 it included two tracks which has no URI defined.
expected
HLS: Merge muxedAudioFormat into primary audio tracks
guoen21 commentedon Nov 18, 2021
I also add comment for commit 45857b5,
line 1398,
playlistFormat = playlistFormat.withManifestFormatInfo(muxedAudioFormat);In here the language attribute of muxedAudioFormat may be miss, because of the playlistFormat.sampleMimeType is null.
For above audio-only case, it will output the expected result
But for normal case which has video tracks, muxed audio tracks, and additional audio tracks, the output has only one muxed audio track as following:
In my commit I enhance it to support multiple muxed audio tracks - change the single
Format muxedAudioFormattoList<Format> muxedAudioFormats. I also merge this 45857b5 commit. Now I can get the expected outputHLS: Merge muxedAudioFormat into primary audio tracks
ojw28 commentedon Nov 19, 2021
This is a good observation. We'll take a look; thanks!
There is a TODO about this here. If you've implemented it, please feel free to send us a pull request. If you've implemented it in a different way then that might also be interesting, or you could try and adapt your approach to match what's written in the TODO.
HLS: Merge muxedAudioFormat into primary audio tracks