Jellyfin Forum
SOLVED: MKV files arbitrarily not playing - 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: MKV files arbitrarily not playing (/t-solved-mkv-files-arbitrarily-not-playing)



MKV files arbitrarily not playing - devvphil - 2024-09-01

There is a completely arbitrary chance that an MKV file in my movie/show library will not work. Even files that used to play are just broken now. I know the browser version will have it's issues, but even the windows client?
The library sits on my NAS and I can play the files directly from it just fine with vlc or any other player. 
've been pretty frustated about this for the past week. You'd think an app like this, geared towards media consumption, would not completely shit the bed when it comes to files that every media player on the internet knows how to handle.
I've enabled everything related to transcoding in the settings and hardware accel is turned off since none of it seems work on the NAS CPU. I'm relatively new to homelab stuff, only built the server a couple months ago so I'm still pretty inexperienced.

NAS specs:
OS: TrueNas Scale 24.04.1.1
CPU: Ryzen 4600G with integrated graphics
No gpu

PC specs:
CPU: Ryzen 7 7700X
GPU: RTX 3090

Laptop specs:
CPU: Ryzen 5 5600H
GPU: RTX 3060

Jellyfin server version: 10.9.10

I gathered this log when jellyfin attempts to play a file and attached the full log as a text file.
I also attached an ffmpeg log.
Code:
2024-09-02T01:08:21.090472909+02:00 [01:08:21] [INF] [32] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: /usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -probesize 1G -ss 00:00:12.000 -f matroska -noautorotate -i file:"/mnt/media/Series/Arknights/Season 1/Arknights.S01E03.Escort.1080p.CR.WEB-DL.DDP5.1.H.264-ZigZag.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx265 -tag:v:0 hvc1 -preset veryfast -crf 28 -maxrate 4921264 -bufsize 9842528 -x265-params:0 no-info=1 -force_key_frames:0 "expr:gte(t,n_forced*3)" -bf 0 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,1920)/2)*2:trunc(ow/a/2)*2,format=yuv420p" -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 3 -hls_segment_type mpegts -start_number 4 -hls_segment_filename "/cache/transcodes/9aacdba0b01fd2112f48cd34c91d15c3%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/cache/transcodes/9aacdba0b01fd2112f48cd34c91d15c3.m3u8"
2024-09-02T01:08:21.569663565+02:00 [01:08:21] [INF] [18] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 100.78.5.83 closed
2024-09-02T01:08:23.742753953+02:00 [01:08:23] [ERR] [28] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 243
2024-09-02T01:08:23.805236033+02:00 [01:08:23] [ERR] [28] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL GET /videos/51ffb75c-1a01-422d-f195-365545f95eb2/hls1/main/4.ts.
2024-09-02T01:08:23.805306275+02:00 MediaBrowser.Common.FfmpegException: FFmpeg exited with code 243



RE: MKV files arbitrarily not playing - TheDreadPirate - 2024-09-02

Code:
[hls @ 0x563199c629c0] Failed to open segment 'bdfdcc2962cb3c8f489bbb63c10fc24f-1.mp4'
[out#0/hls @ 0x563199d65480] Could not write header (incorrect codec parameters ?): Permission denied

Do you have permissions to write to the directory that you mounted /cache?


RE: MKV files arbitrarily not playing - devvphil - 2024-09-02

(2024-09-02, 12:17 AM)TheDreadPirate Wrote:
Code:
[hls @ 0x563199c629c0] Failed to open segment 'bdfdcc2962cb3c8f489bbb63c10fc24f-1.mp4'
[out#0/hls @ 0x563199d65480] Could not write header (incorrect codec parameters ?): Permission denied

Do you have permissions to write to the directory that you mounted /cache?

Yes. It should have full access to any folder it wants since other files work just fine.

(2024-09-02, 12:17 AM)TheDreadPirate Wrote:
Code:
[hls @ 0x563199c629c0] Failed to open segment 'bdfdcc2962cb3c8f489bbb63c10fc24f-1.mp4'
[out#0/hls @ 0x563199d65480] Could not write header (incorrect codec parameters ?): Permission denied

Do you have permissions to write to the directory that you mounted /cache?

Well then. I think i probably fucked up some folder creation stuff?
I just set the cache folder the same as the config folder, seemingly no issues for the most part.
But now I tried adding a seperate cache folder and referred to that.
now it just works???


RE: MKV files arbitrarily not playing - devvphil - 2024-09-02

Right so i take back what I said about it being too dumb to handle basic files. I was just being an idiot with the setup.
But hardware accel still breaks those files so I just won't be using it.


RE: MKV files arbitrarily not playing - TheDreadPirate - 2024-09-02

You don't have hardware acceleration setup? What are your specs? And can you share your docker compose?


RE: MKV files arbitrarily not playing - devvphil - 2024-09-02

(2024-09-02, 12:40 AM)TheDreadPirate Wrote: You don't have hardware acceleration setup?  What are your specs?  And can you share your docker compose?

All of the specs are in my original post.
Since I use TrueNas there is no docker compose.

I did get hw accel working, just not for those specific files for some reason.


RE: MKV files arbitrarily not playing - TheDreadPirate - 2024-09-03

So now that you've got HWA setup, can you share a new ffmpeg log from one of the problem files?

And can you share screenshots of how you configured transcoding? Dashboard > Playback.