Jellyfin Forum
SOLVED: Troubleshooting: Stuttering on Apple TV, specific show - 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: SOLVED: Troubleshooting: Stuttering on Apple TV, specific show (/t-solved-troubleshooting-stuttering-on-apple-tv-specific-show)

Pages: 1 2


Troubleshooting: Stuttering on Apple TV, specific show - kyeotic - 2024-02-13

I've been using Jellyfin for a few weeks now without any playback issues on several movies and series. I have hardware acceleration setup, and I've been able to play Dolby Vision and HDR content successfully.

On a specific show on Apple TV, using Swiftfin, I am getting stuttering. 0-1 second freezes every 2-5 seconds. I've tried a few different versions of the show (all 2160p, so maybe the same actual release?) and they all do it. Its just this one show though, and only on Swiftfin. The web player has no issues from a PC on the same files.

My Setup

Client
Apple TV 4K, on LG 4k TV
Swiftin (default settings; when using "Native Player" the file has audio but no video)

Server
CPU: AMD Ryzen 5 7600 6-Core Processor
RAM: 96GB

Jellyfin in Docker
Server: 8596c24a3e6d
Version: 10.8.13
Operating System: Linux
Architecture: X64

I'm not sure what the etiquette is on including the specific show in logs, so I have redacted it. Since its this specific series I can see how it might be relevant, I can provide it on request.

I would appreciate any tips on troubleshooting this, even if its just how to identify the issue and not fix it.


RE: Troubleshooting: Stuttering on Apple TV, specific show - tmsrxzar - 2024-02-13

since it's being direct played there's not much to see on the jellyfin server side, as long as it's able to serve it fast enough it's job done

mediainfo for the file in question might have more clues, redacted names is fine there's not a lot in a name


RE: Troubleshooting: Stuttering on Apple TV, specific show - kyeotic - 2024-02-13

Here is the media info (not sure why code is putting double line break...)

Code:
General
UniqueID/String                  : 337344475145708435519323828003244274112 (0xFDCA2EC08E56B93CFF1EB4217F4EF1C0)
CompleteName                    : M:\shows\-REDACTED-\Season 02\-REDACTED- [WEBDL-2160p][HDR10Plus][EAC3 Atmos 5.1][h265]-NTb.mkv
Format/String                    : Matroska
Format_Version                  : Version 4
FileSize/String                  : 4.94 GiB
Duration/String                  : 49 min 45 s
OverallBitRate/String            : 14.2 Mb/s
FrameRate/String                : 23.976 FPS
Encoded_Application/String      : mkvmerge v78.0 ('Running') 64-bit
Encoded_Library/String          : libebml v1.4.4 + libmatroska v1.7.1

Video
ID/String                        : 1
Format/String                    : HEVC
Format/Info                      : High Efficiency Video Coding
Format_Profile                  : Main 10@L5@Main
HDR_Format/String                : SMPTE ST 2094 App 4, Version 1, HDR10+ Profile B compatible
CodecID                          : V_MPEGH/ISO/HEVC
Duration/String                  : 49 min 45 s
BitRate/String                  : 13.6 Mb/s
Width/String                    : 3 840 pixels
Height/String                    : 1 920 pixels
DisplayAspectRatio/String        : 2.000
FrameRate_Mode/String            : Constant
FrameRate/String                : 23.976 (24000/1001) FPS
ColorSpace                      : YUV
ChromaSubsampling/String        : 4:2:0
BitDepth/String                  : 10 bits
Bits-(Pixel*Frame)              : 0.077
StreamSize/String                : 4.73 GiB (96%)
Default/String                  : Yes
Forced/String                    : No
colour_range                    : Limited
colour_primaries                : BT.2020
transfer_characteristics        : PQ
matrix_coefficients              : BT.2020 non-constant
MasteringDisplay_ColorPrimaries  : Display P3
MasteringDisplay_Luminance      : min: 0.0001 cd/m2, max: 1000 cd/m2
MaxCLL                          : 432 cd/m2
MaxFALL                          : 134 cd/m2

Audio
ID/String                        : 2
Format/String                    : E-AC-3 JOC
Format/Info                      : Enhanced AC-3 with Joint Object Coding
Format_Commercial_IfAny          : Dolby Digital Plus with Dolby Atmos
CodecID                          : A_EAC3
Duration/String                  : 49 min 45 s
BitRate_Mode/String              : Constant
BitRate/String                  : 576 kb/s
Channel(s)/String                : 6 channels
ChannelLayout                    : L R C LFE Ls Rs
SamplingRate/String              : 48.0 kHz
FrameRate/String                : 31.250 FPS (1536 SPF)
Compression_Mode/String          : Lossy
StreamSize/String                : 205 MiB (4%)
Language/String                  : English
ServiceKind/String              : Complete Main
Default/String                  : Yes
Forced/String                    : No
Complexity index                : 16
Number of dynamic objects        : 15
Bed channel count                : 1 channel
Bed channel configuration        : LFE



RE: Troubleshooting: Stuttering on Apple TV, specific show - tmsrxzar - 2024-02-13

i was hoping you would get a different answer by now but i guess not

from what i can see there should be no delivery issues of the file, it appears fairly small and the server should have no issues getting it to the client
the video codec should be supported, nothing strange with the profile or level that i see
EAC3 should be fine as well

potentially it's due to HDR10/HDR10+ on swiftfin

if you don't get an answer here on the forum follow up with an issue report on github https://github.com/jellyfin/Swiftfin/issues


RE: Troubleshooting: Stuttering on Apple TV, specific show - TheDreadPirate - 2024-02-13

My bad. Forgot to respond. Let's try repackaging the MKV file. A poorly authored MKV file can cause stuttering when it is direct played.

Code:
/usr/lib/jellyfin-ffmpeg/ffmpeg -fflags genpts -i "/path/to/your/video.mkv" -map 0:v -map 0:a -map 0:s -map_chapters 0 -c:v copy -c:a copy -c:s copy outputFile.mkv



RE: Troubleshooting: Stuttering on Apple TV, specific show - kyeotic - 2024-02-14

That worked! Thank you so much!

I don't suppose there is an easy way to do this to a whole season worth of files while overwriting them? I do not know my way around ffmpeg at all.


RE: Troubleshooting: Stuttering on Apple TV, specific show - tmsrxzar - 2024-02-14

(2024-02-14, 12:04 AM)kyeotic Wrote: That worked! Thank you so much!

I don't suppose there is an easy way to do this to a whole season worth of files while overwriting them? I do not know my way around ffmpeg at all.

2 challenges
1. windows
2. ffmpeg can't overwrite the file it's reading from

for 1.
i would write a single command into a text file, prefix with 'start /wait'
duplicate the line how ever many times is needed
save as a .cmd or .bat and run it from a console
if you're unfamiliar with scripting then perhaps start with just 2 lines

for 2. i would write the new files into a temp folder then in explorer just cut and paste over the originals from the temp folder


regular notepad would be fine but i can't help plug kate editor here since it's my favorite cross platform editor with line numbers https://kate-editor.org


RE: Troubleshooting: Stuttering on Apple TV, specific show - TheDreadPirate - 2024-02-14

You would need to write a for/while loop. Any loop would need to modify the command I provided with " < /dev/null" at the end of the ffmpeg command because of the way ffmpeg works. Something like this.

Code:
cd /tv/show/directory
ls *.mkv | while read origFile ; do /usr/lib/jellyfin-ffmpeg/ffmpeg -fflags genpts -i "$origFile" -map 0:v -map 0:a -map 0:s -map_chapters 0 -c:v copy -c:a copy -c:s copy newFile.mkv < /dev/null ; mv newFile.mkv "$origFile" ; done

If your files use ASS subs with font attachments, you will need to include "-c:t? copy" after "-c:s copy" so that it copies all the ASS subtitle fonts.


RE: Troubleshooting: Stuttering on Apple TV, specific show - kyeotic - 2024-02-14

I can make a script with a separate command for each file and then overwrite, I was just hoping that there was something built-in. I guess I could even make it re-usable by searching for mkv files in the current folder... might as well I guess.

Fwiw I'm running this command from inside the jellyfin container, so its Linux.

EDIT: wrote this before TheDreadPirate's second post, thanks for the dev/null pipe tip!


RE: Troubleshooting: Stuttering on Apple TV, specific show - tmsrxzar - 2024-02-14

(2024-02-14, 12:18 AM)kyeotic Wrote: Fwiw I'm running this command from inside the jellyfin container, so its Linux.

oh much easier
for f in *.mkv do ffmpeg -i $f...; done

use TDPs