Skip to content

Direct Streaming causing Jellyfin container to Max CPU and crash #12456

Open
@Brramble

Description

This issue respects the following points:

  • This is a bug, not a question or a configuration issue; Please visit our forum or chat rooms first to troubleshoot with volunteers, before creating a report. The links can be found here.
  • This issue is not already reported on GitHub (I've searched it).
  • I'm using an up to date version of Jellyfin Server stable, unstable or master; We generally do not support previous older versions. If possible, please update to the latest version before opening an issue.
  • I agree to follow Jellyfin's Code of Conduct.
  • This report addresses only a single issue; If you encounter multiple issues, kindly create separate reports for each one.

Description of the bug

I'm experiencing an issue where direct streaming with Jellyfin results in Jellyfin (the dotnet server) maxing out the CPU usage of the container, causing it to halt completely. This problem is reproducible consistently when streaming certain files using Google Chrome, but does not occur with Mozilla Firefox or Edge Chromium.

Details:

Issue: Direct streaming causes the Jellyfin container to max out the CPU and halt. This issue specifically occurs when using Chrome, but not Firefox.

Transcoding Settings: Default settings with QSV enabled and all codecs ticked except AV1 (not supported by QSV). I have UHD 630 iGPU.

File Properties: The problematic files are ~1500MB MKV. Detailed properties are available in the provided images below.

Attempts to replicate the issue with the exact ffmpeg commands from the logs have shown no system impact when run independently. The issue seems to be related to the interaction between Chrome and the Jellyfin server.

Reproduction steps

Stream the related MKV file using Google Chrome.
Observe the CPU usage of the Jellyfin container.
Note that the container reaches 100% CPU usage and halts, requiring a restart.

What is the current bug behavior?

When streaming starts in Chrome, the CPU usage of the Jellyfin container climbs to 100%, causing the entire process to stop. Even after the stream ends, the only solution is to restart the container.

What is the expected correct behavior?

The stream will play without excessive usage on the CPU.

Jellyfin Server version

10.9.9+

Specify commit id

No response

Specify unstable release number

No response

Specify version number

No response

Specify the build version

10.9.9

Environment

- OS: Unraid
- Linux Kernel: n/a
- Virtualization: Docker
- Clients: Chrome, Firefox, Edge Chromium
- Browser: Chrome (127.0.6533.120)
- FFmpeg Version: latest with 10.9.9
- Playback Method: Direct Streaming
- Hardware Acceleration: Yes, QSV
- GPU Model: UHD 630
- Plugins: n/a
- Reverse Proxy: Yes
- Base URL: n/a
- Networking: n/a
- Storage: n/a

Jellyfin logs

[2024-08-16 14:40:23.412 +01:00] [INF] [23] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "USER2". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[2024-08-16 14:40:23.412 +01:00] [INF] [23] Jellyfin.Api.Helpers.MediaInfoHelper: RemoteClientBitrateLimit: 11000000, RemoteIP: "128.240.225.49", IsInLocalNetwork: False
[2024-08-16 14:40:24.014 +01:00] [INF] [23] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[2024-08-16 14:40:24.019 +01:00] [INF] [23] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -probesize 1G -fflags +genpts  -i file:\"/tv/VIDEO_FILEDL-1080p][EAC3 2.0][h264]-alfaHD.mkv\" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:2 -map -0:s -codec:v:0 copy -bsf:v h264_mp4toannexb -start_at_zero -codec:a:0 libfdk_aac -ac 2 -ab 256000 -af \"volume=2\" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 6 -hls_segment_type fmp4 -hls_fmp4_init_filename \"a7141aabe3668500eed9a9e7fca3f335-1.mp4\" -start_number 0 -hls_segment_filename \"/config/cache/transcodes/a7141aabe3668500eed9a9e7fca3f335%d.mp4\" -hls_playlist_type vod -hls_list_size 0 -y \"/config/cache/transcodes/a7141aabe3668500eed9a9e7fca3f335.m3u8\""
[2024-08-16 14:40:26.688 +01:00] [INF] [22] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "IP_ADDRESS" request
[2024-08-16 14:40:31.284 +01:00] [INF] [3] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "IP_ADDRESS" closed
[2024-08-16 14:40:31.999 +01:00] [INF] [3] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "IP_ADDRESS" request
[2024-08-16 14:40:39.125 +01:00] [INF] [16] MediaBrowser.Controller.MediaEncoding.TranscodingJob: Stopping ffmpeg process with q command for "/config/cache/transcodes/a7141aabe3668500eed9a9e7fca3f335.m3u8"
[2024-08-16 14:40:39.126 +01:00] [ERR] [23] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request: "A task was canceled". URL "GET" "/videos/3e2ac1b6-d677-2234-6766-414047f0a0a0/hls1/main/-1.mp4".
[2024-08-16 14:40:39.211 +01:00] [INF] [3] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 0
[2024-08-16 14:40:39.217 +01:00] [INF] [16] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[2024-08-16 14:40:39.217 +01:00] [INF] [16] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -probesize 1G -ss 00:08:00.980 -noaccurate_seek -fflags +genpts  -i file:\"/tv/VIDEO_FILEDL-1080p][EAC3 2.0][h264]-alfaHD.mkv\" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:2 -map -0:s -codec:v:0 copy -bsf:v h264_mp4toannexb -start_at_zero -codec:a:0 libfdk_aac -ac 2 -ab 256000 -af \"volume=2\" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 6 -hls_segment_type fmp4 -hls_fmp4_init_filename \"a7141aabe3668500eed9a9e7fca3f335-1.mp4\" -start_number 80 -hls_segment_filename \"/config/cache/transcodes/a7141aabe3668500eed9a9e7fca3f335%d.mp4\" -hls_playlist_type vod -hls_list_size 0 -y \"/config/cache/transcodes/a7141aabe3668500eed9a9e7fca3f335.m3u8\""
[2024-08-16 14:40:40.373 +01:00] [INF] [23] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "IP_ADDRESS" closed
[2024-08-16 14:40:40.839 +01:00] [ERR] [10] Jellyfin.Plugin.Simkl.Services.PlaybackScrobbler: Can't scrobble: User "USER2" not logged in (True)
[2024-08-16 14:40:41.247 +01:00] [INF] [10] Emby.Server.Implementations.HttpServer.WebSocketManager: WS ""IP_ADDRESS" request
[2024-08-16 14:40:52.836 +01:00] [INF] [25] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 0
[2024-08-16 14:41:05.586 +01:00] [ERR] [8] Jellyfin.Api.WebSocketListeners.SessionInfoWebSocketListener: Object Disposed
System.ObjectDisposedException: The CancellationTokenSource has been disposed.
   at System.Threading.CancellationTokenSource.Cancel()
   at MediaBrowser.Controller.Net.BasePeriodicWebSocketListener`2.DisposeConnection(ValueTuple`3 connection)

[2024-08-16 14:52:19.724 +01:00] [INF] [34] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "USER1". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[2024-08-16 14:52:19.724 +01:00] [INF] [34] Jellyfin.Api.Helpers.MediaInfoHelper: RemoteClientBitrateLimit: 11000000, RemoteIP: "IP_ADDRESS", IsInLocalNetwork: False
[2024-08-16 14:52:20.360 +01:00] [INF] [35] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[2024-08-16 14:52:20.361 +01:00] [INF] [35] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -probesize 1G -fflags +genpts  -i file:\"/tv/VIDEO_FILEDL-1080p][EAC3 2.0][h264]-alfaHD.mkv\" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:2 -map -0:s -codec:v:0 copy -bsf:v h264_mp4toannexb -start_at_zero -codec:a:0 libfdk_aac -ac 2 -ab 256000 -af \"volume=2\" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 6 -hls_segment_type fmp4 -hls_fmp4_init_filename \"dfc54dddc82ad8734652204fab2d8b7b-1.mp4\" -start_number 0 -hls_segment_filename \"/config/cache/transcodes/dfc54dddc82ad8734652204fab2d8b7b%d.mp4\" -hls_playlist_type vod -hls_list_size 0 -y \"/config/cache/transcodes/dfc54dddc82ad8734652204fab2d8b7b.m3u8\""
[2024-08-16 14:52:41.913 +01:00] [INF] [47] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 0
[2024-08-16 14:52:43.379 +01:00] [ERR] [35] Jellyfin.Plugin.Simkl.Services.PlaybackScrobbler: Can't scrobble: User "USER2" not logged in (True)
[2024-08-16 14:52:48.280 +01:00] [INF] [44] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: Deleting partial stream file(s) "/config/cache/transcodes/dfc54dddc82ad8734652204fab2d8b7b.m3u8"
[2024-08-16 14:52:50.153 +01:00] [INF] [40] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app "Jellyfin Web" "10.9.9" playing "FILE_TITLE". Stopped at "13556" ms
[2024-08-16 14:53:17.970 +01:00] [ERR] [36] Jellyfin.Plugin.Simkl.Services.PlaybackScrobbler: Can't scrobble: User "USER2" not logged in (True)

FFmpeg logs

No error logs of relevance in FFMpeg.

Client / Browser logs

No logs of relevance appear in the browser.

Relevant screenshots or videos

image
image

Additional information

No response

Activity

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

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    • Status

      Can't Reproduce
    • Status

      Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions