Adds "use fmp4" experimental option (#623)

This commit is contained in:
Sulabh Bista 2022-11-03 13:17:47 -06:00 committed by GitHub
parent 81afe33b7e
commit 06044e8fb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 4 deletions

View File

@ -21,6 +21,7 @@ extension BaseItemDto {
let tempOverkillBitrate = 360_000_000 let tempOverkillBitrate = 360_000_000
builder.setMaxBitrate(bitrate: tempOverkillBitrate) builder.setMaxBitrate(bitrate: tempOverkillBitrate)
let profile = builder.buildProfile() let profile = builder.buildProfile()
let segmentContainer = Defaults[.Experimental.usefmp4Hls] ? "mp4" : "ts"
let getPostedPlaybackInfoRequest = GetPostedPlaybackInfoRequest( let getPostedPlaybackInfoRequest = GetPostedPlaybackInfoRequest(
userId: SessionManager.main.currentLogin.user.id, userId: SessionManager.main.currentLogin.user.id,
@ -95,7 +96,7 @@ extension BaseItemDto {
tag: currentMediaSource.eTag, tag: currentMediaSource.eTag,
deviceProfileId: nil, deviceProfileId: nil,
playSessionId: response.playSessionId, playSessionId: response.playSessionId,
segmentContainer: "ts", segmentContainer: segmentContainer,
segmentLength: nil, segmentLength: nil,
minSegments: 2, minSegments: 2,
deviceId: UIDevice.vendorUUIDString, deviceId: UIDevice.vendorUUIDString,

View File

@ -8,6 +8,7 @@
// lol can someone buy me a coffee this took forever :| // lol can someone buy me a coffee this took forever :|
import Defaults
import Foundation import Foundation
import JellyfinAPI import JellyfinAPI
@ -43,6 +44,7 @@ class DeviceProfileBuilder {
} }
public func buildProfile() -> ClientCapabilitiesDeviceProfile { public func buildProfile() -> ClientCapabilitiesDeviceProfile {
let segmentContainer = Defaults[.Experimental.usefmp4Hls] ? "mp4" : "ts"
let maxStreamingBitrate = bitrate let maxStreamingBitrate = bitrate
let maxStaticBitrate = bitrate let maxStaticBitrate = bitrate
let musicStreamingTranscodingBitrate = bitrate let musicStreamingTranscodingBitrate = bitrate
@ -99,7 +101,7 @@ class DeviceProfileBuilder {
if supportsFeature(minimumSupported: .A8X) { if supportsFeature(minimumSupported: .A8X) {
if supportsFeature(minimumSupported: .A9) { if supportsFeature(minimumSupported: .A9) {
transcodingProfiles = [TranscodingProfile( transcodingProfiles = [TranscodingProfile(
container: "ts", container: segmentContainer,
type: .video, type: .video,
videoCodec: "h264,hevc,mpeg4", videoCodec: "h264,hevc,mpeg4",
audioCodec: "aac,mp3,wav,eac3,ac3,flac,opus", audioCodec: "aac,mp3,wav,eac3,ac3,flac,opus",
@ -111,7 +113,7 @@ class DeviceProfileBuilder {
)] )]
} else { } else {
transcodingProfiles = [TranscodingProfile( transcodingProfiles = [TranscodingProfile(
container: "ts", container: segmentContainer,
type: .video, type: .video,
videoCodec: "h264,mpeg4", videoCodec: "h264,mpeg4",
audioCodec: "aac,mp3,wav,eac3,ac3,opus", audioCodec: "aac,mp3,wav,eac3,ac3,opus",
@ -127,7 +129,7 @@ class DeviceProfileBuilder {
// Device supports FLAC? // Device supports FLAC?
if supportsFeature(minimumSupported: .A10X) { if supportsFeature(minimumSupported: .A10X) {
transcodingProfiles = [TranscodingProfile( transcodingProfiles = [TranscodingProfile(
container: "ts", container: segmentContainer,
type: .video, type: .video,
videoCodec: "hevc,h264,mpeg4", videoCodec: "hevc,h264,mpeg4",
audioCodec: "aac,mp3,wav,ac3,eac3,flac,opus", audioCodec: "aac,mp3,wav,ac3,eac3,flac,opus",

View File

@ -116,6 +116,7 @@ extension Defaults.Keys {
) )
static let forceDirectPlay = Key<Bool>("forceDirectPlay", default: false, suite: .generalSuite) static let forceDirectPlay = Key<Bool>("forceDirectPlay", default: false, suite: .generalSuite)
static let nativePlayer = Key<Bool>("nativePlayer", default: false, suite: .generalSuite) static let nativePlayer = Key<Bool>("nativePlayer", default: false, suite: .generalSuite)
static let usefmp4Hls = Key<Bool>("usefmp4Hls", default: false, suite: .generalSuite)
static let liveTVAlphaEnabled = Key<Bool>("liveTVAlphaEnabled", default: false, suite: .generalSuite) static let liveTVAlphaEnabled = Key<Bool>("liveTVAlphaEnabled", default: false, suite: .generalSuite)
static let liveTVForceDirectPlay = Key<Bool>("liveTVForceDirectPlay", default: false, suite: .generalSuite) static let liveTVForceDirectPlay = Key<Bool>("liveTVForceDirectPlay", default: false, suite: .generalSuite)
static let liveTVNativePlayer = Key<Bool>("liveTVNativePlayer", default: false, suite: .generalSuite) static let liveTVNativePlayer = Key<Bool>("liveTVNativePlayer", default: false, suite: .generalSuite)

View File

@ -17,6 +17,8 @@ struct ExperimentalSettingsView: View {
var syncSubtitleStateWithAdjacent var syncSubtitleStateWithAdjacent
@Default(.Experimental.nativePlayer) @Default(.Experimental.nativePlayer)
var nativePlayer var nativePlayer
@Default(.Experimental.usefmp4Hls)
var usefmp4Hls
@Default(.Experimental.liveTVAlphaEnabled) @Default(.Experimental.liveTVAlphaEnabled)
var liveTVAlphaEnabled var liveTVAlphaEnabled
@ -35,6 +37,8 @@ struct ExperimentalSettingsView: View {
Toggle("Native Player", isOn: $nativePlayer) Toggle("Native Player", isOn: $nativePlayer)
Toggle("Use fmp4 with HLS", isOn: $usefmp4Hls)
} header: { } header: {
L10n.experimental.text L10n.experimental.text
} }

View File

@ -17,6 +17,9 @@ struct ExperimentalSettingsView: View {
var syncSubtitleStateWithAdjacent var syncSubtitleStateWithAdjacent
@Default(.Experimental.nativePlayer) @Default(.Experimental.nativePlayer)
var nativePlayer var nativePlayer
@Default(.Experimental.usefmp4Hls)
var usefmp4Hls
@Default(.Experimental.liveTVAlphaEnabled) @Default(.Experimental.liveTVAlphaEnabled)
var liveTVAlphaEnabled var liveTVAlphaEnabled
@Default(.Experimental.liveTVForceDirectPlay) @Default(.Experimental.liveTVForceDirectPlay)
@ -34,6 +37,8 @@ struct ExperimentalSettingsView: View {
Toggle("Native Player", isOn: $nativePlayer) Toggle("Native Player", isOn: $nativePlayer)
Toggle("Use fmp4 with HLS", isOn: $usefmp4Hls)
} header: { } header: {
L10n.experimental.text L10n.experimental.text
} }