Jellyfin Forum
External ffmpeg process causing disk thrashing - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: External ffmpeg process causing disk thrashing (/t-external-ffmpeg-process-causing-disk-thrashing)



External ffmpeg process causing disk thrashing - podonnell - 2024-07-18

Hi,

I am using an external program that syncs up subtitles with the audio on the corresponding video file. This involves loading the audio stream into an ffmpeg process and analyzing for the length of the file. The process takes about 6 minutes when there's no disk activity, but if I'm watching a video on Jellyfin, it causes major disk thrashing, and the video playing freezes every few seconds.

I have tested playing the video file outside of Jellyfin -- with MPC-HC in this case -- and there is no freezing.

Any ideas why this might be problematic with Jellyfin but not externally?

The videos playing are in 4k, so a bit of disk bandwidth is needed. However they are direct plays and no transcode is happening, so the server should be otherwise idle.
Only the disk reaches 100% in task manager, all other resources look good.


RE: External ffmpeg process causing disk thrashing - TheDreadPirate - 2024-07-18

Is the media on a local hard drive or network share?


RE: External ffmpeg process causing disk thrashing - podonnell - 2024-07-18

(2024-07-18, 03:19 PM)TheDreadPirate Wrote: Is the media on a local hard drive or network share?

Local HD, I think? JellyFin is running on the same server that the files are contained on


RE: External ffmpeg process causing disk thrashing - TheDreadPirate - 2024-07-18

I don't recall you mentioning what your server OS and specs are in your other threads. What are the server specs?

If the server is Windows, what does task manager say for the disk usage?

If the server is Linux, use "iotop" to monitor disk usage. You will have to install that package since it isn't included in any Linux distro I've used.


RE: External ffmpeg process causing disk thrashing - podonnell - 2024-07-18

(2024-07-18, 04:08 PM)TheDreadPirate Wrote: I don't recall you mentioning what your server OS and specs are in your other threads.  What are the server specs?

If the server is Windows, what does task manager say for the disk usage?

If the server is Linux, use "iotop" to monitor disk usage.  You will have to install that package since it isn't included in any Linux distro I've used.

My server is pretty weak - Windows i7 4790k CPU using VAAPI and an old NVIDIA card that doesn't support NVENC, a 570 I think.
However the disk is a high speed disk used in servers and getting around 350 Mbps read/write in bandwidth tests.

In task manager, typically the disk is 20% or less when running a JellyFin video. But when this subtitle sync process runs, it goes to 100%.


RE: External ffmpeg process causing disk thrashing - TheDreadPirate - 2024-07-18

That server should be plenty fast in all regards. If it were on Linux.

For a short period of time I was running Plex, and later Jellyfin, on Windows with a low power Intel J4205 as my CPU. Whenever I played videos, even direct plays, Windows Defender hogged the CPU. Like 60% just for Windows Defender scanning what Jellyfin was doing. Because of this high CPU usage, and a slow-ish CPU, transcodes were out of the question. Doing ANYTHING else on the server caused Jellyfin to buffer.

I'm wondering if what you're experiencing is the same thing. Since watching via MPC-HC doesn't trigger the same Windows Defender behavior.

When you stream with Jellyfin, can you open Task Manager and monitor if the CPU usage spikes for Windows Defender?


RE: External ffmpeg process causing disk thrashing - theguymadmax - 2024-07-18

This sounds like normal behavior for windows Smiling-face


RE: External ffmpeg process causing disk thrashing - podonnell - 2024-07-24

(2024-07-18, 05:26 PM)TheDreadPirate Wrote: That server should be plenty fast in all regards.  If it were on Linux.

For a short period of time I was running Plex, and later Jellyfin, on Windows with a low power Intel J4205 as my CPU.  Whenever I played videos, even direct plays, Windows Defender hogged the CPU.  Like 60% just for Windows Defender scanning what Jellyfin was doing.  Because of this high CPU usage, and a slow-ish CPU, transcodes were out of the question.  Doing ANYTHING else on the server caused Jellyfin to buffer.

I'm wondering if what you're experiencing is the same thing.  Since watching via MPC-HC doesn't trigger the same Windows Defender behavior.

When you stream with Jellyfin, can you open Task Manager and monitor if the CPU usage spikes for Windows Defender?

Yep, watched the CPU and all other resources. Nothing goes above 10%. Oddly the transcoded videos that do make my CPU go up actually don't have the issue, but the direct plays that are only pulling direct from disk have the problem. 

This is definitely disk thrashing. The ffmpeg and jellyfin video stream are fighting over the read bandwidth of the hard drive.