Commit graph

527 commits

Author SHA1 Message Date
gnattu
32fe92d8f5
Only reselect audio streams when user preference is respected (#13832) 2025-04-08 19:22:30 -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
Tim Eisele
824bafc32d
Fix StreamInfo.ToUrl (#13808) 2025-03-30 21:37:58 -06:00
Tim Eisele
9657708b38
Reduce allocations, simplifed code, faster implementation, included tests - StreamInfo.ToUrl (#9369)
* Rework PR 6168

* Fix test
2025-03-28 06:51:44 -06:00
Dmitry Lyzo
cb931e0062
Add profile condition to limit the number of streams (#13583) 2025-03-28 06:51:22 -06:00
Dmitry Lyzo
777e0823ba
Extract container, video and audio compatibility checks (#12678)
* Extract container, video and audio compatibility checks

* Extract audio compatibility checks

* Extract CheckVideoConditions

* Simplify direct audio stream check
2025-03-26 20:24:16 -06:00
gnattu
c05a41cc3c Backport pull request #13423 from jellyfin/release-10.10.z
Don't select audio stream and codec explicitly for copy when bitrate exceeds limit

Original-merge: e8514de33b

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

Backported-by: Bond_009 <bond.009@outlook.com>
2025-02-03 17:07:11 -05:00
gnattu
ceba3475fb Backport pull request #13345 from jellyfin/release-10.10.z
Never treat matroska as webm for audio playback

Original-merge: 344cc8b97b

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

Backported-by: Bond_009 <bond.009@outlook.com>
2025-02-03 16:59:06 -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
8cb11692a9 Backport pull request #13209 from jellyfin/release-10.10.z
Transcode to audio codec satisfied other conditions when copy check failed.

Original-merge: 8aa41d5904

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

Backported-by: Bond_009 <bond.009@outlook.com>
2025-02-03 16:56:01 -05:00
Bond-009
bcdffa74a8
Remove useless checks and dead code (#13405)
* Remove useless checks and dead code

* Enable adaptive bitrate streaming again

* Disable adaptive bitrate streaming by default
2025-01-28 11:29:22 +01: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
Bond_009
47f798827b Remove useless checks and dead code 2025-01-22 17:31:52 +01:00
Niels van Velzen
3b8e614819
Prefer ApiKey over api_key in generated URL's (#13342) 2025-01-11 09:35:44 -07:00
gnattu
9e386ecc27 Backport pull request #12931 from jellyfin/release-10.10.z
Set AudioCodec when building stream

Original-merge: a165883999

Merged-by: nielsvanvelzen <nielsvanvelzen@users.noreply.github.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
2024-11-03 10:55:51 -05:00
joshjryan
3edd6ab767
Fix allow inputContainer to be null for Live TV (#12770) 2024-10-04 06:51:08 -06:00
Niels van Velzen
bcc818f397
Fix DeviceProfile.Id should be nullable (#12679) 2024-09-22 08:58:23 -06:00
gnattu
56cf1a581c
Better bitrate and resolution normalization (#12644) 2024-09-21 20:01:47 -06:00
gnattu
d944f415f3 Let HLS Controller decide if subtitle should be burn in
Previously, we predicted whether the subtitle should be burned in with transcode reasons, but that was not accurate because the actual transcoding codec is only determined after the client has requested the stream. This pass through the option to the `DynamicHlsController` to handle the subtitle burn-in during the actual transcoding process. Now the client should be responsible to conditionally load the subtitle when this option is enabled.
2024-09-22 00:35:41 +08:00
Shadowghost
5a5da33f44 Apply review suggestions 2024-09-17 23:34:12 +02:00
Shadowghost
2351eeba56 Rework PR 6203 2024-09-17 20:35:23 +02:00
Dmitry Lyzo
77c6fd5ab2 Improve direct profile ranking 2024-09-14 01:26:51 +08:00
gnattu
6a5f22fc2f Revert "Return more precise transcoding reasons"
This reverts commit de8bb15c

Signed-off-by: gnattu <gnattuoc@me.com>
2024-09-14 01:24:57 +08:00
gnattu
5913db991b Improve readability
Signed-off-by: gnattu <gnattuoc@me.com>
2024-09-13 22:46:36 +08:00
gnattu
de8bb15c78 Return more precise transcoding reasons
Using the first profile's reason is somewhat arbitrary, as many clients' first profile may not be the most compatible one. For instance, browsers often set WebM as the first profile, which doesn’t support common codecs like H.264 and AAC by design. This causes `VideoCodecNotSupported` and `AudioCodecNotSupported` to be returned, even if the browser supports those codecs. Only use those reasons when all profiles indicate that the codec is not supported.

Signed-off-by: gnattu <gnattuoc@me.com>
2024-09-13 18:19:05 +08:00
gnattu
62712aa12c
Add option to always burn in subtitles if transcoding is triggered (#12430) 2024-09-12 09:53:21 -06:00
Dmitry Lyzo
3da081ba86
Add audio ranking for transcoding profiles (#12546) 2024-09-09 13:16:58 -06:00
Dmitry Lyzo
54f663b0f3
Extract condition from Where clause to eliminate extra filtering (#12614) 2024-09-09 07:51:28 -06:00
gnattu
b4f71859d9
Make Live TV compatibility profiles customizable (#12529) 2024-09-07 21:08:54 -06:00
gnattu
df00909b85
Backport #12562 and #12521 (#12602)
Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com>
Co-authored-by: Nyanmisaka <nst799610810@gmail.com>
2024-09-07 11:21:14 -06:00
gnattu
5a8a19e07b
Add MediaStream.ReferenceFrameRate for problematic video files (#12603)
Co-authored-by: Nyanmisaka <nst799610810@gmail.com>
2024-09-07 11:16:23 -06:00
gnattu
29d5344ba7 fix typo
Signed-off-by: gnattu <gnattuoc@me.com>
2024-08-26 00:04:08 +08:00
gnattu
e31c6d3934 Add SubContainer support to CodecProfile
Currently, when specifying codec profiles, the client can only specify profiles applied to direct containers, with no way to apply a profile specifically to HLS or a specific HLS container. This limitation is not suitable for more complex client codec support scenarios.

To address this, a SubContainer field is added to CodecProfile. The client can now specify the main container as "hls" to apply the profile exclusively to HLS streams. Additionally, the SubContainer field allows the profile to be applied to a specific HLS container.

Currently, this is only used in StreamBuilder for HLS streams. Further changes may be required to extend its usage.

Signed-off-by: gnattu <gnattuoc@me.com>
2024-08-26 00:04:05 +08:00
dmitrylyzo
ca4bd57b8d Backport pull request #12499 from jellyfin/release-10.9.z
Apply all codec conditions

Original-merge: fff4477a93

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

Backported-by: Joshua M. Boniface <joshua@boniface.me>
2024-08-25 02:46:42 -04:00
Bond_009
0a0de6708e Enable more analyser rules as errors
Also deduplicates a bit of code inside of SeasonPathParser and adds some more tests
2024-08-01 17:17:10 +02:00
gnattu
162ea38a95
Check MaxAudioChannels for directAudioStream candidates (#12319)
* Check MaxAudioChannels for directAudioStream candidates

The current stream builder logic does not check the channel limit when determining if the audio stream can be directly used, and this can cause some undesired effects:

- A high channel count surround sound stream might be picked even if a stereo one exists when the user requires stereo audio.

- The user's preferred audio codec might not be respected during the downmix because the requested codec is now forced to be the same as the original source.

Signed-off-by: gnattu <gnattuoc@me.com>

* Fix unit test

Signed-off-by: gnattu <gnattuoc@me.com>

* Set correct transcode reason and target channels for unit test

Signed-off-by: gnattu <gnattuoc@me.com>

* Match old stream selection behavior

Signed-off-by: gnattu <gnattuoc@me.com>

* Fix reason matching

Signed-off-by: gnattu <gnattuoc@me.com>

---------

Signed-off-by: gnattu <gnattuoc@me.com>
2024-07-29 00:11:59 +02:00
Bond-009
d5cf0ad2c8
Merge pull request #11492 from jellyfin/better-vbr-settings
Add better audio VBR settings
2024-07-21 16:15:43 +02:00
Cody Robibero
4239de1ee7
Merge pull request #11399 from jellyfin/audio-remux 2024-07-18 08:12:20 -04:00
gnattu
855215673a
Use string.Equals
Co-authored-by: Bond-009 <bond.009@outlook.com>
2024-07-18 17:50:19 +08:00
gnattu
ce7cbc1f64 Don't check the misleading options.EnableDirectStream for direct stream availability
Signed-off-by: gnattu <gnattuoc@me.com>
2024-07-18 01:49:55 +08:00
gnattu
7ad432be23 Default EnableAudioVbrEncoding to true in TranscodingProfile
This will match the old behavior when user takes no action for clients

Signed-off-by: gnattu <gnattuoc@me.com>
2024-07-17 21:27:35 +08:00
gnattu
0381c5a288 Add EnableAudioVbrEncoding to TranscodingProfile
This will allow the client selectively disable VBR audio when it causes problems.

Signed-off-by: gnattu <gnattuoc@me.com>
2024-07-17 21:27:35 +08:00
gnattu
c8f157444c Make comment better
Signed-off-by: gnattu <gnattuoc@me.com>
2024-07-17 14:08:39 +08:00
gnattu
ed9d27bb3a Correctly set bitrate limit for remuxing
Signed-off-by: gnattu <gnattuoc@me.com>
2024-07-17 13:35:59 +08:00
gnattu
a16d3d4887 Allow clients to send audio container override for HLS
This will improve flexibility due to overcome the complex compatibility situation of HLS

Signed-off-by: gnattu <gnattuoc@me.com>
2024-07-17 13:35:59 +08:00
gnattu
e4101128e0 feat: add audio remux to UniversalAudioController
Signed-off-by: gnattu <gnattuoc@me.com>
2024-07-17 13:35:59 +08:00
gnattu
5df171b3f9 Add remuxing support for VP9
Add VP9 as a valid HLS format to enable remuxing. This is useful when audio processing is required, but the VP9 video can be passed as-is to avoid unnecessary video transcoding.

No VP9 encoder is enabled and should not be enabled. AV1 and HEVC should be preferred over VP9 if video transcoding is required.

Signed-off-by: gnattu <gnattuoc@me.com>
2024-05-16 09:34:21 +08:00
standstaff
64b7f0f721 chore: remove repetitive words
Signed-off-by: standstaff <zhengxingru@yeah.net>
2024-03-15 17:08:03 +08:00
Cody Robibero
e731250342 Lowercase MediaStreamProtocol for backwards compatibility 2024-03-08 15:29:22 -07:00
Niels van Velzen
407cf5d0bf
Add MediaStreamProtocol enum (#10153)
* Add MediaStreamProtocol enum

* Add default handling for enum during deserialization

---------

Co-authored-by: Cody Robibero <cody@robibe.ro>
2024-03-04 16:44:54 -07:00