Commit graph

1275 commits

Author SHA1 Message Date
Bond-009
6eff445cb1
Merge pull request #18573 from hoshinolina/attachment-cleanup
Always extract attachments individually
2026-11-12 19:32:14 +01:00
Bond-009
deb2c9c592
Merge pull request #17642 from mysticalsoap/fix-premiere-date-from-container-encode-date
Keep container creation time out of the premiere date chain
2026-11-06 09:36:52 +01:00
Hoshino Lina
2bfd21decf Always extract attachments individually
Since e627c723, attachments can be extracted by filename in
one ffmpeg command. This makes the auto-filename codepath redundant.

Letting ffmpeg extract all attachments is broken in ffmpeg upstream.
This was worked around in jellyfin/jellyfin-ffmpeg#720 but affects
distributions that do not use jellyfin-ffmpeg.

Since there is no good reason to keep this codepath, just delete it.
This obsoletes the above ffmpeg patch and should be more robust in
the future, since Jellyfin no longer depends on guessing exactly
what behavior ffmpeg has when constructing, allowing, or denying
attachment filenames.
2026-11-01 18:35:18 +09:00
cinadr
4a9f8697d5 Backport pull request #18325 from jellyfin/release-12.z
Fix unbalanced parenthesis in the HalfTopAndBottom image extraction filter

Original-merge: cea73288c7

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Cody Robibero <cody@robibe.ro>
2026-10-26 18:12:20 -04:00
mysticalsoap
a92a574be0
Keep container creation time out of the premiere date chain 2026-10-15 17:35:24 -04:00
p27ZuH6CNAdzr
f624cb4cc5 Backport pull request #18309 from jellyfin/release-12.z
Fix crash when a subtitle charset has no .NET encoding

Original-merge: 2f5be2df9b

Merged-by: Bond-009 <bond.009@outlook.com>

Backported-by: Bond_009 <bond.009@outlook.com>
2026-10-13 13:36:11 -04:00
myristate
054706333d Backport pull request #18243 from jellyfin/release-12.z
Fix crash probing streams without frame size

Original-merge: 8e50df32e7

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Bond_009 <bond.009@outlook.com>
2026-10-13 13:36:10 -04:00
nyanmisaka
bfb7af2897 Backport pull request #18164 from jellyfin/release-12.z
Fix typo when parsing codec_tag_string

Original-merge: 8358c03ebf

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Cody Robibero <cody@robibe.ro>
2026-09-27 16:30:55 -04:00
SimonvBez
bc753b18ec Backport pull request #17906 from jellyfin/release-12.z
Fix transcode throttling not enabling on supported systems (caused by race condition)

Original-merge: b8b6e392bf

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Cody Robibero <cody@robibe.ro>
2026-09-15 11:15:54 -04:00
crobibero
51abf6f503 Backport pull request #17883 from jellyfin/release-12.z
Fix trickplay using the wrong video stream

Original-merge: 31f0533191

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Cody Robibero <cody@robibe.ro>
2026-09-15 11:15:47 -04:00
Raspberry Kan
647c4ad090
Fix Blu-ray multi-angle concat generation
Filter Blu-ray playlist clips to AngleIndex == 0 when generating concat files to prevent clips from multiple angles from being played sequentially.
2026-09-07 22:53:22 +08:00
Cody Robibero
66d038c403
Merge pull request #17762 from Shadowghost/fix-scan-memory-leak
Bound change batches during a scan; keep ffprobe and image saves from failing
2026-09-06 01:28:02 -04:00
Shadowghost
c56e14d8fb Keep a media process and its exit state usable by the caller that started it 2026-09-01 21:42:06 +02:00
Oggeb1
4207e89a7d
Merge branch 'jellyfin:master' into BDMV-pgs 2026-08-29 14:02:22 +02:00
Cody Robibero
9ba91d4583 Normalize fix, apply in more places 2026-08-20 18:10:50 -04:00
Shadowghost
a8da0664a3 Fix GHSA-wwwm-px48-fpvq
# Conflicts:
#	MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
2026-08-20 17:51:42 -04:00
Oskar Bali
0b20d7a05b Fix BDMV PGS subtitles with TrueHD
Add myself CONTRIBUTORS.md
2026-08-19 12:19:32 +02:00
gnattu
e2586eed9b Fix concurrent ffmpeg segment racing
This is a nasty one. The failure mode is:

1. Request A started FFmpeg and waited for a segment.
2. Request B requested an earlier or far away segment.
3. Jellyfin thought FFmpeg should to restart at a different position.
4. Request B killed the existing transcoding job.
5. Killing that job cancelled the same token request A was using.
6. The cancellation produced http 500 to request A.

To fix this:

we lock transcoding job state changes and segment handling per playlist, and use a thread safe counter to track how many http responses are still using each job’s segments. A job is only stopped or replaced once that counter reaches zero.
2026-08-05 00:33:42 +08:00
Cody Robibero
7f26bd1091
Merge pull request #17399 from Shadowghost/fix-extra-year
Fix incorrect year on local trailers
2026-07-25 12:52:51 -04:00
Cody Robibero
6ac64c5319
Merge pull request #17419 from rwebster85/mp4-audio-subtitle-names
Check the "name" tag for audio/subtitle probe to fix MP4 not showing correctly - Fixes issue #17418
2026-07-24 21:30:54 -04:00
gnattu
d74babd8f3 Drain stderr and stdout concurrently for encoder validation
Some ffmpeg build might output extremely long traces for its banner that consume all pipe capacity and hangs the process. We have to drain both streams regardless on which one we actually read.
2026-07-24 20:01:01 +08:00
Richard Webster
ca0cf763ff
Update comment 2026-07-23 11:57:34 +01:00
Richard Webster
3d4c52092e
Clarify comment about MP4 track title workaround 2026-07-23 10:13:04 +01:00
Richard Webster
474ae50c36
Check the "name" tag, not just "title" 2026-07-22 18:00:18 +01:00
Shadowghost
6382563440 Prefer null checks over HasValue everywhere 2026-07-22 08:09:33 +02:00
Cody Robibero
65836cc844
Merge pull request #17160 from 854562/truncate-language-strings
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Format / format-check (push) Waiting to run
Tests / run-tests (macos-latest) (push) Waiting to run
Tests / run-tests (ubuntu-latest) (push) Waiting to run
Tests / run-tests (windows-latest) (push) Waiting to run
OpenAPI Publish / OpenAPI - Publish Artifact (push) Waiting to run
OpenAPI Publish / OpenAPI - Publish Unstable Spec (push) Blocked by required conditions
OpenAPI Publish / OpenAPI - Publish Stable Spec (push) Blocked by required conditions
Project Automation / Project board (push) Waiting to run
Merge Conflict Labeler / main (push) Waiting to run
Truncate ISO-639-2 language display names at first delimiter
2026-07-21 11:22:32 -04:00
Tim Eisele
ed61acc19a
Fix subtitle encoding for local files (#17281)
* Fix subtitle encoding

* Add short-circuit

* Use IsTextFormat

* Update MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs

Co-authored-by: Bond-009 <bond.009@outlook.com>

---------

Co-authored-by: Bond-009 <bond.009@outlook.com>
2026-07-21 14:52:59 +02:00
Shadowghost
4cc69f4be0 Apply review suggestions 2026-07-21 14:30:55 +02:00
Shadowghost
b99703301f Merge remote-tracking branch 'upstream/master' into security-path-traversal-fixes
# Conflicts:
#	Jellyfin.Api/Controllers/HlsSegmentController.cs
#	Jellyfin.Api/Controllers/PluginsController.cs
2026-07-21 07:14:47 +02:00
Cody Robibero
f2b9c68969
Merge pull request #17342 from LTe/fix-subtitle-conversion-race
Fix race condition in concurrent subtitle conversion
2026-07-20 19:51:44 -04:00
854562
2cd2f36fe4
Extract truncation logic to helper and add tests 2026-07-20 22:00:10 +02:00
gnattu
a238d59a07
Remove libpostproc check for ffmpeg version validation (#17384)
Remove libpostproc check for ffmpeg version validation
2026-07-20 12:16:37 +02:00
Bond-009
2fd747432a
Merge pull request #17304 from nyanmisaka/normalize-invalid-pts-for-trickplay
Normalize invalid PTS from containers for Trickplay generation
2026-07-20 08:36:25 +02:00
nyanmisaka
9fa9d26341 Normalize invalid PTS from containers for Trickplay generation
This change does not affect the keyframe only mode.

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2026-07-18 15:44:34 +08:00
Marc Brooks
cab108a839
Prevent ffmpeg from hanging extracting subtitles (#17297)
* 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.
2026-07-17 23:23:57 +02:00
Bond-009
b809d964b3
Merge pull request #17288 from nyanmisaka/ffmpeg-log-utf8
Fix potential garbled text in FFmpeg logs on Windows
2026-07-17 22:28:49 +02:00
Shadowghost
1a45fc82b5 Sanitize media attachment and lyric paths against traversal 2026-07-17 17:07:27 +02:00
Piotr Niełacny
6e3c187493 Fix race condition in concurrent subtitle conversion
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.
2026-07-15 14:55:55 +02:00
theguymadmax
e2d9d592bc Fix incorrect protocol used for subtitle charset detection 2026-07-11 17:33:06 -04:00
nyanmisaka
631a314d24 Fix potential garbled text in FFmpeg logs on Windows
Explicitly set StandardErrorEncoding and StandardOutputEncoding to
Encoding.UTF8 when invoking the FFmpeg subprocess.

This prevents log encoding issues and character corruption on Windows
environments that default to non-UTF8 ANSI code pages.

This fixes garbled metadata and font names in the FFmpeg logs.

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2026-07-10 14:46:27 +08:00
Nils Lehnen
f8ffccae7f Use InvariantCulture when parsing machine-generated dates
DateTime.TryParse without an IFormatProvider falls back to the current
thread culture, so the same string can parse differently (or fail)
depending on the server's locale. None of these call sites deal with
user-entered text - they parse dates that come from filenames, an
HTTP header, ffprobe metadata and values the app itself wrote to the
auth database - so InvariantCulture is the correct provider everywhere
here.

Fixes the S6580 / CA1305 warnings on these call sites.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 23:55:31 +02:00
854562
c632417dda
Fix SonarCloud warnings 2026-06-23 18:32:47 +02:00
Shadowghost
d090c59939 Rework bitrate reporting 2026-06-23 17:47:17 +02:00
854562
94d5326411
Truncate ISO-639-2 language display names at first delimiter
Prevents raw ISO-639-2 values (e.g. "Greek, Modern (1453-)" from cluttering the audio and subtitle display names by truncating them at the first comma or semicolon ("Greek"). Applies to MediaStreamRepository and ProbeResultNormalizer.
2026-06-22 20:25:13 +02:00
Bond_009
e86b502cbc Strip null-terminator 2026-06-16 17:54:23 +02:00
Bond_009
0022508889 Add regression test 2026-06-15 21:20:06 +02:00
Bond_009
a9a02719ab Fix type of length arguments 2026-06-15 21:01:28 +02:00
Bond_009
d50205cc9f Follow native interoperability best practices
https://learn.microsoft.com/en-us/dotnet/standard/native-interop/best-practices
2026-06-15 21:01:28 +02:00
theguymadmax
d0a8445f76 Fix duplicate key collision 2026-06-12 11:44:26 -04:00
Shadowghost
a96824f257 Merge remote-tracking branch 'upstream/master' into fix-external-sub-invalidation 2026-06-05 23:41:05 +02:00