mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #12639] [MERGED] Test StreamBuilder more precisely & improve the transcode reason #13299
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/12639
Author: @gnattu
Created: 9/13/2024
Status: ✅ Merged
Merged: 9/16/2024
Merged by: @crobibero
Base:
master← Head:more-streambuilder-test📝 Commits (10+)
6395f48Update unit test for StreamBuilder to reflect current server and clientsde8bb15Return more precise transcoding reasonsedc15c8Add broken fps mkv test5913db9Improve readabilitycefcbcbAdd mkv h264 ac3 testsaf92b43Fix safari testb0e6c35Restore progressive transcoding tests118c583Add Dolby Vision testing6a5f22fRevert "Return more precise transcoding reasons"77c6fd5Improve direct profile ranking📊 Changes
13 files changed (+1606 additions, -757 deletions)
View changed files
📝
MediaBrowser.Model/Dlna/StreamBuilder.cs(+6 -4)📝
tests/Jellyfin.Model.Tests/Dlna/StreamBuilderTests.cs(+124 -96)📝
tests/Jellyfin.Model.Tests/Test Data/DeviceProfile-Chrome.json(+151 -238)📝
tests/Jellyfin.Model.Tests/Test Data/DeviceProfile-Firefox.json(+188 -257)📝
tests/Jellyfin.Model.Tests/Test Data/DeviceProfile-SafariNext.json(+160 -162)➕
tests/Jellyfin.Model.Tests/Test Data/DeviceProfile-WebOS-23.json(+355 -0)➕
tests/Jellyfin.Model.Tests/Test Data/MediaSourceInfo-mkv-dvhe.05-eac3-28000k.json(+95 -0)➕
tests/Jellyfin.Model.Tests/Test Data/MediaSourceInfo-mkv-dvhe.08-eac3-15200k.json(+97 -0)➕
tests/Jellyfin.Model.Tests/Test Data/MediaSourceInfo-mkv-h264-ac3-srt-2600k.json(+71 -0)➕
tests/Jellyfin.Model.Tests/Test Data/MediaSourceInfo-mkv-h264-hi10p-aac-5000k-brokenfps.json(+82 -0)➕
tests/Jellyfin.Model.Tests/Test Data/MediaSourceInfo-mp4-dvh1.05-eac3-15200k.json(+94 -0)➕
tests/Jellyfin.Model.Tests/Test Data/MediaSourceInfo-mp4-dvhe.08-eac3-15200k.json(+97 -0)➕
tests/Jellyfin.Model.Tests/Test Data/MediaSourceInfo-mp4-h264-hi10p-aac-5000k.json(+86 -0)📄 Description
The unit tests for
StreamBuilderis a bit outdated and does not reflect the actual results of all clients. This PR updates both device profiles and the test cases to make the unit tests reflects what the actual browsers may expecting. During the test case updating, I also noticed that our current transcode reason is not accurate enough to write a reasonable test case, and I updated how we derive transcode reasons from the direct play profiles, the details are explained below. Additional test cases using Hi10P video that utilizes the newly addedSubContainerfield introduced in #12420 for remux and an mkv file with broken fps detection described in #12603 is also added.For all major browsers (Chrome, Firefox, Safari), I updated their device profile to be the same as what a 10.10 client would look like. For other clients' device profiles, I modified the test cases so that their current profile and the server behavior is respected.
We previously was using the first direct play profile's transcoding reason as the conclusive transcoding reason, but that 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
VideoCodecNotSupportedandAudioCodecNotSupportedto be returned, even if the browser supports those codecs. Only use those reasons when all profiles indicate that the codec is not supported.Changes
Issues
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.