Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10-bit HEVC video playback requests server to transcode instead of using hardware acceleration #4370

Open
julienbenjamin opened this issue Jan 3, 2025 · 4 comments
Labels
bug Something isn't working playback Issue related to media playback

Comments

@julienbenjamin
Copy link

julienbenjamin commented Jan 3, 2025

Describe the bug

  1. Start playback of a relevant video file (it seems to happen with video files using the yuv420p10le pixel format) on an AndroidTV device (0.18.3) from the Jellyfin server (10.10.3).
  2. Stop playback

Despite running the latest version of the client (0.18.3), HEVC video playback does not work for 10-bit encoded files. These file work well with the Jellyfin Media Player (desktop) client, as well as the web client (of course on different devices, not running Android).

This triggers a transcode every time (as shown in the log below).

Edit: I truly hope I do not make a mistake about the hardware capabilities regarding the video codecs supported by the SoC (Mediatek MT5893, fitted with an ARM Mali-G71 MP2) ; I cannot find a datasheet clearing this, the best I found was H.264/H.265 without more details.

Logs

[2025-01-03 02:28:48.023 +01:00] [INF] [31] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for "USERNAME". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[2025-01-03 02:28:48.309 +01:00] [INF] [31] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: "ffmpeg" "-analyzeduration 200M -probesize 1G -i file:"/path/to/video/file.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -codec:v:0 libx264 -preset veryfast -crf 23 -maxrate 9665360 -bufsize 19330720 -profile:v:0 high -x264opts:0 subme=0:me_range=16:rc_lookahead=10:me=hex:open_gop=0 -force_key_frames:0 "expr:gte(t,n_forced3)" -sc_threshold:v:0 0 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw,iha),min(4096,2304*a))/2)*2:trunc(min(max(iw/a,ih),min(4096/a,2304))/2)*2,format=yuv420p,subtitles=f='/var/db/jellyfin/data/subtitles/0/0b3acad4-8078-ba5a-0df4-ec8d44e1b950.ass':fontsdir='/var/cache/jellyfin/attachments/3fa644510da34d2cf2c573ed53dd5600'" -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 mpegts -start_number 0 -hls_segment_filename "/var/db/jellyfin/transcodes/d45e441498ae65b0edf998d5b1664fd1%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/var/db/jellyfin/transcodes/d45e441498ae65b0edf998d5b1664fd1.m3u8""
[2025-01-03 02:28:52.069 +01:00] [ERR] [14] Jellyfin.Drawing.Skia.SkiaEncoder: Unable to determine image dimensions for "/var/db/jellyfin/metadata/library/1e/1e3fea7e4f62d8d2519278ca7d8d4602/poster.jpg": InternalError
[2025-01-03 02:28:55.473 +01:00] [INF] [33] MediaBrowser.Controller.MediaEncoding.TranscodingJob: Stopping ffmpeg process with q command for "/var/db/jellyfin/transcodes/d45e441498ae65b0edf998d5b1664fd1.m3u8"
[2025-01-03 02:28:55.858 +01:00] [INF] [33] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 0
[2025-01-03 02:28:55.859 +01:00] [INF] [33] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: Deleting partial stream file(s) "/var/db/jellyfin/transcodes/d45e441498ae65b0edf998d5b1664fd1.m3u8"
[2025-01-03 02:28:57.360 +01:00] [INF] [35] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app "Android TV" "0.18.3" playing "Commencement". Stopped at "2438" ms

FFmpeg logs

Media info of the file

General
Unique ID                                : 283174511059139800434917306898279168066 (0xD5096D5212F75EA803B225CEAC79F842)
Complete name                            : /file/path.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 508 MiB
Duration                                 : 24 min 29 s
Overall bit rate                         : 2 900 kb/s
Frame rate                               : 23.976 FPS
Encoded date                             : 2018-11-24T14:40:40Z UTC
Writing application                      : HandBrake 1.0.7 2017040900
Writing library                          : Lavf57.7.2
Attachments                              : comicbd.ttf / FRADM.TTF / jesaya free.ttf / 26746.ttf

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L4@Main
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 24 min 29 s
Bit rate                                 : 2 458 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 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
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.049
Stream size                              : 431 MiB (85%)
Writing library                          : x265 2.3:[Linux][GCC 5.3.1][64 bit] 10bit
Encoding settings                        : cpuid=1173503 / frame-threads=2 / numa-pools=4 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x1080 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=24 / keyint=240 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=6 / scenecut=40 / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=2 / limit-refs=3 / no-limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=3 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / analysis-mode=0 / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=18.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=1 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=1 / transfer=1 / colormatrix=1 / chromaloc=0 / display-window=0 / max-cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / opt-qp-pps / opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / no-hdr
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio #1
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : A_AC3
Duration                                 : 24 min 29 s
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -5 ms
Stream size                              : 33.6 MiB (7%)
Title                                    : English
Language                                 : English
Service kind                             : Complete Main
Default                                  : No
Forced                                   : No

Audio #2
ID                                       : 3
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : A_AC3
Duration                                 : 24 min 29 s
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -5 ms
Stream size                              : 33.6 MiB (7%)
Title                                    : Japanese
Language                                 : Japanese
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No

Text #1
ID                                       : 4
Format                                   : ASS
Codec ID                                 : S_TEXT/ASS
Codec ID/Info                            : Advanced Sub Station Alpha
Compression mode                         : Lossless
Title                                    : Signs/Song for Dub
Language                                 : English
Default                                  : No
Forced                                   : No

Text #2
ID                                       : 5
Format                                   : ASS
Codec ID                                 : S_TEXT/ASS
Codec ID/Info                            : Advanced Sub Station Alpha
Compression mode                         : Lossless
Title                                    : Subtitles
Language                                 : English
Default                                  : Yes
Forced                                   : No

Application version

0.18.3

Device information

Sony KD-55XH8096

Android version

Android 9

Jellyfin server version

10.10.3

@julienbenjamin julienbenjamin added bug Something isn't working playback Issue related to media playback labels Jan 3, 2025
@Dnkhatri
Copy link

Dnkhatri commented Jan 7, 2025

your tv processor does not support the format. Its a common problem for anime 10bit 265 encodes.

@julienbenjamin
Copy link
Author

your tv processor does not support the format. Its a common problem for anime 10bit 265 encodes.

This was my suspicion ; however, I could never find a definitive answer.

Do you have any proof, or is it just an educated guess?

@Dnkhatri
Copy link

Dnkhatri commented Jan 9, 2025

It was an educated guess but I think I might be wrong as the server transcoding could also be because of ass subtitles which android tv does not support

https://forum.jellyfin.org/t-android-vs-android-tv-subtitle-support?pid=47966#pid47966

@Hello-World-Traveler
Copy link

If the device supports HEVC 10 bit and it transcodes, as @Dnkhatri said it could be the ASS subtitles when active or something to do with the level. Eg: level 150.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working playback Issue related to media playback
Projects
None yet
Development

No branches or pull requests

3 participants