-
Notifications
You must be signed in to change notification settings - Fork 6k
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 - ExoPlayer doesn't detect multiple tracks of same type muxed in TS chunks #2014
Comments
Note: Streams were sent via email. The problematic streams are HLS media playlists. I don't think it's officially supported in HLS to mux multiple streams of the same type into TS chunks. This is supported in straightforward MPEG-TS because the pid for each stream is guaranteed to be constant, but in HLS the pid can change from one chunk to the next, which makes supporting multiple streams of the same type problematic in the general case. HLS officially supports multiple audio via HLS master playlists with alternate renditions. So I think this is working as intended. If you wish to distribute HLS variants of these streams, you'll need to work out a way of generating them to use alternate renditions as per the HLS spec. Note that this approach is also significantly more efficient, since the client will only need to download the enabled audio track, rather than all seven of them. @AquilesCanta - Is there a valid general case way to support this, or is the above correct? Would there be value in providing an option to enable support for this case (i.e. by forcing mapByType to false) if the application knows that the PIDs in the content wont change? |
First things first: This behavior is expected. As stated, we don't support TS variants with multiple muxed tracks of the same type. Initially, the idea was to add support for multiple closed caption tracks only. Unlike with closed captions, the main obstacle for supporting multiple audios in the same TS(in HLS) is that they cannot be described by the manifest. That is, the #EXT-X-MEDIA tag only provides instream id for closed captions. That being said, the spec also states(read the whole section of the spec for some context):
I used to think this was not supported for some reason I don't remember. Even though ambiguous, this suggests the contrary. I also found an hls stream producer that allows muxing multiple audios in each variant. I will mark this as an enhancement but it will probably pass some time before I get to this. The best option, as @ojw28 says, is providing different streams for each language, and let the client download whatever it wants to play. |
Hi! Any progress on this issue? |
Hello. Any progress? |
Hi! Any progress ? |
Hi, as labeled, this is low priority for us. There are technical complications of having this implemented in the library (due to the variety of streams we need to support). Have you had a look at #2976? You could try implementing your own HlsExtractorFactory which builds a TsExtractor using MODE_SINGLE_PMT. As stated there, this is not officially supported, and you might run into issues if your stream has discontinuities. Plus, chunkless preparation will not work correctly either. Might be worth giving it a try for your case, if strictly necessary for your usecase. |
Simple fix from #2976 or MODE_SINGLE_PMT stopped working in recent versions, does anyone have a new fix ? |
Answering to myself: reverting 3919843 seems to have helped to bring back the old behavior. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There is no change in the priority of this issue, and the update in #2014 (comment) still applies. The HLS specification supports multiple tracks as independent streams, which is both more efficient and more consistent with DASH, SmoothStreaming, and the overall direction of the industry. |
As an additional piece of information, it seems like Apple mandate that multiple tracks are delivered as independent streams when streaming to Apple devices. As per their HLS authoring specifications for Apple devices:
|
@ojw28 The specific part of the HLS specification only applies to streams which provide a Master Playlist. Many Live-TV providers do not have that and thus serve muxed streams, which apple also supports. As I and probably many others are not in control of the media served and this format is (in my opinion) used widely enough, I'd think the priority could be increased. |
It's not working for me. I'm using MODE_SINGLE_PMT in DefaultHlsExtractorFactory and removed code from HlsSampleStreamWrapper (as stated in 3919843) Logcat errors:
Additional info about my stream in #6101 Now I'm using sources of exoplayer 2.10.2 |
@tipoc123 I created a fork which supports this. It's based on release-v2 and doesn't require any special MODE_ etc. It's on branch hls-multi-track: https://github.com/Jenjen1324/ExoPlayer/tree/hls-multi-track |
change
to
If you are using ExoMedia then you have to change
to
Thats works for me. |
Thank you, guys. I've tried this commit Jenjen1324@f8d0f5e . It's working. |
Hi, Did you tried to update the code for 2.10.7 version? It has been changed since 2.10.2. Thank you. |
Hi, any chance you could implement these changes for version 2.12.2? Thanks! |
@needz I've updated my repo: https://github.com/Jenjen1324/ExoPlayer with a version for 2.12.2. I've blindly copied over parts of our own modification and just pushed it. Please test if it's even working. If not, open an issue in my repository. |
@Jenjen1324 thanks, it is working indeed, since I could figure the solution out myself based on your previous modifications (thanks a lot for them!), it turned out there are not too many changes to make in this specific version. Kindest regards! |
…nt software & devices Issue on github: google#2014 Original commit: stari4ek@ce66b33 Auditors: alex3d
…nt software & devices Issue on github: google#2014 Original commit: stari4ek@ce66b33 Auditors: alex3d
…ent_software Issue on github: google#2014 Original commit: stari4ek@ce66b33 Auditors: alex3d
…nt software & devices Issue on github: google#2014 Original commit: stari4ek@ce66b33 Auditors: alex3d
…nt software & devices Issue on github: google#2014 Original commit: stari4ek@ce66b33 Auditors: alex3d
Hello, Thanks |
Hi,
The problem with the stream that contains multiple audio tracks.
Ether is broadcast on http, archive by nPVR.
Parameters streams (video H264 - MPEG-4 AVC (part 10) (h264) + 7 audio-tracks MPEG Audio layer 1/2 (mpga))
If broadcast by nPVR exoplayer defines only a single track.
If broadcast by http exoplayer correctly identifies all 7 tracks.
Please tell me why this happens?
The text was updated successfully, but these errors were encountered: