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 audio remux to UniversalAudioController #11399

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

gnattu
Copy link
Member

@gnattu gnattu commented Apr 21, 2024

Changes

This PR adds audio remuxing (copying audio into another container without transcoding) support to the UniversalAudioController, allowing the client to request the audio to be in a specific container. When remuxing with HLS, the HLS container's constraint applies, and it will fallback to transcoding when the original audio codec is not supported by the chosen HLS container. When remuxing with HTTP, this assumes that the client-provided container supports the audio codec. If it does not, ffmpeg would fail.

To workaround the complex codec+container support situation in HLS, an HLS container override feature has been added. The client can explicitly require a container+codec combination supported by HLS. For example, ts|mp3 and mp4|flac. When combinations like these are present, the HLS stream will use the container specified in this profile, ignoring the one set by the TranscodingContainer query string. The most common use case for this mode is to force mp3 to be remuxed in mpegts container because most browsers do not support mp3 in mp4 container, although it is technically supported by HLS. When specifying such overrides, the client should be responsible to ensure the container and codec compatibility.

This would allow clients with strict container requirements to playback certain audio codecs. For example, Opus on Safari can be played with HLS + fmp4.

This can also workarounds a lot of container related issues, as listed below in the issues section.

Issues

#11113 This one is due to the flac/mp3 container containing too little information, the client's estimation of the "ticks" might not be accurate enough. Allowing the client to force an HLS remuxing with fmp4 can mitigate this issue as the mp4 container has more information about the timing. Most browsers do not support mp3 in mp4 container, so probably need to force to remux into mpegts to workaround the timing issue for mp3.

#3731 This issue arises because the flac container has non-standard metadata tags, causing the client to refuse to play the file. This can be mitigated by falling back to HLS remuxing when direct play fails, or simply by forcing HLS remuxing anyway.

@gnattu gnattu added the enhancement Improving an existing function, or small fixes label Apr 21, 2024
@gnattu gnattu changed the title feat: add audio remux to UniversalAudioController Add audio remux to UniversalAudioController Apr 22, 2024
@jellyfin-bot
Copy link
Contributor

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

@jellyfin-bot jellyfin-bot added the merge conflict Merge conflicts should be resolved before a merge label May 15, 2024
Signed-off-by: gnattu <gnattuoc@me.com>
This will improve flexibility due to overcome the complex compatibility situation of HLS

Signed-off-by: gnattu <gnattuoc@me.com>
The SupportsDirectStream is a little bit misleading as it actually means "Supports Direct Play"

Signed-off-by: gnattu <gnattuoc@me.com>
@jellyfin-bot jellyfin-bot removed the merge conflict Merge conflicts should be resolved before a merge label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing function, or small fixes
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

None yet

2 participants