mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-19 12:44:19 +01:00
* 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.