Skip to content

fix: detection of WebM container and Opus audio stream#24182

Open
chanb22 wants to merge 1 commit intoimmich-app:mainfrom
chanb22:webm-transcode-fix
Open

fix: detection of WebM container and Opus audio stream#24182
chanb22 wants to merge 1 commit intoimmich-app:mainfrom
chanb22:webm-transcode-fix

Conversation

@chanb22
Copy link

@chanb22 chanb22 commented Nov 25, 2025

Description

Immich can fail to detect both WebM containers as well as Opus audio streams as the name strings don't exactly match those in the enum for WebM and Opus, which can cause these files to be incorrectly transcoded and/or remuxed when the transcode policy specifies that VP9, Opus, and WebM are accepted formats.

I found existing similar checks for H.265/HEVC and MP4 (QuickTime / MOV) and copied their style for this code. There might be a cleaner way to do this?

How Has This Been Tested?

  • Set VP9, Opus, and WebM as accepted formats in transcode policy.
  • Set transcode policy to "Only videos not in an accepted format".
  • Upload a WebM container file with a VP9 video stream and an Opus audio stream.
  • Verify the transcode status.

Before: video file is remuxed to MP4 and Opus audio stream is transcoded even though it shouldn't be.
After: video file is not remuxed or transcoded.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Please describe to which degree, if any, an LLM was used in creating this pull request.

No LLMs or other AI/ML was used in creating this pull request.

@danieldietzler danieldietzler changed the title Fix detection of WebM container and Opus audio stream fix: detection of WebM container and Opus audio stream Nov 28, 2025
@mertalev
Copy link
Member

mertalev commented Mar 7, 2026

I think this is mostly superseded by #26736, which goes in the other direction of correcting libopus -> opus. The webm fix is still good, so we can get that in if you remove the opus part of the PR. I think it'd be cleaner if you made it a mapping constant to avoid the double ternary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants