Commit Graph

660 Commits

Author SHA1 Message Date
mani
9ddeffa563 Simplify conditions for downloads folder and timestamp fixes
- Downloads folder: use for ANY request without SegmentContainer (not just Progressive)
- Timestamp normalization: apply whenever CopyTimestamps=false (not just Progressive)
- Removes overly restrictive conditions that prevented fixes from working
- Should now work for all download scenarios
2026-01-08 03:03:10 +01:00
mani
39adf0e1ff Add debug logging for downloads folder and timestamp fixes
- Log SegmentContainer, Context, TranscodingType in StreamingHelpers
- Log TranscodingType, CopyTimestamps, OutputContainer in EncodingHelper
- Debug why downloads not using /downloads/ folder
- Debug why timestamps not being normalized
2026-01-08 02:53:40 +01:00
mani
02318463dd Fix negative audio timestamps in progressive downloads
- Move -avoid_negative_ts to global output options
- Was only applied to video stream, now applies to both video and audio
- Fixes audio start_time being negative (-0.036) while video was at 0
- Ensures both streams start at timestamp 0 for proper seeking
2026-01-08 02:44:49 +01:00
mani
1ed9bf2f50 Fix timestamp seeking for progressive downloads in mpv/iina/infuse
- Remove avoid_negative_ts from movflags (not a movflag option)
- Add explicit -avoid_negative_ts make_zero -start_at_zero for progressive downloads
- Ensures timestamps always start at 0 for proper seeking in strict players
2026-01-08 02:20:41 +01:00
mani
0e80b23c32 Add avoid_negative_ts make_zero for progressive MP4 downloads
- Ensures timestamps start at 0 for better player compatibility
- Fixes timestamp/seeking issues in mpv and other strict players
2026-01-08 01:44:05 +01:00
mani
95e168d397 Improve MP4 movflags for better mpv seeking compatibility
- Add frag_keyframe for fragment-based seeking
- Add default_base_moof for proper base decode time
- Keep faststart for metadata at file start
- Fixes seeking/timestamp issues in mpv player
2026-01-08 01:42:47 +01:00
mani
62db97a210 Use consistent movflags syntax for progressive MP4 downloads
- Change 'faststart' to '+faststart' for consistency with other movflags
- Ensures moov atom is at the start of file for better seeking
2026-01-08 01:24:38 +01:00
mani
60f8a22b26 Fix build error: correct StreamingRequestDto cast
The previous commit referenced state.Request.SegmentContainer which doesn't
exist. BaseEncodingJobOptions doesn't have a SegmentContainer property - only
StreamingRequestDto does.

Fixed by:
- Cast BaseRequest to StreamingRequestDto before accessing SegmentContainer
- Add using directive for MediaBrowser.Controller.Streaming namespace
- Use null-conditional operator to safely check SegmentContainer
2026-01-08 00:54:26 +01:00
mani
a2f0eef49b Fix MP4 movflags for progressive downloads
Use faststart instead of fragmented MP4 flags for non-segmented streams.
This fixes seeking and duration metadata in downloaded transcoded files.

When transcoding for download (no segment container), MP4 files now use
the faststart movflag which moves the moov atom to the beginning of the
file. This enables:
- Proper duration metadata for video players
- Accurate time display and seeking
- Better compatibility with standard video players

Fragmented MP4 flags (frag_keyframe+empty_moov+delay_moov) are still
used for adaptive streaming (HLS/DASH) where segment containers are specified.
2026-01-08 00:39:12 +01:00
mani
df8a949e12 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-06 02:37:54 +01:00
mani
e723baae39 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-06 02:17:07 +01:00
mani
fb306f3ad8 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-06 02:01:43 +01: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