Skip to content

Dynamically query device H264 max level for WebView device profile - #1956

Merged
nielsvanvelzen merged 1 commit into
jellyfin:masterfrom
stumpylog:fix/dynamic-codec-capabilities
Jun 12, 2026
Merged

Dynamically query device H264 max level for WebView device profile#1956
nielsvanvelzen merged 1 commit into
jellyfin:masterfrom
stumpylog:fix/dynamic-codec-capabilities

Conversation

@stumpylog

@stumpylog stumpylog commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Changes

This is an attempt, using Claude, to resolve the linked issue. Instead of hardcoding the maximum H264 level, build it dynamically for the WebView. This should allow clients which support higher levels to not transcode.

I confirmed with a level 4.2 file on my Pixel 6 Pro. Using the web player, the current release results in transcoding. With a build from this branch, the file is direct played. I was able to reach level 5.2, the maximum my device supports, before transcoding began again.

Issues

Fixes #1921

@stumpylog
stumpylog force-pushed the fix/dynamic-codec-capabilities branch from 34720e6 to 0c4918a Compare April 17, 2026 22:13
@stumpylog
stumpylog marked this pull request as ready for review April 17, 2026 22:13
@nielsvanvelzen

Copy link
Copy Markdown
Member

Please rebase the PR so the CI can run

Instead of hardcoding H264 level "41" in nativeshell.js, query the
actual device max AVC level at runtime via
NativeInterface.getCodecCapabilities(). This lets devices that
support H264 level 4.2, 5.0, etc. direct-play content that was
previously forced to transcode.

The profile list (high/main/baseline/constrained baseline) is left
hardcoded deliberately: Chromium's <video> pipeline in the WebView
does not decode the full set of H264 profiles MediaCodec advertises
(notably 10-bit), so advertising them would risk regressions.

Fixes jellyfin#1921

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@stumpylog
stumpylog force-pushed the fix/dynamic-codec-capabilities branch from 0c4918a to 9f296d2 Compare June 12, 2026 18:12
@stumpylog

Copy link
Copy Markdown
Contributor Author

Done!

@nielsvanvelzen nielsvanvelzen added this to the v2.7.0 milestone Jun 12, 2026
@nielsvanvelzen nielsvanvelzen added the enhancement New feature or request label Jun 12, 2026
@nielsvanvelzen
nielsvanvelzen merged commit cf4d754 into jellyfin:master Jun 12, 2026
6 checks passed
@Sebastian-Hothaza

Copy link
Copy Markdown

Awesome, great to see! Any estimate on when this will make it to the deployed Google Play store app? Or if we want to test/see this in action we'd have to manually build APK from this repo?

@nielsvanvelzen

Copy link
Copy Markdown
Member

Will be part of 2.7.0

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android App Fails to identify H264 Capabilities

3 participants