jellyfin / jellyfin-tizen

Jellyfin Samsung TV Client
https://jellyfin.org
920 stars 71 forks source link

HEVC video playback error on Samsung The Frame 2019 using Jellyfin Tizen #286

Open mjeshurun opened 3 weeks ago

mjeshurun commented 3 weeks ago

Hi friends,

I own a Samsung The Frame 2019 tv and I'm running Jellyfin Tizen on it. My Jellyfin server is installed on Unraid as a docker container and is updated to Jellyfin 10.9.9.

For some reason, my TV fails to play all HEVC video files and I'm getting playback errors for these videos, while my laptop computer is able to play the same videos.

I enabled hardware decoding for HEVC, but it doesn't fix this.

Is there a way I can make these video files play on my tv?

Hope someone can help 🙏

dmitrylyzo commented 3 weeks ago
  1. Tizen app uses embedded webui, so you need to update it too.
  2. Please post media info of the problematic file.
  3. Any errors in the server log?
mjeshurun commented 3 weeks ago

Hi @dmitrylyzo , Thank you for your reply.

I keep the Jellyfin Tizen app updated too. It's also updated with jellyfin-web 10.9.9.

I think I found a bunch of ffmpeg transcode log files created for this issue. Here is one of them:

File name: FFmpeg.Transcode-2024-08-17_21-32-57_c9d4528a903f6d28a7fa676c8ddfa5a5_93ba41a4.log

[21:57:49] [INF] [86] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay generation: /usr/lib/jellyfin-ffmpeg/ffmpeg -loglevel error -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i file:"/data/media/movies/The Princess Bride (1987)/The.Princess.Bride.1987.REMASTERED.1080p.BluRay.H264.AAC.mp4" -noautoscale -an -sn -vf "fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=w=320:h=172:format=nv12:extra_hw_frames=24,hwmap=derive_device=qsv,format=qsv" -threads 1 -c:v mjpeg_qsv -qscale:v 4 -f image2 "/config/cache/temp/d76e337bf5dc45bda32d4d8e090a4ba6/%08d.jpg"

As for the Jellyfin log file, I found this part with the playback error. It repeats a few more times again later:

[2024-08-17 21:25:51.532 +03:00] [INF] [10] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "mjeshurun". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True [2024-08-17 21:25:52.460 +03:00] [INF] [51] MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor: "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-dump_attachment:t \"\" -y -i file:\"/data/media/movies/The Princess Bride (1987)/The.Princess.Bride.1987.1080p.bdrip.x265.5.1.AAC-FINKLEROY.mkv\" -t 0 -f null null" [2024-08-17 21:25:52.500 +03:00] [ERR] [51] Trakt.ServerMediator: Event details incomplete. Cannot process current media [2024-08-17 21:25:52.578 +03:00] [INF] [51] MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor: ffmpeg attachment extraction completed for "file:\"/data/media/movies/The Princess Bride (1987)/The.Princess.Bride.1987.1080p.bdrip.x265.5.1.AAC-FINKLEROY.mkv\"" to "/config/cache/attachments/c9d4528a903f6d28a7fa676c8ddfa5a5" [2024-08-17 21:25:52.580 +03:00] [INF] [51] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -probesize 1G -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -canvas_size 1920x1080 -i file:\"/data/media/movies/The Princess Bride (1987)/The.Princess.Bride.1987.1080p.bdrip.x265.5.1.AAC-FINKLEROY.mkv\" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:0 -codec:v:0 hevc_qsv -tag:v:0 hvc1 -preset veryfast -b:v 10284731 -maxrate 10284731 -bufsize 20569462 -profile:v:0 main -level 40 -g:v:0 72 -keyint_min:v:0 72 -filter_complex \"[0:18]scale=-1:1080:fast_bilinear,scale,crop,pad=max(1920\,iw):max(1080\,ih):(ow-iw)/2:(oh-ih)/2:black@0,crop=1920:1080,format=bgra,hwupload=derive_device=qsv:extra_hw_frames=64[sub];[0:0]setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12:extra_hw_frames=24,hwmap=derive_device=qsv,format=qsv[main];[main][sub]overlay_qsv=eof_action=pass:repeatlast=0:w=1920:h=1080\" -start_at_zero -codec:a:0 copy -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename \"75e1f35c7ffc9b9d38653a50583c162f-1.mp4\" -start_number 0 -hls_segment_filename \"/config/data/transcodes/75e1f35c7ffc9b9d38653a50583c162f%d.mp4\" -hls_playlist_type vod -hls_list_size 0 -y \"/config/data/transcodes/75e1f35c7ffc9b9d38653a50583c162f.m3u8\"" [2024-08-17 21:25:53.501 +03:00] [ERR] [67] Trakt.ServerMediator: Event details incomplete. Cannot process current media [2024-08-17 21:25:54.705 +03:00] [INF] [47] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "mjeshurun". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True [2024-08-17 21:25:54.744 +03:00] [INF] [51] MediaBrowser.Controller.MediaEncoding.TranscodingJob: Stopping ffmpeg process with q command for "/config/data/transcodes/75e1f35c7ffc9b9d38653a50583c162f.m3u8" [2024-08-17 21:25:54.910 +03:00] [WRN] [67] Trakt.ServerMediator: Received playback progress from user "mjeshurun" but initial state was never set - setting it now! [2024-08-17 21:25:54.922 +03:00] [INF] [51] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 0 [2024-08-17 21:25:54.923 +03:00] [INF] [51] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: Deleting partial stream file(s) "/config/data/transcodes/75e1f35c7ffc9b9d38653a50583c162f.m3u8"

dmitrylyzo commented 3 weeks ago

Try disabling Settings / Playback / Prefer fMP4 on the TV. It mostly doesn't work on Tizen and webOS.

mjeshurun commented 3 weeks ago

Thank you for the suggestion, @dmitrylyzo .

I tried your suggestion and did a bit more "digging", and it seems the issue is not caused by the fMP4 setting, but due to the built-in movie subtitles being saved in an unsupported codec for my tv.

When I disable the built-in subtitles (or when I use external subtitles), the movie plays ok, but when the built-in subtitles are enabled the movie doesn't start.

Are you, by chance, familiar with a fix for this?

dmitrylyzo commented 3 weeks ago

All I see in the logs is extracting some kind of attachment (probably a font) and transcoding to HEVC. The TV then probably stops playback (q command to ffmpeg).

Please post media info of the problematic file. You can copy it from More (3dot) on the item / Media Info, there's copy button. And wrap it with a "code" block (```).

mjeshurun commented 3 weeks ago

Here is all the file info:

The.Princess.Bride.1987.1080p.bdrip.x265.5.1.AAC-FINKLEROY
Container: mkv
Path: /data/media/movies/The Princess Bride (1987)/The.Princess.Bride.1987.1080p.bdrip.x265.5.1.AAC-FINKLEROY.mkv
Size: 7236 MB

Video
Title: 1080p HEVC SDR
Codec: HEVC
AVC: No
Profile: Main
Level: 120
Resolution: 1920x1080
Aspect ratio: 16:9
Anamorphic: No
Interlaced: No
Framerate: 23.976025
Bitrate: 10284 kbps
Bit depth: 8 bit
Video range: SDR
Video range type: SDR
Color space: bt709
Color transfer: bt709
Color primaries: bt709
Pixel format: yuv420p
Ref frames: 1

Audio
Title: Surround 5.1 - English - AAC - Default
Language: eng
Codec: AAC
AVC: No
Profile: LC
Layout: 5.1
Channels: 6 ch
Bitrate: 320 kbps
Sample rate: 48000 Hz
Default: Yes
Forced: No
External: No

Audio
Title: Surround 5.1 - English - AAC
Language: eng
Codec: AAC
AVC: No
Profile: LC
Layout: 5.1
Channels: 6 ch
Bitrate: 320 kbps
Sample rate: 48000 Hz
Default: No
Forced: No
External: No

Audio
Title: Stereo - English - AAC
Language: eng
Codec: AAC
AVC: No
Profile: LC
Layout: stereo
Channels: 2 ch
Bitrate: 192 kbps
Sample rate: 48000 Hz
Default: No
Forced: No
External: No

Audio
Title: Stereo - English - AAC
Language: eng
Codec: AAC
AVC: No
Profile: LC
Layout: stereo
Channels: 2 ch
Bitrate: 192 kbps
Sample rate: 48000 Hz
Default: No
Forced: No
External: No

Audio
Title: Stereo - Fre - AAC
Language: fre
Codec: AAC
AVC: No
Profile: LC
Layout: stereo
Channels: 2 ch
Bitrate: 192 kbps
Sample rate: 48000 Hz
Default: No
Forced: No
External: No

Audio
Title: Stereo - Ger - AAC
Language: ger
Codec: AAC
AVC: No
Profile: LC
Layout: stereo
Channels: 2 ch
Bitrate: 192 kbps
Sample rate: 48000 Hz
Default: No
Forced: No
External: No

Audio
Title: Mono - Russian - AAC
Language: rus
Codec: AAC
AVC: No
Profile: LC
Layout: mono
Channels: 1 ch
Bitrate: 192 kbps
Sample rate: 48000 Hz
Default: No
Forced: No
External: No

Audio
Title: Mono - Russian - AAC
Language: rus
Codec: AAC
AVC: No
Profile: LC
Layout: mono
Channels: 1 ch
Bitrate: 192 kbps
Sample rate: 48000 Hz
Default: No
Forced: No
External: No

Audio
Title: Mono - Spanish - AAC
Language: spa
Codec: AAC
AVC: No
Profile: LC
Layout: mono
Channels: 1 ch
Bitrate: 192 kbps
Sample rate: 48000 Hz
Default: No
Forced: No
External: No

Audio
Title: Mono - Spanish - AAC
Language: spa
Codec: AAC
AVC: No
Profile: LC
Layout: mono
Channels: 1 ch
Bitrate: 192 kbps
Sample rate: 48000 Hz
Default: No
Forced: No
External: No

Audio
Title: Mono - Spanish - AAC
Language: spa
Codec: AAC
AVC: No
Profile: LC
Layout: mono
Channels: 1 ch
Bitrate: 192 kbps
Sample rate: 48000 Hz
Default: No
Forced: No
External: No

Subtitle
Title: Danish - PGSSUB
Language: dan
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Danish - PGSSUB
Language: dan
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Danish - PGSSUB
Language: dan
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Dut - PGSSUB
Language: dut
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Dut - PGSSUB
Language: dut
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Dut - PGSSUB
Language: dut
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: English - PGSSUB
Language: eng
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: English - PGSSUB
Language: eng
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: English - PGSSUB
Language: eng
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Finnish - PGSSUB
Language: fin
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Finnish - PGSSUB
Language: fin
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Finnish - PGSSUB
Language: fin
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Fre - PGSSUB
Language: fre
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Fre - PGSSUB
Language: fre
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Fre - PGSSUB
Language: fre
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Ger - PGSSUB
Language: ger
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Ger - PGSSUB
Language: ger
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Ger - PGSSUB
Language: ger
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Norwegian - PGSSUB
Language: nor
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Norwegian - PGSSUB
Language: nor
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Norwegian - PGSSUB
Language: nor
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Russian - PGSSUB
Language: rus
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Russian - PGSSUB
Language: rus
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Russian - PGSSUB
Language: rus
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Spanish - PGSSUB
Language: spa
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Spanish - PGSSUB
Language: spa
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Spanish - PGSSUB
Language: spa
Codec: PGSSUB
AVC: No
Default: No
Forced: No
External: No

Subtitle
Title: Spanish - PGSSUB
Language: spa
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Spanish - PGSSUB
Language: spa
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Swedish - PGSSUB
Language: swe
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Swedish - PGSSUB
Language: swe
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Swedish - PGSSUB
Language: swe
Codec: PGSSUB
AVC: No
Resolution: 1920x1080
Default: No
Forced: No
External: No

Subtitle
Title: Undefined - SUBRIP - External
Codec: SUBRIP
AVC: No
Default: No
Forced: No
External: Yes
dmitrylyzo commented 3 weeks ago

So, it is PGS. By default PGS should be burnt-in (Settings / Subtitles / Burn... / Auto), and this leads to transcoding. Technically, TV only receives video+audio.

With SRT, you probably get DirectPlay or Remux (for secondary audio tracks) - video and audio remain unchanged.

  1. Does the video play Direct/Remux on the laptop? And what client do you use?
  2. Any errors in FFmpeg.Transcode*.log? I doubt it, but still.
  3. Try disabling HEVC encoding on the server. To check if HEVC is causing the problem. This will force using another video codec (ideally, H264).
  4. Try disabling HEVC encoding and hardware acceleration. To check if hardware acceleration is causing the problem.
mjeshurun commented 3 weeks ago

My subtitles settings on Jellyfin Tizen were set to Burn/Auto, but I also tried to set it to All and it also doesn't work.

  1. on the laptop the video plays after transcoding:
Transcoding
The media is being converted into a format that is compatible with the device that is playing the media.
Framerate: 272fps

17.4 Mbps MP4 H264 AAC

Reason for transcoding
The container is not supported
The video codec is not supported
The audio codec is not supported
The subtitle codec is not supported
  1. Disabling the server setting option for: Allow encoding in HEVC format fixed it. The movie takes a few seconds to start playing, but it works 🙏 So I guess the problem lies with HEVC encoding.

  2. Seems like this test is not needed.

mjeshurun commented 3 weeks ago
  1. This is the ffmpeg.transcode*.log file I wanted to add it as a code section, but I got an error saying the message exceeds the maximum characters limit.

FFmpeg.Transcode-2024-08-18_17-24-45_c9d4528a903f6d28a7fa676c8ddfa5a5_7327293f.log

dmitrylyzo commented 3 weeks ago

The movie takes a few seconds to start playing, but it works 🙏 So I guess the problem lies with HEVC encoding.

Looks like it.

  1. This is the ffmpeg.transcode*.log file I wanted to add it as a code section, but I got an error saying the message exceeds the maximum characters limit.

FFmpeg.Transcode-2024-08-18_17-24-45_c9d4528a903f6d28a7fa676c8ddfa5a5_7327293f.log

I guess this is for H264, which is working. Could you post the logs when HEVC is enabled (revert step 3)?