jellyfin/MediaBrowser.Controller/MediaEncoding
scheilch 5cfa466d8b
fix: cap GetVideoBitrateParamValue at 400 Mbps (#16467)
* fix: cap GetVideoBitrateParamValue at 400 Mbps

The previous cap of int.MaxValue / 2 (~1073 Mbps) is far beyond any
realistic transcode target and allows encoder parameters derived from
it (e.g. -bufsize = bitrate * 4 for QSV) to grow to multi-gigabit
values, which is incorrect regardless of whether the encoder tolerates it.

400 Mbps is a safe upper bound for all current hardware encoders:
- Intel QSV H.264 peaks at ~300 Mbps (High 5.1 CPB = 168.75 Mbit)
- HEVC High Tier Level 5.x supports ~240 Mbps
- AV1 hardware encoders have no meaningful real-world constraint at
  this level

The existing FallbackMaxStreamingBitrate mechanism (default 30 Mbps)
provides a similar guard but only when LiveStreamId is set, covering
M3U and HDHR sources. Plugin-provided streams and any source that
bypasses the LiveTV pipeline are not subject to it and can pass
unreasonably high values downstream. This cap closes that gap for
all encoder paths.

Suggested by @nyanmisaka in review of #16376.

* Update MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

---------

Co-authored-by: Bond-009 <bond.009@outlook.com>
2026-03-29 12:39:16 +02:00
..
BaseEncodingJobOptions.cs Merge pull request #15926 from abitofevrything/feat/accurate_hls_seeking 2026-01-18 12:17:06 +01:00
BitStreamFilterOptionType.cs Improve dynamic HDR metadata handling (#13277) 2025-04-02 18:06:02 -06:00
DownMixAlgorithmsHelper.cs Add comments for Dave750/NightmodeDialogue 7.1 downmix 2024-08-01 07:45:16 +08:00
EncodingHelper.cs fix: cap GetVideoBitrateParamValue at 400 Mbps (#16467) 2026-03-29 12:39:16 +02:00
EncodingJobInfo.cs Merge pull request #15926 from abitofevrything/feat/accurate_hls_seeking 2026-01-18 12:17:06 +01:00
FilterOptionType.cs Fix the transparency issue of ASS subtitle rendering in HWA (#14024) 2025-05-03 08:21:08 -06:00
IAttachmentExtractor.cs Cleanup extracted files (#13760) 2025-04-03 09:17:14 -06:00
IMediaEncoder.cs Improve dynamic HDR metadata handling (#13277) 2025-04-02 18:06:02 -06:00
ISubtitleEncoder.cs Expose ExtractAllExtractableSubtitles (#14876) 2025-09-26 13:45:01 -06:00
ITranscodeManager.cs Updated contributors, upgraded to AsyncKeyedLocker 6.3.0 which now supports non-keyed locking using a similar interface and changed SemaphoreSlim-based locks to using AsyncNonKeyedLocker. 2024-01-14 12:11:16 +01:00
JobLogger.cs Fix nullable annotation 2026-01-14 18:55:47 +01:00
MediaInfoRequest.cs
TranscodingJob.cs move to new System.Threading.Lock type for better performance 2024-12-12 18:10:06 +05:00
TranscodingJobType.cs Remove BOM from UTF-8 files 2024-08-30 15:29:48 +02:00
TranscodingSegmentCleaner.cs Apply suggestions from code review 2024-03-17 20:45:00 +08:00
TranscodingThrottler.cs Remove BOM from UTF-8 files 2024-08-30 15:29:48 +02:00