• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Android TV - "Lag" with some ASS embedded subtitles

     
    • 0 Vote(s) - 0 Average

    Android TV - "Lag" with some ASS embedded subtitles

    Duvel
    Offline

    Member

    Posts: 69
    Threads: 9
    Joined: 2023 Jul
    Reputation: 3
    Country:Belgium
    #1
    2025-03-23, 08:07 AM (This post was last modified: 2025-03-23, 08:11 AM by Duvel. Edited 1 time in total.)
    Hi

    Got an issue with a very specific situation.

    Have a movie with following specs:
    Video : 4k HEVC SDR
    Audio : Dolby Digital+ 5.1  English + French
    Subtitles : Embedded ASS (English + French + French Forced)

    The problem happens on Android TV. No issue on Web player

    The movie is transcoded to the Android TV box as
    Video : HEVC --> HEVC 3600
    Audio : EAC3 -> AAC

    So, when subtitles are off, the movie just play fine.
    But whenever I activate any of the subtitles, first it takes like one minute of black screen before the movie plays again ( and I can see the subtitles), but then the movie "lags" non stop. Every 5 seconds or so, it hangs 1-2 seconds. And it remains in this lagging state indefinitely (well I let it play like this at least 15 minutes and then stopped because it aint funny)
    When I disable the subtitles, everything is working fine again.
    I restarted the android box and made dozen of restarting movie attempts, its always the same behavior.

    I inspected the server logs, and I cant find anything obvious.
    Those are the logs I see for that stream when the subtitles are on and the movie is lagging

    Code:
    [2025-03-23 08:58:34.981 +01:00] [INF] Removing item, Type: "Episode", Name: "Only Gunshots to Guide Us", Path: "", Id: c53d897f-9ea1-ee68-ebdd-a885a3aff984
    [2025-03-23 08:58:36.472 +01:00] [INF] Stopping ffmpeg process with q command for "/cache/jellyfin/transcodes/a05fc672d55ca3769b77ea7c967cf139.m3u8"
    [2025-03-23 08:58:36.487 +01:00] [INF] User policy for "tom". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
    [2025-03-23 08:58:37.000 +01:00] [INF] "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -probesize 1G -fflags +genpts  -i file:\"/media/plex/movies/The Brutalist (2024) [imdbid-tt8999762]/The Brutalist (2024) [imdbid-tt8999762] - [WEBRip-2160p][EAC3 5.1][x265]-Amen.mkv\" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:2 -map -0:s -codec:v:0 copy -tag:v:0 hvc1 -bsf:v hevc_mp4toannexb -start_at_zero -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 6 -hls_segment_type mpegts -start_number 0 -hls_segment_filename \"/cache/jellyfin/transcodes/223dc7e671c56b077afe78050de67ca9%d.ts\" -hls_playlist_type vod -hls_list_size 0 -y \"/cache/jellyfin/transcodes/223dc7e671c56b077afe78050de67ca9.m3u8\""
    [2025-03-23 08:58:39.957 +01:00] [INF] Stopping ffmpeg process with q command for "/cache/jellyfin/transcodes/223dc7e671c56b077afe78050de67ca9.m3u8"
    [2025-03-23 08:58:40.045 +01:00] [INF] FFmpeg exited with code 0
    [2025-03-23 08:58:40.089 +01:00] [INF] "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -probesize 1G -ss 00:16:59.518 -fflags +genpts  -i file:\"/media/plex/movies/The Brutalist (2024) [imdbid-tt8999762]/The Brutalist (2024) [imdbid-tt8999762] - [WEBRip-2160p][EAC3 5.1][x265]-Amen.mkv\" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:2 -map -0:s -codec:v:0 copy -tag:v:0 hvc1 -bsf:v hevc_mp4toannexb -start_at_zero -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 6 -hls_segment_type mpegts -start_number 146 -hls_segment_filename \"/cache/jellyfin/transcodes/223dc7e671c56b077afe78050de67ca9%d.ts\" -hls_playlist_type vod -hls_list_size 0 -y \"/cache/jellyfin/transcodes/223dc7e671c56b077afe78050de67ca9.m3u8\""
    [2025-03-23 08:58:40.704 +01:00] [INF] FFmpeg exited with code 0
    [2025-03-23 08:58:40.705 +01:00] [INF] Deleting partial stream file(s) "/cache/jellyfin/transcodes/a05fc672d55ca3769b77ea7c967cf139.m3u8"
    [2025-03-23 08:58:42.216 +01:00] [INF] Playback stopped reported by app "Android TV" "0.18.6" playing "The Brutalist". Stopped at "1021563" ms
    [2025-03-23 08:58:59.618 +01:00] [INF] Stopping ffmpeg process with q command for "/cache/jellyfin/transcodes/223dc7e671c56b077afe78050de67ca9.m3u8"
    [2025-03-23 08:58:59.677 +01:00] [INF] User policy for "tom". EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
    [2025-03-23 08:58:59.687 +01:00] [INF] FFmpeg exited with code 0
    [2025-03-23 08:58:59.688 +01:00] [INF] Deleting partial stream file(s) "/cache/jellyfin/transcodes/223dc7e671c56b077afe78050de67ca9.m3u8"
    [2025-03-23 08:59:00.582 +01:00] [INF] "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -probesize 1G  -i file:\"/media/plex/movies/The Brutalist (2024) [imdbid-tt8999762]/The Brutalist (2024) [imdbid-tt8999762] - [WEBRip-2160p][EAC3 5.1][x265]-Amen.mkv\" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:2 -codec:v:0 libx265 -tag:v:0 hvc1 -preset veryfast -crf 28 -maxrate 5670772 -bufsize 11341544 -profile:v:0 main -x265-params:0 no-scenecut=1:no-open-gop=1:no-info=1:subme=3:merange=25:rc-lookahead=10:me=star:ctu=32:max-tu-size=32:min-cu-size=16:rskip=2:rskip-edge-threshold=2:no-sao=1:no-strong-intra-smoothing=1 -force_key_frames:0 \"expr:gte(t,n_forced*3)\" -vf \"setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,min(4096\,4096*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(4096/a\,4096))/2)*2,format=yuv420p,subtitles=f='/var/lib/jellyfin/data/subtitles/4/48c12e9c-c90f-88bd-0ddf-f89dbbb3a898.ass':fontsdir='/cache/jellyfin/attachments/3965a22f3c402aa7fcf0e428816fce84'\" -start_at_zero -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 0 -hls_segment_filename \"/cache/jellyfin/transcodes/aa048532f2450d798b0a15100ed58a1b%d.ts\" -hls_playlist_type vod -hls_list_size 0 -y \"/cache/jellyfin/transcodes/aa048532f2450d798b0a15100ed58a1b.m3u8\""
    [2025-03-23 08:59:01.229 +01:00] [INF] Playback stopped reported by app "Android TV" "0.18.6" playing "The Brutalist". Stopped at "1035544" ms
    [2025-03-23 08:59:25.956 +01:00] [INF] Stopping ffmpeg process with q command for "/cache/jellyfin/transcodes/aa048532f2450d798b0a15100ed58a1b.m3u8"
    [2025-03-23 08:59:29.872 +01:00] [INF] FFmpeg exited with code 0
    [2025-03-23 08:59:29.908 +01:00] [INF] "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -probesize 1G -ss 00:17:15.000  -i file:\"/media/plex/movies/The Brutalist (2024) [imdbid-tt8999762]/The Brutalist (2024) [imdbid-tt8999762] - [WEBRip-2160p][EAC3 5.1][x265]-Amen.mkv\" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:2 -codec:v:0 libx265 -tag:v:0 hvc1 -preset veryfast -crf 28 -maxrate 5670772 -bufsize 11341544 -profile:v:0 main -x265-params:0 no-scenecut=1:no-open-gop=1:no-info=1:subme=3:merange=25:rc-lookahead=10:me=star:ctu=32:max-tu-size=32:min-cu-size=16:rskip=2:rskip-edge-threshold=2:no-sao=1:no-strong-intra-smoothing=1 -force_key_frames:0 \"expr:gte(t,n_forced*3)\" -vf \"setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,min(4096\,4096*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(4096/a\,4096))/2)*2,format=yuv420p,subtitles=f='/var/lib/jellyfin/data/subtitles/4/48c12e9c-c90f-88bd-0ddf-f89dbbb3a898.ass':fontsdir='/cache/jellyfin/attachments/3965a22f3c402aa7fcf0e428816fce84'\" -start_at_zero -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 345 -hls_segment_filename \"/cache/jellyfin/transcodes/aa048532f2450d798b0a15100ed58a1b%d.ts\" -hls_playlist_type vod -hls_list_size 0 -y \"/cache/jellyfin/transcodes/aa048532f2450d798b0a15100ed58a1b.m3u8\""
    [2025-03-23 09:02:44.095 +01:00] [INF] WS "95.182.169.137" request
    [2025-03-23 09:02:51.158 +01:00] [INF] Deleting partial stream file(s) "/cache/jellyfin/transcodes/914813a812d72414ea4b6ae86e34c728.m3u8"

    Any hint ??
    Efficient_Good_5784
    Offline

    Community Moderator

    Posts: 1,167
    Threads: 3
    Joined: 2023 Jun
    Reputation: 50
    #2
    2025-03-23, 08:59 AM
    Could you share the relevant ffmpeg log for a laggy stream?
    Duvel
    Offline

    Member

    Posts: 69
    Threads: 9
    Joined: 2023 Jul
    Reputation: 3
    Country:Belgium
    #3
    2025-03-23, 09:25 AM (This post was last modified: 2025-03-23, 09:28 AM by Duvel.)
    (2025-03-23, 08:59 AM)Efficient_Good_5784 Wrote: Could you share the relevant ffmpeg log for a laggy stream?

    Fast answer as usual Smiling-face

    I attached the ffmpeg log file

    Attachement failed, too big.

    I uploaded the file here https://limewire.com/d/3tquN#1tyNo0p2EM
    Efficient_Good_5784
    Offline

    Community Moderator

    Posts: 1,167
    Threads: 3
    Joined: 2023 Jun
    Reputation: 50
    #4
    2025-03-23, 04:27 PM
    Could you please share with a site like pastebin.com?

    It would be nice to not need to download a file from the internet.

    If it's too big for pastebin.com, just find where it shows the stream mapping.
    Copy the text from that and bellow.
    theguymadmax
    Offline

    Community Moderator

    Posts: 1,009
    Threads: 0
    Joined: 2024 Jun
    Reputation: 58
    #5
    2025-03-23, 04:28 PM
    What are your server specs? Your software transcoding and your CPU can't keep up.
    Duvel
    Offline

    Member

    Posts: 69
    Threads: 9
    Joined: 2023 Jul
    Reputation: 3
    Country:Belgium
    #6
    2025-03-23, 07:53 PM (This post was last modified: 2025-03-24, 06:32 AM by Duvel. Edited 9 times in total.)
    (2025-03-23, 04:27 PM)Efficient_Good_5784 Wrote: Could you please share with a site like pastebin.com?

    It would be nice to not need to download a file from the internet.

    If it's too big for pastebin.com, just find where it shows the stream mapping.
    Copy the text from that and bellow.
    https://pastebin.com/MtS4TYVi


    (2025-03-23, 04:28 PM)theguymadmax Wrote: What are your server specs? Your software transcoding and your CPU can't keep up.

    PowerEdge T640 
    Intel® Xeon® Gold 5118 CPU @ 2.30GHz - 12 cores
    128 Gb RAM.

    Got VMware ESXi 8 on bare metal.

    The jellyfin server VM has 16 vCPU and 32 Go RAM.

    This is my server right now. The top 4 movies are on stream and all transcoding.
    [Image: image.png]

    Dell Idrac + Vmware host
    [Image: image.png] 

    Jellyfin server VM
    [Image: image.png]

    The CPU is usage is high  indeed but it handle the 4 transcodes with no issue and theres still room for more.
    The difference is that all movies being transcoded now are 1080p, while the movie I reported here is a 2160, that might be the issue.
    But out of the 4 times I tested this movie, on 3 of them I was alone on the server, and the CPU peaked at 70% max, and each time I had this lag issue, while all other stuff ran fine.

    Do we need an IBM mainframe to transcode a 2160p movie while displaying subtitles ? :-)
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #7
    2025-03-23, 08:04 PM
    You are CPU encoding to HEVC. Much slower than H264. Disabling HEVC encoding should help a lot. But adding a GPU for hardware acceleration is ideal.

    For the record. Most users have some form of hardware acceleration available. Nearly all Xeons do not have an iGPU with Quick Sync. Most consumer Intel CPUs do.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Duvel
    Offline

    Member

    Posts: 69
    Threads: 9
    Joined: 2023 Jul
    Reputation: 3
    Country:Belgium
    #8
    2025-03-23, 08:21 PM
    @TheDreadPirate
    I dont want to rely on a GPU (and I got a good one) because of the power consomption, and because all in one, my jellyfin server works perfectly fine most of the time with CPU only.
    I will thus disable the HEVC transcoding and retry

    Thanks !
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #9
    2025-03-23, 08:37 PM
    CPU transcoding uses MUCH MUCH more power than GPU transcoding. AND the GPU would transcode multiple times faster. Yes, there is some idle power draw, but much less than you'd expect. Less than 15-20w for modern Nvidia GPUs. With transcoding power usage around 30w. Versus 50-100w for a CPU to transcode a video at less than half the speed.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Efficient_Good_5784
    Offline

    Community Moderator

    Posts: 1,167
    Threads: 3
    Joined: 2023 Jun
    Reputation: 50
    #10
    2025-03-24, 12:49 AM
    You're not forced to use a dedicated GPU.

    When people build a power-efficient media server machine, it's with the expectation that a CPU that contains an iGPU is used.

    If possible, we recommend that you use an Intel CPU that has an iGPU so you can use QSV.
    Intel GPUs produce really great transcoding results quality-wise.

    And since the iGPU is part of the CPU, you save yourself the extra watts burned at idle from a discrete GPU.
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode