jellyfin/MediaBrowser.MediaEncoding
Attila Szakacs 8fea819b51 Extract all subtitle streams simultaneously
Extracting a subtitle stream is a disk I/O bottlenecked operation as
ffmpeg has to read through the whole file, but usually there is nothing
CPU intensive to do.

If a file has multiple subtitle streams, and we want to extract more
of them, extracting them one-by-one results in reading the whole file
again and again.

However ffmpeg can extract multiple streams at once.

We can optimize this by extracting the subtitle streams all at once
when only one of them gets queried, then we will have all of them
cached for later use.

It is useful for people switching subtitles during playback.

It is even more useful for people who extract all the subtitle streams
in advance, for example with the "Subtitle Extract" plugin.
In this case we reduce the extraction time significantly based on the
number of subtitle streams in the files, which can be 5-10 in many
cases.

Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
2024-01-18 17:29:45 +01:00
..
Attachments Use Process.WaitForExitAsync added in .NET 5 2023-10-10 00:18:50 +02:00
BdInfo Make files readonly 2023-10-08 00:40:58 +02:00
Configuration Add some analyzers to MediaBrowser.MediaEncoding 2020-08-04 17:08:09 +02:00
Encoder Revert "Use System.Net.IPNetwork" 2023-11-14 21:16:33 +01:00
Probing Revert "Use System.Net.IPNetwork" 2023-11-14 21:16:33 +01:00
Properties Add tests for EncoderValidator 2019-09-28 19:41:34 +02:00
Subtitles Extract all subtitle streams simultaneously 2024-01-18 17:29:45 +01:00
Transcoding Use helper function to compare guid (#10825) 2024-01-17 08:51:39 -07:00
MediaBrowser.MediaEncoding.csproj Update to .NET 8 2023-11-14 21:12:16 +01:00