Commit Graph

657 Commits

Author SHA1 Message Date
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
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
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
Nyanmisaka
4c587776d6 Fix the use of HWA in unsupported H.264 Hi422P/Hi444PP (#15819) 2025-12-19 19:58:56 -07:00
Nyanmisaka
035b5895b0 Fix AV1 decoding hang regression on RK3588 (#15776) 2025-12-13 08:27:29 -07:00
nyanmisaka
026f7472cb Fix the empty output of trickplay on RK3576
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2025-11-30 21:38:47 +08:00
gnattu
1e7e46cb82 Prevent copying HDR streams when only SDR is supported (#15556) 2025-11-18 18:37:35 -07:00
Nyanmisaka
a725220c21 Reject stream copy of HDR10+ video if the client does not support HDR10 (#15072) 2025-10-21 17:20:56 -06:00
Nyanmisaka
badf22fcc2 Limit decoder thread count on AMD AMF to save VRAM (#14943) 2025-10-04 08:04:25 -06:00
Nyanmisaka
db55d983f8 Only enable VAAPI MJPEG encoder on Intel iHD driver (#14433) 2025-07-07 18:05:14 -06:00
Nyanmisaka
ebdc756547 Fix -fps_mode option being applied on input (#14379) 2025-06-26 17:48:43 -06:00
Bond-009
a537c66da1 Merge pull request #14322 from gnattu/disable-hdr-non-hdr-clients
Don't check dynamic metadata removal for static HDR formats
2025-06-19 11:27:23 +02:00
Nyanmisaka
e8291fc856 Fix QSV "static surface pool size exceeded" on Windows
d3d11va doesn't support dynamic pool size, use vpp filter ctx to relay to prevent encoder async and bframes from exhausting the decoder pool.
2025-06-17 15:02:13 +08:00
gnattu
368808eba4 Don't check dynamic metadata removal for static HDR formats
Those videos have no metadata to be removed at all, just force transcoding when the client does not support it.
2025-06-17 02:29:16 +08:00
gnattu
bdb3adeb30 Don't attempt to do metadata removal for dovi without fallback (#14240) 2025-06-08 07:29:17 -06:00
nyanmisaka
1ee705f3e1 Fix RKRGA 2pass scaling issue caused by auto AR reduction
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2025-05-26 23:49:04 +08:00
nyanmisaka
0e0c7c5c59 Offload 1080p+ subtitle scaling to RKRGA
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2025-05-26 23:49:04 +08:00
nyanmisaka
56231222df Enable OpenCL deinterlacer for AMF on Windows when available
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2025-05-20 22:07:00 +08:00
Nyanmisaka
07093c84c8 Use VBR and MBBRC in QSV encoders for better quality (#14079) 2025-05-08 14:43:13 -06:00
Nyanmisaka
4199f7acc2 Fix the transparency issue of ASS subtitle rendering in HWA (#14024) 2025-05-03 08:21:08 -06:00
Nyanmisaka
8be8ea60f1 Add DoVi Profile 5 support for Rockchip RKMPP (#13911) 2025-04-13 07:43:58 -06:00
Nyanmisaka
98697e75ca Fix seeking beyond EOF again (#13871) 2025-04-08 14:58:55 -06:00
Joshua M. Boniface
7d705249ca Merge commit from fork
Fix validation of API parameters passed to FFmpeg
2025-04-05 14:44:19 -04:00
Tim Eisele
d0c1ef8002 Update MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
Co-authored-by: Cody Robibero <cody@robibe.ro>
2025-04-03 20:42:33 +02:00
timminator
d1ed6593ad Make ReadInputAtNativeFramerate configurable for M3U tuner (#13773) 2025-04-03 09:18:00 -06:00
Tim Eisele
596b635511 Cleanup extracted files (#13760)
* 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
2025-04-03 09:17:14 -06:00
gnattu
49ac705867 Improve dynamic HDR metadata handling (#13277)
* Add support for bitstream filter to remove dynamic hdr metadata

* Add support for ffprobe's only_first_vframe for HDR10+ detection

* Add BitStreamFilterOptionType for metadata removal check

* Map HDR10+ metadata to VideoRangeType.cs

Current implementation uses a hack that abuses the EL flag to avoid database schema changes. Should add proper field once EFCore migration is merged.

* Add more Dolby Vision Range types

Out of spec ones are problematic and should be marked as a dedicated invalid type and handled by the server to not crash the player.

Profile 7 videos should not be treated as normal HDR10 videos at all and should remove the metadata before serving.

* Remove dynamic hdr metadata when necessary

* Allow direct playback of HDR10+ videos on HDR10 clients

* Only use dovi codec tag when dovi metadata is not removed

* Handle DV Profile 7 Videos better

* Fix HDR10+ with new bitmask

* Indicate the presence of HDR10+ in HLS SUPPLEMENTAL-CODECS

* Fix Dovi 8.4 not labeled as HLG in HLS

* Fallback to dovi_rpu bsf for av1 when possible

* Fix dovi_rpu cli for av1

* Use correct EFCore db column for HDR10+

* Undo outdated migration

* Add proper hdr10+ migration

* Remove outdated migration

* Rebase to new db code

* Add migrations for Hdr10PlusPresentFlag

* Directly use bsf enum

* Add xmldocs for SupportsBitStreamFilterWithOption

* Make `VideoRangeType.Unknown` explicitly default on api models.

* Unset default for non-api model class

* Use tuples for bsf dictionary for now
2025-04-02 18:06:02 -06:00
Bond-009
e9729a536f Use pattern matching for null checks (#13793)
Fix the few that slipped through
2025-03-31 17:38:25 -06:00
Bond-009
476a0d6932 Merge pull request #13194 from gnattu/av1-videotoolbox
Enable VideoToolbox AV1 decode
2025-03-30 23:12:53 +02:00
Shadowghost
3df7d7a809 Add validation for level input 2025-03-28 08:21:37 +01:00
Shadowghost
1fcc79316d Rename ValidationRegex to ContainerValidationRegex 2025-03-28 08:21:37 +01:00
Nyanmisaka
a123a2cb22 Fix validation of VAAPI/QSV render node path (#13786)
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2025-03-27 17:59:32 -06:00
JPVenson
160020c551 WIP fixed namespaces 2025-03-25 15:30:22 +00:00
JPVenson
dfdef511a5 Merge remote-tracking branch 'jellyfinorigin/master' into feature/pgsql_provider 2025-02-05 18:32:13 +00:00
gnattu
d52ab30ae9 Backport pull request #13313 from jellyfin/release-10.10.z
Use nv15 as intermediate format for 2-pass rkrga scaling

Original-merge: 5c6317f68d

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

Backported-by: Bond_009 <bond.009@outlook.com>
2025-02-03 16:59:05 -05:00
Shadowghost
e79fc6b851 Backport pull request #13288 from jellyfin/release-10.10.z
Fix DTS in HLS

Original-merge: cea0c95942

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

Backported-by: Bond_009 <bond.009@outlook.com>
2025-02-03 16:59:04 -05:00
gnattu
4595625f19 Backport pull request #13262 from jellyfin/release-10.10.z
Don't use custom params on ultrafast x265 preset

Original-merge: 86160cd99c

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

Backported-by: Bond_009 <bond.009@outlook.com>
2025-02-03 16:59:03 -05:00
nyanmisaka
bc1419728f Backport pull request #13151 from jellyfin/release-10.10.z
Always do tone-mapping for HDR transcoding when software pipeline is used

Original-merge: b31f1696f2

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

Backported-by: Bond_009 <bond.009@outlook.com>
2025-02-03 16:55:53 -05:00
JPVenson
17003f4d76 Merge remote-tracking branch 'jellyfinorigin/master' into feature/pgsql_provider 2025-02-02 02:09:14 +00:00
Josh Soref
40da2ccac5 Fix spelling (#13444)
* spelling: anamorphic

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: associated

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: channelinfo

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: eagerly

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: enumerable

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: greater than/less than

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: greater

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: lineup

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: logs out

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: names

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: paging

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: playlist

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: sanitized

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: saving

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2025-01-28 11:27:34 +01:00
JPVenson
aa811eb1e3 Prepared Seperation of Database components for future multi provider support 2025-01-26 20:45:28 +00:00
luzpaz
b37bc9016f Fix typos
Found via `codespell -q 3 -D ../../dictionary.txt -S "./Emby.Server.Implementations/Localization" -L allready,childrens,groupe,inh,raisons,re-use,som,supercede,superceded,thirdparty,whoknows`
2025-01-26 11:14:03 -05:00
Josh Soref
044cf9fb85 chore: fix spelling
* a
* acceleration
* addition
* altogether
* api clients
* artist
* associated
* bandwidth
* cannot
* capabilities
* case-insensitive
* case-sensitive
* configuration
* delimiter
* dependent
* diacritics
* directors
* enable
* explicitly
* filters
* finish
* have
* hierarchy
* implicit
* include
* information
* into
* its
* keepalive
* localization
* macos
* manual
* matching
* metadata
* nonexistent
* options
* overridden
* parsed
* parser
* playback
* preferring
* processes
* processing
* provider
* ratings
* retrieval
* running
* segments
* separate
* should
* station
* subdirectories
* superseded
* supported
* system
* than
* the
* throws
* transpose
* valid
* was

link: forum or chat rooms

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2025-01-25 20:05:15 -05:00
gnattu
0fc288936d Enable VideoToolbox AV1 decode
This decoder differs from others provided by VideoToolbox in that it lacks any software fallback. To achieve consistent behavior with other VideoToolbox decoders, this PR implemented additional checking on the server to simulate the software fallback provided by VideoToolbox.

The current fallback checking mechanism is a temporary solution. In the long term, it should be replaced with a more capable hardware capability checking system.
2024-12-09 16:17:49 +08:00
nyanmisaka
9f86f8748c Backport pull request #13026 from jellyfin/release-10.10.z
Fix missing procamp vaapi filter

Original-merge: cf11a2dc1e

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

Backported-by: Joshua M. Boniface <joshua@boniface.me>
2024-11-19 15:43:29 -05:00