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

Add multiple audio track support in HLS #2728

Closed
dams92210 opened this issue Nov 21, 2023 · 4 comments · Fixed by #3793
Closed

Add multiple audio track support in HLS #2728

dams92210 opened this issue Nov 21, 2023 · 4 comments · Fixed by #3793
Labels
enhancement New feature or request hls

Comments

@dams92210
Copy link

Describe the feature

HLS is working great in mediamtx but it lacks support for multiple audio tracks when ingesting RTSP or SRT with multiple audio tracks.
As support for audiotracks increase in javascript HLS video players (videojs, flowplayer, radiant, theoplayer,...) would it be possible to add this feature?

@aler9 aler9 added enhancement New feature or request hls labels Dec 16, 2023
@gargolito
Copy link

gargolito commented Sep 4, 2024

@dams92210 are you able to ingest multi track audio from srt at all? I'm asking because I cannot ingest multitrack audio so mediamtx doesn't doesn't convert to hls. This app would solve a big problem for me if it did.

Suggestion: let srt multitrack config where I can configure the server to select one audio track and that way devs don't have to touch HLS code. Something like:

paths:
  stream:
    source: srt://foo
      audiotrack: 0 # (optional)

Right now, for me, multi track audio does not convert to hls, I get no errors - mediamtx just doesn't recognize audio in the stream, only video, so it doesn't convert. Having the optional audio track would at least let me get something working.

@dams92210
Copy link
Author

@gargolito I use ingesting multiple audio tracks audio from SRT with success. But you cannot play it with HLS as only first audio track is recognised.
My trick is to use FFMPEG to remux the SRT feed from Mediamtx, one per audio tack and ingest back in mediamtx without reencoding.
Not optimal but this does work fine.

My request is to be able to have a common HLS js player presenting all audio tracks, as that's not possible with this trick. I need to hock the player and switch from one HLS feed to another.

@aler9 aler9 changed the title Add multiple audio track support is HLS Add multiple audio track support in HLS Sep 6, 2024
@aler9 aler9 changed the title Add multiple audio track support in HLS Add multiple track support in HLS Sep 16, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Sep 21, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Sep 22, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Sep 22, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Sep 22, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Sep 22, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Sep 22, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Sep 22, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Sep 22, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Sep 22, 2024
@aler9 aler9 changed the title Add multiple track support in HLS Add multiple audio track support in HLS Sep 22, 2024
@aler9
Copy link
Member

aler9 commented Sep 22, 2024

This has been implemented and is in beta here: #3793

aler9 added a commit to bluenviron/gohlslib that referenced this issue Sep 29, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Sep 29, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Oct 2, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Oct 2, 2024
aler9 added a commit to bluenviron/gohlslib that referenced this issue Oct 2, 2024
* muxer: support multiple audio tracks (bluenviron/mediamtx#2728)

* fix support for audio-only multitracks

* fix tests and rendition flags

* update README
Copy link
Contributor

github-actions bot commented Oct 7, 2024

This issue is mentioned in release v1.9.2 🚀
Check out the entire changelog by clicking here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hls
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants