Comment by thaumasiotes

10 hours ago

> If you pick embedded subtitles with these clients, Jellyfin must extract the subtitles files immediately, and this takes a while depending on container format, file sizes and server load.

Really? How?

My expectation would be that extracting a subtitle file takes a few seconds at most. If you had to do it on the fly every time you watched anything in your library, it wouldn't matter.

I don't undestand how movie containers work, but I ran this on a 70 GB movie file to test:

    ffmpeg -i input.mkv -map 0:s:0 /tmp/subtitles.srt

The movie is 2 hours long, and the expected time to complete is 21 minutes. It seems like it's reading the entire file. This is on an average SATA SSD that is also being read/written to by the torrent client in the background.

IIRC, in many containers embedded subtitles will be interleaved with the video and audio atoms/boxes/packets/etc., and so pulling out the subtitles requires scanning the full file. Not quite as expensive as decoding or re-encoding, but still as slow as "stream the full file into memory and demux the streams"