nyanmisaka / ffmpeg-rockchip

FFmpeg with async and zero-copy Rockchip MPP & RGA support
Other
326 stars 48 forks source link

HW decoding HEVC w/Jellyfin doesn't work when subtitles enabled #22

Closed bbklopfer closed 5 months ago

bbklopfer commented 5 months ago

(First, thanks for this project --- it's awesome, and the performance on my Orange Pi 5+ is fantastic with HW transcoding!)

I recently did a fresh pull on the docker image nyanmisaka/jellyfin:latest-rockchip and noticed that, with HW HEVC decode enabled, some videos will not show the video with the subtitles enabled (the subtitles will show, however it's just subtitles on a black screen). This happens on browser and android client. At least one video successfully worked on android client when the subtitles were displayed by the client and not embedded into the video stream, however.

My recollection is that this did not happen prior to pulling the docker image today; I'm pretty new to using docker so I'm not sure how to revert to the previous image to test this out.

Happy to assist however I can in debugging, and apologies if this is the wrong place for this.

bbklopfer commented 5 months ago

Update: I'm guessing the previous version of latest-rockchip was nyanmisaka/jellyfin:240117-arm64, so I pulled that and it works as expected: with HW decode (and encode) enabled, subtitles appear as expected.

nyanmisaka commented 5 months ago

@bbklopfer That’s the expected behavior since Rockchip changed their librga kernel API last year. You have to update the BSP kernel to 5.10 rkr6 to get the fully-functional subtitle burn-in output.

You can simply install https://github.com/Joshua-Riek/ubuntu-rockchip instead.

bbklopfer commented 5 months ago

Thanks so much!

bbklopfer commented 5 months ago

Follow up in case anyone ended up here with a similar question:

I installed the kernel from https://github.com/Joshua-Riek/ubuntu-rockchip , but unfortunately am experiencing higher power usage (~2x power consumption at idle), increased thermals, and a load average that won't go below 1.00 ( https://github.com/Joshua-Riek/ubuntu-rockchip/issues/606 ). I did verify that the transcoding works as expected, however.

nyanmisaka commented 5 months ago

Follow up in case anyone ended up here with a similar question:

I installed the kernel from https://github.com/Joshua-Riek/ubuntu-rockchip , but unfortunately am experiencing higher power usage (~2x power consumption at idle), increased thermals, and a load average that won't go below 1.00 ( Joshua-Riek/ubuntu-rockchip#606 ). I did verify that the transcoding works as expected, however.

This distro is mainly for desktop applications. Rockchip's default cpu/gpu governor can cause high latency or lag. So they set the governor to performance by default.

https://github.com/Joshua-Riek/ubuntu-rockchip/blob/main/overlay/usr/lib/systemd/system/cpu-governor-performance.service https://github.com/Joshua-Riek/ubuntu-rockchip/blob/main/overlay/usr/lib/systemd/system/gpu-governor-performance.service

bbklopfer commented 5 months ago

Thanks! Unfortunately performance governors don't appear to be the issue (or at least, not the whole issue) --- the same set of issues happens with the stock Orange Pi Debian userspace if I install the kernel from https://github.com/Joshua-Riek/ubuntu-rockchip (that userspace uses ondemand and simple_ondemand for CPU and GPU, respectively).

I wasn't super careful with looking at the thermals/power with this userspace though, so perhaps it is a little better; but it certainly runs hotter than the Orange Pi issued kernel, and the load average = 1 bug persists.

EvilOlaf commented 2 months ago

Seems like hdmirx is the cause. Once disabled in device tree the load stays normal. So there must be some weirdness inside this driver.