jellyfin / jellyfin-chromecast

Chromecast Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
127 stars 38 forks source link

Chromecast uses a lot of CPU while playing a particular video file #398

Open GogoFC opened 1 year ago

GogoFC commented 1 year ago

Pixel 4XL Android 13, Jellyfin 2.4.4

App on the Android studders.

While playing one certain video file Chromecast uses 7 CPUs, so I tried to disable the Chromecast plugin from json config but the plugin is still there and works after editing the config file.

The only visible difference I can see between a normal Browser stream and Chromecast is that I can see the Browser stream is in HLS where as Chromecast ffmpeg does something which I don't understand but I can see it is x264.

Can I do something about the Chromecast? I want to share this with other users but 7 CPUs use 35 Watts.

Could it be the YUV420 color model? My Chromecast is very old. I haven't actually tried other videos yet, but will do later.

Another thing. If I before I start the video everything is fine on the video timeline at the bottom, but if I cast after the video is already playing there is no slider and it says "Ends at invalid date".

Edit: So everything is fine with a different file, it uses 10% of 1 CPU.

The only difference between the files I see is the bitrate.

Both of the files played on my Laptop take up about the same amount of CPU.

Below is the file that works fine.


Video
Title: 1080p H264 SDR
Codec: H264
AVC: Yes
Profile: High
Level: 40
Resolution: 1920x800
Aspect ratio: 2.40:1
Interlaced: No
Framerate: 24
Bitrate: 4712 kbps
Bit depth: 8 bit
Video range: SDR
Video range type: SDR
Color space: bt709
Color transfer: bt709
Color primaries: bt709
Pixel format: yuv420p
Ref frames: 1
NAL: 4

--- Audio

Audio
Title: English - Dolby Digital+ - 5.1 - Default
Language: eng
Codec: EAC3
Layout: 5.1
Channels: 6 ch
Bitrate: 640 kbps
Sample rate: 48000 Hz
Default: Yes
Forced: No
External: No

Below file uses a lot of CPU.


Video
Title: 1080p H264 SDR
Codec: H264
AVC: Yes
Profile: High
Level: 40
Resolution: 1920x1080
Aspect ratio: 16:9
Interlaced: No
Framerate: 23.976025
Bitrate: 11964 kbps
Bit depth: 8 bit
Video range: SDR
Video range type: SDR
Color space: bt709
Color transfer: bt709
Color primaries: bt709
Pixel format: yuv420p
Ref frames: 1
NAL: 4

--- Audio

Audio
Title: English - Dolby Digital+ - 5.1 - Default
Language: eng
Codec: EAC3
Layout: 5.1
Channels: 6 ch
Bitrate: 640 kbps
Sample rate: 48000 Hz
Default: Yes
Forced: No
External: No

Browser play:

Screenshot from 2023-03-29 14-27-54

Chromecast:

Screenshot from 2023-03-29 14-12-23

Casted after movie has already started:

Screenshot from 2023-03-29 14-30-11

Energy usage before and after :D

PXL_20230329_134557156

PXL_20230329_134634542

GodTamIt commented 9 months ago

@GogoFC it likely has to do with the difference in bitrate.

It's hard to tell without the server logs, which would print out a transcode reason, but it's likely that it exceeded some maximum bitrate threshold. Also, not sure if this is still an issue, so please close if it's been fixed.