Commit Graph

28033 Commits

Author SHA1 Message Date
mani
f88cab9ed2 Fix CRT shader: use hwupload=derive_device=opencl for writable output pool
program_opencl inherits its output hw_frames_ctx from the input link.
When the input came via hwmap:mode=read, the inherited context creates
CL_MEM_READ_ONLY images for output - kernel writes are silently
discarded, producing black frames ('kein video').

Fix: download to CPU, then hwupload=derive_device=opencl to create a
fresh writable OpenCL context before program_opencl. Matches Jellyfin's
existing iHD doOclTonemap pattern (GetVaapiVidFiltersPrefered:5711).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 13:33:48 +01:00
mani
0da3d7e29a Fix CRT shader VAAPI path: use reverse=1 instead of hwdownload+hwupload
hwdownload+hwupload produced output with no video. Switch back to
hwmap reverse=1 to VAAPI (then hwmap to QSV). Now that scale_opencl is
gone and the shader processes NV12 natively, the OpenCL frames remain
in the VAAPI-linked pool so reverse=1 is viable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 01:18:15 +01:00
mani
f63a22e65e Fix CRT shader: replace fract() with 1-arg wrapper for OpenCL 1.x
OpenCL 1.x fract() requires 2 arguments; the single-argument form
is OpenCL 2.0+. Replace all usages with crt_fract(x) = x - floor(x).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 01:28:54 +01:00
mani
1325603fd0 Fix CRT shader: rewrite to NV12, remove scale_opencl format conversions
scale_opencl does not support rgba output in this jellyfin-ffmpeg build.
Rewrite the OpenCL kernel to accept and emit NV12 planes directly
(src_y, src_uv, dst_y, dst_uv) doing YCbCr↔RGB conversion internally.
Remove the scale_opencl=format=rgba and scale_opencl=format=nv12
wrappers from GetCrtShaderOclFilters — program_opencl alone is enough.

VAAPI decoder path: hwdownload+hwupload to QSV (safe; program_opencl
creates new output frames without a VAAPI reverse link).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 01:19:55 +01:00
mani
26668426d4 Fix CRT shader: simplify VAAPI path to mirror Jellyfin's own OCL pattern
All previous hwmap changes were based on diagnosing exit code 8 as a
mapping failure, but the real cause was always build_opts. Now that
build_opts is removed, use the same VAAPI→OpenCL→reverse(VAAPI)→QSV
pattern that Jellyfin already uses for the doOclTonemap+isVaInVaOut
path instead of the unnecessary QSV intermediate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 00:16:56 +01:00
mani
945cb3a116 Fix CRT shader: remove build_opts (not supported by jellyfin-ffmpeg)
program_opencl in this jellyfin-ffmpeg version does not have a build_opts
option. This caused FFmpeg to exit with code 8 before even running.

The shader already has #ifndef SHADOW_MASK / #define SHADOW_MASK 2 / #endif
as defaults, so removing build_opts keeps the same Aperture Grille mask.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 00:11:46 +01:00
mani
d12a39e0c0 Fix CRT shader: route VAAPI→QSV before OpenCL for valid reverse=1
hwmap reverse=1 only works back to the device the OpenCL context was
derived from. When using a VAAPI decoder, go VAAPI→QSV first (zero-copy
on Intel, they share the same libva surfaces), so the OpenCL context is
then QSV-derived and reverse=1 back to QSV works correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 23:53:00 +01:00
mani
b9b7b6f7ef Fix CRT shader: map OpenCL→QSV directly, skip broken VAAPI intermediate
hwmap=derive_device=vaapi:mode=write:reverse=1 after scale_opencl fails
because scale_opencl creates a new OpenCL surface that has no association
with the original VAAPI surface. reverse=1 requires an existing mapping.

On Intel, VAAPI and QSV share the same libva surfaces, so mapping the
post-CRT OpenCL frame directly to QSV (mode=write:reverse=1) works the
same way it does in the doOclTonemap path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 23:18:48 +01:00
mani
dd73b1d309 Fix StreamInfo.ToUrl: restore plain key=value for StreamOptions
The previous (wrong) change encoded options as streamOptions[key]=value.
ParseStreamOptions reads IQueryCollection verbatim, so the key would be
stored as "streamOptions[crtShader]" instead of "crtShader", breaking
TryGetValue("crtShader"). Restore the original plain format so the
server-side lookup works correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 23:05:57 +01:00
mani
464c02885e Fix CRT shader: add missing QSV decoder path in VAAPI+QSV pipeline
The SDR case (QSV decoder + QSV encoder, no OCL tonemap) was never
handled — the frame stayed in QSV VRAM with no OpenCL round-trip,
so the CRT filter was simply never applied.

Add else-if (isQsvDecoder) branch that maps QSV→OpenCL, applies the
CRT kernel, then reverse-maps back to QSV.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 21:15:41 +01:00
mani
fb4b87df07 Debug CRT shader: add detailed logging to IsCrtShaderEnabled
Inject ILogger<EncodingHelper> and log all conditions individually
so we can see exactly which check is failing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 02:42:35 +01:00
mani
7574c7eb83 Fix CRT shader: add program_opencl to required filters whitelist
SupportsFilter("program_opencl") always returned false because
program_opencl was missing from the _requiredFilters list in
EncoderValidator. GetFFmpegFilters() only reports filters that are
in that whitelist, so IsCrtShaderEnabled() was silently always false.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 02:23:18 +01:00
mani
d725f9a583 Add CRT shader support to Intel QSV pipeline
Insert VAAPI→OpenCL→CRT→VAAPI round-trip (isVaapiDecoder path) and
inline OCL filters (doOclTonemap path) into GetIntelQsvVaapiVidFiltersPrefered
so the CRT Lottes shader is applied when the h264_qsv encoder is active.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 14:39:21 +01:00
mani
cddaff96c2 Fix CRT shader: add OpenCL capability check and scale_opencl syntax
- IsCrtShaderEnabled now guards on SupportsHwaccel("opencl"),
  SupportsFilter("program_opencl") and SupportsFilter("scale_opencl")
  so the filter is silently skipped instead of causing an FFmpeg error
  when OpenCL is unavailable
- Drop w=iw:h=ih from scale_opencl (iw/ih are not valid expressions in
  the OpenCL scale filter; omitting them defaults to input dimensions)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 14:24:38 +01:00
mani
6fbc0f87df Add CRT-Lottes shader via FFmpeg program_opencl
Implements Timothy Lottes' CRT shader (port of mpv-retro-shaders) as an
optional server-side post-processing filter activated per playback session
via streamOptions[crtShader]=true.

Server-side changes:
- Add crt_lottes.cl OpenCL kernel (scanlines, bloom, curvature, shadow mask
  variants 0-4, sRGB linearisation) deployed alongside the server binary
- Add IsCrtShaderEnabled / GetCrtShaderOclFilters / GetCrtShaderFilter
  helpers to EncodingHelper
- SW pipeline: format=rgba → hwupload → program_opencl → hwdownload
- Intel VAAPI + OCL tonemap: inline scale_opencl round-trip (zero PCIe)
- Intel VAAPI, VAAPI encoder, no tonemap: hwmap→opencl→CRT→hwmap (zero PCIe)
- Intel VAAPI, SW encoder, no tonemap: hwmap→opencl→CRT→hwdownload (1× PCIe)
- AMD VAAPI + VK tonemap: hwmap→opencl→CRT→hwmap after scale_vaapi (zero PCIe)
- AMD VAAPI, SW encoder: hwmap→opencl→CRT→hwdownload (1× PCIe)

Shadow mask variant is configurable via streamOptions[crtShadowMask]=0..4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 14:19:31 +01:00
mani
0bc8b92b6a Merge tag 'v10.11.6' into release-10.11.z 2026-01-20 14:19:06 +01:00
Jellyfin Release Bot
10662e75e4 Bump version to 10.11.6 2026-01-18 20:02:59 -05:00
Joshua M. Boniface
a2b1936e73 Merge pull request #15816 from theguymadmax/preserve-artist-order
Fix artist display order
2026-01-18 19:48:17 -05:00
theguymadmax
2df546af6d Deduplicate using Distinct 2026-01-18 18:16:45 -05:00
Claus Vium
338b480217 Merge pull request #16046 from theguymadmax/restore-weekly-images
Restore weekly refresh for library folder images
2026-01-18 16:36:45 +01:00
theguymadmax
2943bb6fdd Restore collection folder image refresh 2026-01-18 01:51:51 -05:00
theguymadmax
94edcbd2d1 Fix artist ordering DtoServices 2026-01-17 10:14:41 -05:00
theguymadmax
a8d1cdefac Address review comments 2026-01-17 10:14:41 -05:00
Tim Eisele
a518160a6f Prioritize better matches on search (#15983) 2026-01-16 19:05:46 -07:00
Tim Eisele
b56de6493f Be more strict about PersonType assignments (#15872) 2026-01-16 19:03:13 -07:00
theguymadmax
093cfc3f3b Trim music artist names (#15808) 2026-01-16 18:51:48 -07:00
theguymadmax
49775b1f6a Fix birthplace not saving correctly (#16020) 2026-01-16 18:47:40 -07:00
Collin T Swisher
22d593b8e9 Add mblink creation logic to library update endpoint. (#15965) 2026-01-16 18:47:04 -07:00
theguymadmax
2cb7fb52d2 Skip hidden directories and .ignore paths in library monitoring (#16029) 2026-01-16 18:45:19 -07:00
Joshua M. Boniface
8433b6d8a4 Merge pull request #15899 from MarcoCoreDuo/fix-watch-state-not-kept
Fix watched state not kept on Media replace/rename
2026-01-16 16:40:36 -05:00
Bond-009
32d2414de0 Merge pull request #15950 from theguymadmax/revert-sort-index-number
Revert "always sort season by index number"
2026-01-09 18:38:23 +01:00
Bond-009
317a3a47c3 Merge pull request #15961 from theguymadmax/fix-bad-plugin-url
Fix crash when plugin repository has an invalid URL
2026-01-09 18:24:48 +01:00
mani
7cc33291f5 Add -stats flag to preserve progress updates with custom log level
- FFmpeg suppresses progress output (fps, time, bitrate) when loglevel is set to error
- Add -stats flag to force progress updates regardless of log level
- Fixes dashboard not showing transcode info (codec, progress, etc.)
2026-01-08 23:32:31 +01:00
mani
28854ebf2e Add configurable FFmpeg log level
- Add FfmpegLogLevel property to EncodingOptions (default: 'error')
- Use configuration value in GetInputModifier instead of hardcoded value
- Allows changing log verbosity without rebuild via encoding.xml
- Possible values: quiet, panic, fatal, error, warning, info, verbose, debug, trace
2026-01-08 23:32:31 +01:00
mani
7500f4a37f Reduce FFmpeg log verbosity and add client info to error logs
- Set FFmpeg loglevel to 'error' to suppress repetitive warnings like 'Skipping NAL unit'
- Add client IP and User-Agent to exception middleware logging for better debugging
2026-01-08 23:32:31 +01:00
mani
9ae454aa18 Add forced transcoding for remote sources based on user permission
Implement ForceRemoteSourceTranscoding permission check that disables
direct play and direct stream for remote media sources, forcing transcoding
when the user has this permission enabled.
2026-01-08 23:32:31 +01:00
mani
49beabce9e Improve remote source detection for HTTP streams in M3U tuner
HTTP/HTTPS streams are now considered remote unless explicitly localhost,
rather than relying on local network detection. This ensures proper handling
of streams that appear to be in the local network but should be treated as remote sources.
2026-01-08 23:32:31 +01:00
theguymadmax
845b8cdc8f Fix crash when plugin repository has an invalid URL 2026-01-06 11:57:25 -05:00
theguymadmax
c86f6439c5 Revert "always sort season by index number"
This reverts commit e16ea7b236.
2026-01-05 11:06:25 -05:00
theguymadmax
559e0088e5 Fix tag inheritance for Continue Watching queries (#15931) 2026-01-04 11:20:34 -07:00
MarcoCoreDuo
adaca95590 make db context creation async 2025-12-31 07:43:07 +01:00
MarcoCoreDuo
09a1c31fa3 Refactor ReattachUserData methods to be asynchronous 2025-12-31 03:06:07 +01:00
MarcoCoreDuo
e4b82025b8 move reattaching user data to own function and call it only after fetching metadata for the first time 2025-12-30 22:04:59 +01:00
Collin T Swisher
78e3702cb0 Fix playlist item de-duplication (#15858) 2025-12-24 07:50:15 -07:00
Bond-009
01b20d3b75 Merge pull request #15833 from nyanmisaka/fix-h264-av1-sdr-hls-fallback
Fix missing H.264 and AV1 SDR fallbacks in HLS playlist
2025-12-24 10:28:33 +01:00
Tim Eisele
156761405e Prefer US rating on fallback (#15793) 2025-12-19 20:41:09 -07:00
Claus Vium
1805f2259f add CultureDto cache (#15826) 2025-12-19 20:38:54 -07:00
Nyanmisaka
4c587776d6 Fix the use of HWA in unsupported H.264 Hi422P/Hi444PP (#15819) 2025-12-19 19:58:56 -07:00
gnattu
8379b4634a Enforce more strict webm check (#15807) 2025-12-19 19:57:08 -07:00
Nyanmisaka
9470439cfa Fix video lacking SAR and DAR are marked as anamorphic (#15834) 2025-12-19 19:54:48 -07:00