Skip to content

Align Device Profiles with what server expects - #5711

Open
Shadowghost wants to merge 13 commits into
jellyfin:masterfrom
Shadowghost:device-profile-cleanup
Open

Align Device Profiles with what server expects#5711
Shadowghost wants to merge 13 commits into
jellyfin:masterfrom
Shadowghost:device-profile-cleanup

Conversation

@Shadowghost

Copy link
Copy Markdown

There are some issues with the announced device profiles.

Changes

  • add helper methods for device profile creation and simplify the code
  • add AV1 and VP9 support to the fMP4 transcoding profile
  • align codec strings with server
  • add mpeg-1/2 support (if applicable to device)
  • use fmp4 for audio transcodes
  • restrict direct play audio codecs to what is actually supported

Code assistance
Used Claude Opus 4.8 to get an idea of how the logic works and do some refactoring.

Issues
Fixes jellyfin/jellyfin#17444

@nielsvanvelzen nielsvanvelzen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial review, because you changed actual values and the way it's written it became a lot harder to read the diff so there will be more review passes to come.

fun createDeviceProfile(
context: Context,
userPreferences: UserPreferences,
serverVersion: ServerVersion,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We deliberately kept the serverVersion parameter because we may need it again with a future server release, just like how we needed it to support both 10.10 and 10.11 at the same time for the 0.19 release branch.
Removing the context is probably fine.

val supportsHevcDolbyVisionEL = mediaTest.supportsHevcDolbyVisionEL()
val supportsHevcHDR10 = mediaTest.supportsHevcHDR10()
val supportsHevcHDR10Plus = mediaTest.supportsHevcHDR10Plus()
val hevcDoviHdr10PlusBug = KnownDefects.hevcDoviHdr10PlusBug

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to assign a variable to another variable really..

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was more for consistency than anything else, I'll remove it and directly check the flag

Comment on lines +166 to +167
if (supportsAV1) Codec.Video.AV1 else null,
if (supportsVP9) Codec.Video.VP9 else null,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We deliberately do not support transcoding profiles for AV1 and VP9 as we've been told multiple times by the ffmpeg team that this is extremely inefficient and shouldn't be done.

@Shadowghost Shadowghost Jul 26, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least for AV1 it's a sever side setting anyway so shouldn't it be fine to keep? And for which cases did the ffmpeg decs say it is inefficient (are we talking server or client here?)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding the problem is that the server will often not hit 1x speed when transcoding to av1/vp9 and that would be the main reason to discourage it. But I'm not aware of the specifics, just know I was told to not use it.

}

// Little helper function to more easily define video codec profiles
private fun DeviceProfileBuilder.videoCodecProfile(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helper function really has little gain, we already have a proper DSL in place

protocol = MediaStreamProtocol.HLS

videoCodec(*hlsVideoCodecs)
videoCodec(*hlsFmp4VideoCodecs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10.11.11 unnecessarily transcodes external DTS files to AAC (Direct streaming) instead of remuxing

3 participants