[PR #12837] [MERGED] Infer more audio codec from containers #13390

Closed
opened 2026-02-07 07:12:07 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/12837
Author: @gnattu
Created: 10/17/2024
Status: Merged
Merged: 10/19/2024
Merged by: @crobibero

Base: masterHead: infer-more-codec


📝 Commits (1)

  • fa09e07 Infer more audio codec from containers

📊 Changes

1 file changed (+9 additions, -37 deletions)

View changed files

📝 MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs (+9 -37)

📄 Description

This is mainly for some broken legacy clients that will unlikely to receive proper fix for audio transcoding profile and migrate to our new universal audio controller anytime soon. These legacy clients used an outdated Emby-era audio transcoding pipeline, where the client neither explicitly specifies the desired transcoding formats nor properly indicates the supported audio codecs in its request. Instead, they rely on just providing a container name in the request URL, hoping the server can guess the correct audio codec. However, this guessing is often inaccurate as the container-to-codec mapping has been hard-coded and outdated for six years. When the server cannot guess it will just return "copy" which will obviously fail because the client is requesting transcoding. This PR makes the infer logic more robust to only infer from containers that does not have the same name as the audio codec, and pick the "should be compatible" codec for the container. This may still fail in edge cases if the client is weird enough, but should cover most use cases.

Please note that some clients (like JMP) always requests the container same as the source audio (like from flac to flac) which might make the transcoding behavior weird, this has to be fixed on the client side.

Changes

  • Pick the in-theory compatible audio codec for requested container
  • If the container is not empty, default to just return the container name as codec

Issues

Fixes #12822


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/12837 **Author:** [@gnattu](https://github.com/gnattu) **Created:** 10/17/2024 **Status:** ✅ Merged **Merged:** 10/19/2024 **Merged by:** [@crobibero](https://github.com/crobibero) **Base:** `master` ← **Head:** `infer-more-codec` --- ### 📝 Commits (1) - [`fa09e07`](https://github.com/jellyfin/jellyfin/commit/fa09e07017dcf55aa09029997216e0c854d797d5) Infer more audio codec from containers ### 📊 Changes **1 file changed** (+9 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs` (+9 -37) </details> ### 📄 Description This is mainly for some broken legacy clients that will unlikely to receive proper fix for audio transcoding profile and migrate to our new universal audio controller anytime soon. These legacy clients used an outdated Emby-era audio transcoding pipeline, where the client neither explicitly specifies the desired transcoding formats nor properly indicates the supported audio codecs in its request. Instead, they rely on just providing a container name in the request URL, hoping the server can guess the correct audio codec. However, this guessing is often inaccurate as the container-to-codec mapping has been hard-coded and outdated for six years. When the server cannot guess it will just return "copy" which will obviously fail because the client is requesting transcoding. This PR makes the infer logic more robust to only infer from containers that does not have the same name as the audio codec, and pick the "should be compatible" codec for the container. This may still fail in edge cases if the client is weird enough, but should cover most use cases. Please note that some clients (like JMP) always requests the container same as the source audio (like from flac to flac) which might make the transcoding behavior weird, this has to be fixed on the client side. <!-- Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y). For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our documentation. --> **Changes** <!-- Describe your changes here in 1-5 sentences. --> - Pick the in-theory compatible audio codec for requested container - If the container is not empty, default to just return the container name as codec **Issues** <!-- Tag any issues that this PR solves here. ex. Fixes # --> Fixes #12822 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:12:07 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#13390