jellyfin / jellyfin-roku

The Official Roku Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
412 stars 129 forks source link

HDR to SDR tone mapping broken #552

Open wynterca opened 2 years ago

wynterca commented 2 years ago

In the new Roku 1.4.12 release tone mapping is no longer triggered when playing HDR content on an SDR tv, it direct plays the HDR content which is washed out in appearance.

whiteowl3 commented 2 years ago

tonemapping has never worked "properly", you were probably getting tonemapping as a side-effect of erroneous transcodes, which are now largely fixed. somebody is already working on an "isHDR" transcode reason, as soon as it lands somebody will implement it in the roku app. https://github.com/jellyfin/jellyfin/pull/7199

wynterca commented 2 years ago

Is it possible to have an option like the existing "Support MPEG2" so it can just be forced instead of detected?

On Thu, Apr 7, 2022 at 8:17 PM whiteowl3 @.***> wrote:

tonemapping has never worked "properly". we are waiting on jellyfin/jellyfin#7199 https://github.com/jellyfin/jellyfin/pull/7199 and #550 https://github.com/jellyfin/jellyfin-roku/issues/550 in order to make it work the way it should.

— Reply to this email directly, view it on GitHub https://github.com/jellyfin/jellyfin-roku/issues/552#issuecomment-1092320702, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATYAKXISSDDICX2SZP3QHCDVD53LHANCNFSM5STTD2FA . You are receiving this because you authored the thread.Message ID: @.***>

whiteowl3 commented 2 years ago

yes it will be a setting something like that, but the problem is, in order to make your HDR transcode in the absence of a valid isHDR transcode reason, then your device profiles need to broken in some way that forces transcoding. this is where it was fixed: https://github.com/jellyfin/jellyfin-roku/pull/543/files if you wanted to re-break it: change line 36 to just say "tsVideoCodecs = tsVideoCodecs" and sideload.

wynterca commented 2 years ago

I updated this section to this and now on my non SDR TV with a Roku Stick + it transcodes and therefore I get tone mapping but on my TCL 4k HDR TV I get passthrough. Would be better if I would get passthrough on my SDR set for h265 and HEVC encoded content that isn't HDR but this will work... Are the profiles handled on the server side as far as seeing an HDR encoded file to deny direct play?

'Device Capabilities for Roku. 'This will likely need further tweaking

function getDeviceCapabilities() as object

return {
    "PlayableMediaTypes": [
        "Audio",
        "Video"
    ],
    "SupportedCommands": [],
    "SupportsPersistentIdentifier": false,
    "SupportsMediaControl": false,
    "DeviceProfile": getDeviceProfile()
}

end function

Function canPlayHDR() as Boolean dev_info = createObject("roDeviceInfo") return dev_info.getDisplayProperties().hdr10 End Function

function getDeviceProfile() as object playMpeg2 = get_setting("playback.mpeg2") = "true"

'Check if 5.1 Audio Output connected
maxAudioChannels = 2
di = CreateObject("roDeviceInfo")
if di.GetAudioOutputChannel() = "5.1 surround"
    maxAudioChannels = 6
end if

if playMpeg2 and di.CanDecodeVideo({ Codec: "mpeg2" }).Result = true
    tsVideoCodecs = "h264,mpeg2video"
else
    tsVideoCodecs = "h264"
end if

if di.CanDecodeVideo({ Codec: "hevc" }).Result = true
    if canPlayHDR()
        tsVideoCodecs = tsVideoCodecs + ",h265,hevc"
    else
        tsVideoCodecs = tsVideoCodecs
    end if
end if

End Function

function getDeviceProfile() as object playMpeg2 = get_setting("playback.mpeg2") = "true"

'Check if 5.1 Audio Output connected
maxAudioChannels = 2
di = CreateObject("roDeviceInfo")
if di.GetAudioOutputChannel() = "5.1 surround"
    maxAudioChannels = 6
end if

if playMpeg2 and di.CanDecodeVideo({ Codec: "mpeg2" }).Result = true
    tsVideoCodecs = "h264,mpeg2video"
else
    tsVideoCodecs = "h264"
end if

if di.CanDecodeVideo({ Codec: "hevc" }).Result = true
    if canPlayHDR()
        tsVideoCodecs = tsVideoCodecs + ",h265,hevc"
    else
        tsVideoCodecs = tsVideoCodecs
    end if
end if

On Thu, Apr 7, 2022 at 8:45 PM whiteowl3 @.***> wrote:

yes it will be a setting something like that, but the problem is, in order to make your HDR transcode in the absence of a valid isHDR transcode reason, then your device profiles need to broken in some way that forces transcoding. this is where it was fixed: https://github.com/jellyfin/jellyfin-roku/pull/543/files if you wanted to re-break it: change line 36 to just say "tsVideoCodecs = tsVideoCodecs" and sideload.

— Reply to this email directly, view it on GitHub https://github.com/jellyfin/jellyfin-roku/issues/552#issuecomment-1092332088, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATYAKXKYNAI65NUYSHHVLRLVD56TVANCNFSM5STTD2FA . You are receiving this because you authored the thread.Message ID: @.***>

wynterca commented 2 years ago

Has there been any movement on this? The fix you provided no longer works.

whiteowl3 commented 2 years ago

yes there has been tons of progress. the settings menu #583 and video range types https://github.com/jellyfin/jellyfin/pull/7947 are both available now. this issue is just waiting on somebody to take the time, unless im mistaken. imho, we should implement a solution based on device capabilities but make sure it can be overridden by a user setting such as "Force Transcoding of HDR" or "Force HDR Passthrough" or some such thing, since capability detection is not perfect.

cewert commented 10 months ago

Hi @wynterca are you still experiencing this on the latest stable version of the app, v1.6.6?

RBR8man commented 9 months ago

Hi @wynterca are you still experiencing this on the latest stable version of the app, v1.6.6?

I still am tone mapping on the android phone app works fine but not roku

cewert commented 9 months ago

Alright, thanks. There's a chance this was fixed on the unstable branch. If you can, please give it a test otherwise I'll check back in after the next release.

RBR8man commented 7 months ago

Deleted my previous reply because I have only now figured out the problem was on my end (had broken ffmpeg binaries and finally got qsv to work) and not the Roku client HDR tonemapping works fine now (1.6.6, untested in 2.0.0)