Jellyfin Forum
Judder in JF but not MPV - 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: Judder in JF but not MPV (/t-judder-in-jf-but-not-mpv)

Pages: 1 2


Judder in JF but not MPV - nope - 2023-07-10

(Updated 8/26)

I am experiencing judder/stutter in Jellyfin but not in MPV using the exact same config file. Same problem after lots of troubleshooting and reinstalling Windows. I have been fighting this issue for months and difference is extremely palpable. I am not using any transcoding.

It's as if JF is applying some other MPV settings that I have not specified.

  1. d3d11-flip=no definitely increases the amount of judder. But some videos will not start properly without it. In standalone MPV I will either see a white screen or just hear audio. For now I am disabling it because most videos work fine without it. But it may offer a hint as to what is causing my issue.
  2. I deployed a 5gb ethernet adapter to my HTPC. I am now getting almost 300MB/s on this machine from my server, so that's probably not an issue.
  3. The HTPC is a AMD Ryzen 7 3750H 4-core with 16 GB RAM. Not breaking 15% CPU playing huge files.
  4. The server is a 24-core Threadripper with like 13% of its resources in use. I am running the JF docker on unRAID.

Config settings I have tried I have tried individually and in various combination:
  • video-sync=display-resample
  • interpolation=yes
  • tscale=oversample
  • vo=gpu-next,gpu-hq (and others)
  • gpu-api=d3d11
  • hwdec=auto,safe-auto,no,d3d11va,d3d11

Log: https://pastebin.com/HnKxyb4q

MPV config:
Code:
subs-with-matching-audio=no
fullscreen=yes
cursor-autohide=100
audio-exclusive=yes
audio-spdif=ac3,dts,eac3,dts-hd,truehd
d3d11-flip=no
hwdec=auto

JF config:
Code:
{
    "sections": {
        "appleremote": {
            "emulatepht": true
        },
        "audio": {
            "channels": "auto",
            "device": "wasapi/{f970f524-4c79-4b3d-a216-ad234d2588d2}",
            "devicetype": "hdmi",
            "exclusive": true,
            "normalize": false,
            "passthrough.ac3": true,
            "passthrough.dts": true,
            "passthrough.dts-hd": true,
            "passthrough.eac3": true,
            "passthrough.truehd": true
        },
        "cec": {
            "activatesource": true,
            "enable": true,
            "hdmiport": 0,
            "poweroffonstandby": false,
            "suspendonstandby": false,
            "usekeyupdown": false,
            "verbose_logging": false
        },
        "main": {
            "alwaysOnTop": false,
            "autodetectCertBundle": false,
            "checkForUpdates": true,
            "disablemouse": false,
            "enableInputRepeat": true,
            "enableWindowsMediaIntegration": true,
            "enableWindowsTaskbarIntegration": true,
            "forceAlwaysFS": false,
            "forceExternalWebclient": false,
            "forceFSScreen": "",
            "fullscreen": true,
            "hdmi_poweron": false,
            "ignoreSSLErrors": false,
            "layout": "desktop",
            "logLevel": "debug",
            "minimizeOnDefocus": false,
            "sdlEnabled": true,
            "showPowerOptions": true,
            "useOpenGL": false,
            "useSystemVideoCodecs": false,
            "userWebClient": "",
            "webMode": "desktop"
        },
        "path": {
            "startupurl_desktop": "bundled",
            "startupurl_extension": "bundled"
        },
        "plugins": {
            "jellyscrub": false,
            "skipintro": false
        },
        "subtitles": {
            "color": "#EEEEEE,#000000",
            "placement": "center,bottom",
            "size": 32
        },
        "system": {
            "lircd_enabled": false,
            "smbd_enabled": false,
            "sshd_enabled": false,
            "systemname": "JellyfinMediaPlayer"
        },
        "video": {
            "allow_transcode_to_hevc": false,
            "always_force_transcode": false,
            "aspect": "normal",
            "audio_delay.24hz": 0,
            "audio_delay.25hz": 0,
            "audio_delay.50hz": 0,
            "audio_delay.normal": 0,
            "cache": 500,
            "debug.force_vo": "",
            "deinterlace": false,
            "force_transcode_4k": false,
            "force_transcode_av1": false,
            "force_transcode_dovi": false,
            "force_transcode_hdr": false,
            "force_transcode_hevc": false,
            "force_transcode_hi10p": false,
            "hardwareDecoding": "enabled",
            "prefer_transcode_to_h265": false,
            "refreshrate.auto_switch": false,
            "refreshrate.avoid_25hz_30hz": true,
            "refreshrate.delay": 3,
            "sync_mode": "audio"
        }
    },
    "version": 6
}

Update: I am experiencing serious judder with every single file I play in Jellyfin. In MPV standalone, everything is smooth.

Here's a file I've tested with:

Code:
Format                                  : Matroska
Format version                          : Version 4
File size                                : 6.48 GiB
Duration                                : 1 h 32 min
Overall bit rate                        : 10.0 Mb/s
Frame rate                              : 23.976 FPS
Encoded date                            : 2023-06-25 13:39:52 UTC
Writing application                      : HandBrake 1.6.1 2023062100
Writing library                          : Lavf59.27.100
ErrorDetectionType                      : Per level 1

Video
ID                                      : 1
Format                                  : AV1
Format/Info                              : AOMedia Video 1
Format profile                          : Main@L5.0
HDR format                              : SMPTE ST 2086, HDR10 compatible
Codec ID                                : V_AV1
Duration                                : 1 h 32 min
Bit rate                                : 9 164 kb/s
Width                                    : 3 840 pixels
Height                                  : 1 608 pixels
Display aspect ratio                    : 2.40:1
Frame rate mode                          : Constant
Frame rate                              : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                      : 4:2:0
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                      : 0.062
Stream size                              : 5.93 GiB (92%)
Default                                  : Yes
Forced                                  : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 970
MaxCLL_Original                          : 970 cd/m2
Maximum Frame-Average Light Level        : 340
MaxFALL_Original                        : 340 cd/m2

Audio
ID                                      : 2
Format                                  : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                : A_AC3
Duration                                : 1 h 32 min
Bit rate mode                            : Constant
Bit rate                                : 640 kb/s
Channel(s)                              : 6 channels
Channel layout                          : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                              : 31.250 FPS (1536 SPF)
Compression mode                        : Lossy
Stream size                              : 424 MiB (6%)
Title                                    : Surround
Language                                : English
Service kind                            : Complete Main
Default                                  : Yes
Forced                                  : No

Here's another one that had some lag and judder, although I didn't use it to test as much:

Code:
Format                                  : Matroska
Format version                          : Version 4
File size                                : 65.0 GiB
Duration                                : 2 h 5 min
Overall bit rate mode                    : Variable
Overall bit rate                        : 74.3 Mb/s
Frame rate                              : 23.976 FPS
Writing application                      : mkvmerge v65.0.0 ('Too Much') 64-bit
Writing library                          : libebml v1.4.2 + libmatroska v1.6.4

Video
ID                                      : 1
Format                                  : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                          : Main 10@L5.1@High
HDR format                              : SMPTE ST 2086, HDR10 compatible
Codec ID                                : V_MPEGH/ISO/HEVC
Duration                                : 2 h 5 min
Bit rate                                : 67.7 Mb/s
Width                                    : 3 840 pixels
Height                                  : 2 160 pixels
Display aspect ratio                    : 16:9
Frame rate mode                          : Constant
Frame rate                              : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                      : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                      : 0.340
Stream size                              : 59.2 GiB (91%)
Writing library                          : 4K-HDR.by.BLKFLX
Default                                  : Yes
Forced                                  : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 798 cd/m2
Maximum Frame-Average Light Level        : 257 cd/m2

Audio #1
ID                                      : 2
Format                                  : DTS XLL
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD Master Audio
Codec ID                                : A_DTS
Duration                                : 2 h 5 min
Bit rate mode                            : Variable
Bit rate                                : 3 328 kb/s
Channel(s)                              : 8 channels
Channel layout                          : C L R LFE Lb Rb Lss Rss
Sampling rate                            : 48.0 kHz
Frame rate                              : 93.750 FPS (512 SPF)
Bit depth                                : 16 bits
Compression mode                        : Lossless
Stream size                              : 2.91 GiB (4%)
Title                                    : English (DTS-HDMA 5.1)
Language                                : English
Default                                  : Yes
Forced                                  : No

Audio #2
ID                                      : 3
Format                                  : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                : A_AC3
Duration                                : 2 h 5 min
Bit rate mode                            : Constant
Bit rate                                : 640 kb/s
Channel(s)                              : 6 channels
Channel layout                          : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                              : 31.250 FPS (1536 SPF)
Compression mode                        : Lossy
Stream size                              : 573 MiB (1%)
Title                                    : English (Dolby Digital 5.1)
Language                                : English
Service kind                            : Complete Main
Default                                  : Yes
Forced                                  : No

Audio #3
ID                                      : 4
Format                                  : DTS ES XXCH
Format/Info                              : Digital Theater Systems
Commercial name                          : DTS-HD High Resolution Audio
Codec ID                                : A_DTS
Duration                                : 2 h 5 min
Bit rate mode                            : Constant
Bit rate                                : 2 046 kb/s
Channel(s)                              : 8 channels
Channel layout                          : C L R Ls Rs LFE Lb Rb
Sampling rate                            : 48.0 kHz
Frame rate                              : 93.750 FPS (512 SPF)
Bit depth                                : 24 bits
Compression mode                        : Lossy
Stream size                              : 1.79 GiB (3%)
Title                                    : German (DTS-HDHRA 5.1)
Language                                : German
Default                                  : Yes
Forced                                  : No

Audio #4
ID                                      : 5
Format                                  : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                : A_AC3
Duration                                : 2 h 5 min
Bit rate mode                            : Constant
Bit rate                                : 640 kb/s
Channel(s)                              : 6 channels
Channel layout                          : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                              : 31.250 FPS (1536 SPF)
Compression mode                        : Lossy
Stream size                              : 573 MiB (1%)
Title                                    : German (Dolby Digital 5.1)
Language                                : German
Service kind                            : Complete Main
Default                                  : Yes
Forced                                  : No



RE: Judder in JF but not MPV - khf620 - 2023-07-17

Have you tried using video-sync=display-resample in your JF mpv config?


RE: Judder in JF but not MPV - TheDreadPirate - 2023-07-17

We should need to know more about the media you are trying to play back, particularly the codecs of the video. And more specs about both the server and playback system.


RE: Judder in JF but not MPV - nope - 2023-07-18

(Info removed and put in first post)


RE: Judder in JF but not MPV - TheDreadPirate - 2023-07-18

What GPU does the server have? Your Vega 10 cannot accelerate the first video. Maybe the second video. Not sure about 10bit/HDR support on VCN 1.

They definitely need to be transcoded. The AV1 video is almost certainly being decoded by the CPU.


RE: Judder in JF but not MPV - nope - 2023-07-18

(2023-07-18, 03:03 AM)TheDreadPirate Wrote: What GPU does the server have?  Your Vega 10 cannot accelerate the first video.  Maybe the second video.  Not sure about 10bit/HDR support on VCN 1.

They definitely need to be transcoded.  The AV1 video is almost certainly being decoded by the CPU.

Why would I want to reduce the quality of the video? The whole point is to enjoy the videos at full quality. Which I can do in MPV, but not Jellyfin.


RE: Judder in JF but not MPV - TheDreadPirate - 2023-07-18

Decoding 4K content in software is no small task for a CPU.  All the jitter you are experiencing is probably frame pacing issues due to the software decoding and other processes competing for limited resources.  As video resolution and codec computational requirements increased so did the importance of hardware acceleration.

I've mentioned this in the JF Matrix chat, but I will mention it here again.  The key to a smooth JF experience is to

1.  Know what server and playback hardware you have
2.  Know what your server and playback hardware is capable of
3.  Know your media library

When your library (mainly videos codecs) lines up with what your server GPU hardware can decode you will have a smooth transcode experience.  When your library lines up with what your playback hardware can decode you will have a smooth direct play experience.

Here you have a lot of disconnects between your hardware and your library.  The Vega 10 in your Ryzen 3750H can't decode AV1 at all, and probably can't decode 10-bit HEVC.  The documentation I could find doesn't distinguish between 8-bit HEVC, which it can decode, and 10-bit.

For the record, the point of Jellyfin is to stream your content to any device.  And that will often mean transcoding.  Full quality is the bonus if all your ducks are in a row.

Code:
2023-07-09 18:16:59.765 [critical] unknown @ 0 - ffmpeg/video: av1: Failed setup for format dxva2_vld: hwaccel initialisation returned error.
2023-07-09 18:16:59.765 [debug] unknown @ 0 - vd: Pixel formats supported by decoder: d3d11va_vld d3d11 cuda yuv420p10le yuv420p10le
2023-07-09 18:16:59.765 [debug] unknown @ 0 - vd: Codec profile: Main (0x0)
2023-07-09 18:16:59.765 [debug] unknown @ 0 - vd: Requesting pixfmt 'yuv420p10le' from decoder.
[b][i][u]2023-07-09 18:16:59.765 [critical] unknown @ 0 - ffmpeg/video: av1: Your platform doesn't support hardware accelerated AV1 decoding.
2023-07-09 18:16:59.765 [critical] unknown @ 0 - ffmpeg/video: av1: Failed to get pixel format.
2023-07-09 18:16:59.765 [warning] unknown @ 0 - vd: Error while decoding frame (hardware decoding)!
2023-07-09 18:16:59.765 [debug] unknown @ 0 - vd: Falling back to software decoding.
2023-07-09 18:16:59.765 [debug] unknown @ 0 - vd: Detected 8 logical cores.
2023-07-09 18:16:59.765 [debug] unknown @ 0 - vd: Requesting 9 threads for decoding.[/u][/i][/b]



RE: Judder in JF but not MPV - nope - 2023-07-18

(2023-07-18, 04:02 PM)TheDreadPirate Wrote: Decoding 4K content in software is no small task for a CPU.  All the jitter you are experiencing is probably frame pacing issues due to the software decoding and other processes competing for limited resources.  As video resolution and codec computational requirements increased so did the importance of hardware acceleration.

I've mentioned this in the JF Matrix chat, but I will mention it here again.  The key to a smooth JF experience is to

1.  Know what server and playback hardware you have
2.  Know what your server and playback hardware is capable of
3.  Know your media library

When your library (mainly videos codecs) lines up with what your server GPU hardware can decode you will have a smooth transcode experience.  When your library lines up with what your playback hardware can decode you will have a smooth direct play experience.


I do have a smooth playback experience. I have 100% smooth and perfect playback experience. I have smooth playback in MPV.

MPV works perfectly for me.

I am posting in the Jellyfin forum to find out what is wrong with Jellyfin, because I am experiencing judder ONLY in Jellyfin.

My HTPC is not even breaking 15% CPU use when decoding these files.

Thanks for your help.


RE: Judder in JF but not MPV - nope - 2023-08-27

Can I bump this thread? I still need help with this. I have updated the first post.


RE: Judder in JF but not MPV - TheDreadPirate - 2023-08-27

I'm not sure how to help you. You shouldn't need to tweak all these settings in the player.

Even if the CPU usage is low there can be issues with frame pacing when you are software decoding.

1. Look into using VAAPI for decoding.

https://devblogs.microsoft.com/directx/video-acceleration-api-va-api-now-available-on-windows/

2. Turn on transcoding
3. Add a GPU into your HTPC that supports AV1 decoding