| Age | Commit message (Collapse) | Author |
|
Fix race condition in concurrent subtitle conversion
|
|
* Prevent ffmpeg from hanging extracting subtitles
Add `RunSubtitleExtractionProcess` to unify the external
_ffmpeg_ process handling and error management.
Add a `-nostdin` flag that prevents _ffmpeg_ from reading from
_stdin_ and blocking on an inherited stdin handle (e.g. when
Jellyfin runs as a service under NSSM), which otherwise hangs
subtitle extraction forever when _ffmpeg_ blocks on any
keyboard-interaction read until the timeout (30 minutes).
Close the redirected _stdin_ to ensure immediage EOF.
Drain the _stderr_ to a string and log it, to ensure we don't block
the _ffmpeg_ process on errors that exceed the pipe length.
Pass `-y` to _ffmpeg_ to ensure it overwrites any existing output file
without prompting for confirmation.
* Address review comments
Make sure we always drain stderr.
Make sure the timeout also honors the cancellationToken.
Make sure when we get cancelled we don't log it as a ffmpeg error.
|
|
SubtitleEncoder.ConvertSubtitles parsed subtitles with libse's static
Subtitle.Parse, which iterates a statically cached list of shared
SubtitleFormat instances. Format parsers keep mutable per-parse state on
the instance, so concurrent subtitle requests corrupted each other's
output (cues mixed across streams and languages, truncated files) or
failed with NullReferenceException when format detection broke down and
Subtitle.Parse returned null.
Parse through the injected ISubtitleParser instead. SubtitleEditParser
instantiates a fresh format parser per call, so requests no longer share
state. Its Parse method now returns the libse Subtitle directly (the
SubtitleTrackInfo flattening was unused since the SubtitleEdit writer
rework) so the writers keep full fidelity such as ASS styling.
|
|
|
|
fix-external-sub-invalidation
|
|
|
|
|
|
* Write subtitles using SubtitleEdit
We've been using SubtitleEdit to parse since 2021
https://github.com/jellyfin/jellyfin/pull/4984
I think it's time we start using it to write too
* Clean up ConvertSubtitles
* Add JsonWriter back
|
|
* Add support for VobSub subtitle streams
* update logic to determine separate extraction for VobSub subtitles
* simplify VobSub extraction logic and fix ffmpeg command
* Match `ExtractAllExtractableSubtitlesMKS` with `ExtractAllExtractableSubtitlesInternal` Matroska's VobSub option
* Add a comments clarify why MKS was used, and remove the redundant VobSub extension branch
* remove redundant VobSub format check
* fix type errors
|
|
|
|
|
|
We've been using SubtitleEdit to parse since 2021
https://github.com/jellyfin/jellyfin/pull/4984
I think it's time we start using it to write too
|
|
|
|
Safeguard against invalid GUIDs
|
|
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
|
|
fix: retain subtitles spanning HLS segment boundaries
|
|
Remove -copyts and add -flush_packets 1 to subtitle extraction
Original-merge: ec33c74ec44693a9ddb1e2f13bea90ef3c22267e
Merged-by: Bond-009 <bond.009@outlook.com>
Backported-by: Bond_009 <bond.009@outlook.com>
|
|
Fix subtitle extraction caching empty files
Original-merge: 6864e108b8b36ad25655e683b2cf2abf8b8ca346
Merged-by: joshuaboniface <joshua@boniface.me>
Backported-by: Bond_009 <bond.009@outlook.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Bond_009 <bond.009@outlook.com>
|
|
|
|
|
|
|
|
|
|
purpose and continue.
|
|
|
|
|
|
* Cleanup extracted files
* Pagination and fixes
* Add migration for attachments to MigrateLibraryDb
* Unify attachment handling
* Don't extract again if files were already extracted
* Fix MKS attachment extraction
* Always run full extraction on mks
* Don't try to extract mjpeg streams as attachments
* Fallback to check if attachments were extracted to cache folder
* Fixup
|
|
|
|
|
|
Fix subtitle and attachment extraction when input path contains quotes
Original-merge: 3c3ebe834462bbb7630ca4fc0c106cc51ca80e50
Merged-by: Bond-009 <bond.009@outlook.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
|
|
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
|
|
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>
|
|
|
|
This reverts commit 117d05d288da1d412159a29c0cb8d5c8259e48ae.
|
|
|
|
|
|
|