Commit graph

56 commits

Author SHA1 Message Date
Cody Robibero 814fc6864d Specify file as concat when extracting attachments 2024-03-08 18:10:31 -07:00
Attila Szakacs 8d40d431e8
Extract and cache all media attachments in bulk (#11029)
Similar to https://github.com/jellyfin/jellyfin/pull/10884

---

Jellyfin clients need fonts for subtitles, and each font is a separate
attachment, which causes a lot of re-reads of the file. Certain contents,
like anime in a lot of cases, contain 50-80 different attachments.

Spawning 80 ffmpeg processes at the same time on the same file might
cause swapping on slower HDDs and can bring disk subsystem to a crawl.

(For more info, see https://github.com/jellyfin/jellyfin/3215)

This change helps a lot in this scenario.

Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
2024-03-03 13:33:54 -07:00
Mark Cilia Vincenti d1677dc680 AsyncKeyedLock migration 2024-01-03 16:47:25 +01:00
Bond_009 4757ce105b Use Process.WaitForExitAsync added in .NET 5 2023-10-10 00:18:50 +02:00
Bond_009 b176beb88e Reduce string allocations
Some simple changes to reduce the number of allocated strings
2023-10-06 01:04:25 +02:00
Stepan Goremykin 910617bbc3 Remove redundant 'else' keywords 2023-04-06 19:38:34 +02:00
Stepan Goremykin 08ce477226 Fix duplicate properties in message template warning 2023-04-06 19:17:28 +02:00
Róbert Örn Ketilsson ef3868ff50 Backport pull request #9178 from jellyfin/release-10.8.z
Escape the path to pass as a command line argument

Original-merge: 09f1c7f535

Merged-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com>

Backported-by: crobibero <cody@robibe.ro>
2023-03-09 19:29:39 -05:00
Bond_009 b366dc2e6e Use ArgumentException.ThrowIfNullOrEmpty 2022-12-07 16:43:59 +01:00
Bond_009 c7d50d640e Replace == null with is null 2022-12-05 15:00:20 +01:00
Bond_009 a9a5fcde81 Use ArgumentNullException.ThrowIfNull helper method
Did a simple search/replace on the whole repo (except the RSSDP project)
This reduces LOC and should improve performance (methods containing a throw statement don't get inlined)

```
if \((\w+) == null\)
\s+\{
\s+throw new ArgumentNullException\((.*)\);
\s+\}
```

```
ArgumentNullException.ThrowIfNull($1);
```
2022-10-06 20:21:23 +02:00
Nils Fürniß d7d36a102a
Fix releasing lock 2022-03-22 19:17:49 +01:00
Nils Fürniß b4bb82b6d7
Improve code 2022-03-22 19:17:48 +01:00
Nils Fürniß 6904edf68c
add extracting attachments from external subs 2022-03-22 19:17:48 +01:00
Nils Fürniß ab40554759
add extracting attachments for ffmpeg to burn subs 2022-02-10 01:01:08 +01:00
Cody Robibero 7bfc6b5679 Remove more warnings 2021-12-27 07:38:06 -07:00
Bond_009 1d19a5be61 Fix some warnings
down to 580
2021-11-09 22:29:33 +01:00
Bond_009 e3dac4fda2 Use async FileStreams where it makes sense 2021-09-02 14:02:04 +02:00
Bond_009 26d7fc8280 Enable nullable reference types for MediaBrowser.MediaEncoding.Subtitles 2021-05-20 22:10:19 +02:00
Joshua M. Boniface a6199f821b
Merge pull request #4169 from stanionascu/bdiso-playback
Playback (direct-stream/transcode) of BDISO/BDAV containers
2020-12-01 22:36:04 -05:00
crobibero e82829c444 Fix nullability errors in MediaBrowser.MediaEncoding 2020-11-13 09:01:55 -07:00
Stanislav Ionascu cd4641dca0 Remove PlayableStreamFileNames as unused
Since ffmpeg can play and transcode ISO files and BDMV folders directly,
there's no use of that property.
2020-10-01 22:20:34 +02:00
Stanislav Ionascu 3ad6232973 Add probe / direct-stream / transcoding support for BluRays
This commit (and ffmpeg built with libbluray support), adds support
for playback of bluray images (bd-iso) and bluray folders.
2020-10-01 21:59:57 +02:00
Bond_009 ab2147751f Make MediaBrowser.MediaEncoding warnings free 2020-08-20 12:16:24 +02:00
Bond-009 18efa25a6f Enable TreatWarningsAsErrors for MediaBrowser.MediaEncoding 2020-08-04 16:20:52 +02:00
telans 3d9049ef08
fix SA1508 2020-06-15 10:45:55 +12:00
crobibero 44957c5a9a Use typed logger where possible 2020-06-05 18:15:56 -06:00
Mark Monteiro 4113288278 Fix style issues 2020-04-11 13:46:31 -04:00
Mark Monteiro 7152b55747 Use a separate line for each property initializer 2020-04-11 13:28:21 -04:00
Mark Monteiro e0f40f57d8 Merge remote-tracking branch 'upstream/master' into remove-common-process 2020-04-03 20:22:03 -04:00
Mark Monteiro 0e195d2e49 Add missing call to ConfigureAwait() 2020-04-03 20:20:55 -04:00
Mark Monteiro d705931e81 Dispose of process correctly in AttachmentExtractor 2020-03-27 01:42:28 +01:00
Mark Monteiro 48bbcbb426 Use WaitForExitAsync extension method in AttachmentExtractor 2020-03-27 01:09:25 +01:00
Bond_009 e9d1eabd53 Remove unused usings 2020-03-24 16:12:06 +01:00
Bond_009 0d6a4c2909 Fix build 2020-01-11 00:08:47 +01:00
Bond_009 a253fa616d Fix build and address comments 2020-01-08 01:23:57 +09:00
Andrew Mahone dee247453e Throw InvalidOperationException when attachment extraction exits abnormally or doesn't produce output. 2019-11-13 08:52:37 -05:00
Andrew Mahone 7ea05bb86b Merge branch 'media-attachments' of github.com:Unhelpful/jellyfin into media-attachments 2019-11-07 14:30:43 -05:00
Andrew Mahone 79858eb26c Remove use of ProcessFactory, as well as arbitrary timeout in AttachmentExtractor. 2019-11-07 14:24:49 -05:00
Andrew Mahone 3a9bf84e3b
Update MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
formatting

Co-Authored-By: Bond-009 <bond.009@outlook.com>
2019-11-07 12:00:47 -05:00
Andrew Mahone 1eb3df1d6c
Update MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
formatting / style

Co-Authored-By: Bond-009 <bond.009@outlook.com>
2019-11-07 11:59:54 -05:00
Andrew Mahone 380d023351 Merge branch 'media-attachments' of github.com:Unhelpful/jellyfin into media-attachments 2019-11-07 11:58:13 -05:00
Andrew Mahone 2f728fd2a1
Update MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
formatting

Co-Authored-By: Bond-009 <bond.009@outlook.com>
2019-11-07 11:58:26 -05:00
Andrew Mahone 2338a53229 Don't user ILoggerFactory. 2019-11-07 11:55:39 -05:00
Andrew Mahone 492bbc9e13
Update MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
String -> string

Co-Authored-By: Bond-009 <bond.009@outlook.com>
2019-11-07 11:25:44 -05:00
Andrew Mahone 92aae268a3
Update MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
formatting

Co-Authored-By: Bond-009 <bond.009@outlook.com>
2019-11-07 11:24:53 -05:00
Andrew Mahone c09eb34708 Check for attachment file before trying to remove it during cleanup. 2019-11-07 08:56:12 -05:00
Andrew Mahone 4f3b883155 Clean up handling of missing source/attachment in AttachmentExtractor. 2019-11-06 09:46:31 -05:00
Andrew Mahone 349310787c
Update MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
formatting

Co-Authored-By: Bond-009 <bond.009@outlook.com>
2019-11-05 08:16:46 -05:00
Andrew Mahone 28a6718d8e Return path of extracted attachment, which is always a file, instead of AttachmentInfo with path and protocol. 2019-11-04 14:48:28 -05:00