diff --git a/utils/profiles/base.js b/utils/profiles/base.js index e58039eb..1ff7dc46 100644 --- a/utils/profiles/base.js +++ b/utils/profiles/base.js @@ -1,86 +1,86 @@ -import MediaTypes from '../../constants/MediaTypes'; +import MediaTypes from "../../constants/MediaTypes"; export default { - Name: 'Expo Base Video Profile', - MaxStaticBitrate: 100000000, - MaxStreamingBitrate: 120000000, - MusicStreamingTranscodingBitrate: 384000, - CodecProfiles: [ - { - Codec: 'h264', - Conditions: [ - { - Condition: 'NotEquals', - IsRequired: false, - Property: 'IsAnamorphic', - Value: 'true' - }, - { - Condition: 'EqualsAny', - IsRequired: false, - Property: 'VideoProfile', - Value: 'high|main|baseline|constrained baseline' - }, - { - Condition: 'LessThanEqual', - IsRequired: false, - Property: 'VideoLevel', - Value: '51' - }, - { - Condition: 'NotEquals', - IsRequired: false, - Property: 'IsInterlaced', - Value: 'true' - } - ], - Type: MediaTypes.Video - }, - { - Codec: 'hevc', - Conditions: [ - { - Condition: 'NotEquals', - IsRequired: false, - Property: 'IsAnamorphic', - Value: 'true' - }, - { - Condition: 'EqualsAny', - IsRequired: false, - Property: 'VideoProfile', - Value: 'main|main 10' - }, - { - Condition: 'LessThanEqual', - IsRequired: false, - Property: 'VideoLevel', - Value: '183' - }, - { - Condition: 'NotEquals', - IsRequired: false, - Property: 'IsInterlaced', - Value: 'true' - } - ], - Type: MediaTypes.Video - } - ], - ContainerProfiles: [], - DirectPlayProfiles: [], - ResponseProfiles: [ - { - Container: 'm4v', - MimeType: 'video/mp4', - Type: MediaTypes.Video - } - ], - SubtitleProfiles: [ - { - Format: 'vtt', - Method: 'Hls' - } - ], - TranscodingProfiles: [] + Name: "Expo Base Video Profile", + MaxStaticBitrate: 100000000, + MaxStreamingBitrate: 120000000, + MusicStreamingTranscodingBitrate: 384000, + CodecProfiles: [ + { + Codec: "h264", + Conditions: [ + { + Condition: "NotEquals", + IsRequired: false, + Property: "IsAnamorphic", + Value: "true", + }, + { + Condition: "EqualsAny", + IsRequired: false, + Property: "VideoProfile", + Value: "high|main|baseline|constrained baseline", + }, + { + Condition: "LessThanEqual", + IsRequired: false, + Property: "VideoLevel", + Value: "51", + }, + { + Condition: "NotEquals", + IsRequired: false, + Property: "IsInterlaced", + Value: "true", + }, + ], + Type: MediaTypes.Video, + }, + { + Codec: "hevc", + Conditions: [ + { + Condition: "NotEquals", + IsRequired: false, + Property: "IsAnamorphic", + Value: "true", + }, + { + Condition: "EqualsAny", + IsRequired: false, + Property: "VideoProfile", + Value: "main|main 10", + }, + { + Condition: "LessThanEqual", + IsRequired: false, + Property: "VideoLevel", + Value: "183", + }, + { + Condition: "NotEquals", + IsRequired: false, + Property: "IsInterlaced", + Value: "true", + }, + ], + Type: MediaTypes.Video, + }, + ], + ContainerProfiles: [], + DirectPlayProfiles: [], + ResponseProfiles: [ + { + Container: "m4v", + MimeType: "video/mp4", + Type: MediaTypes.Video, + }, + ], + SubtitleProfiles: [ + { + Format: "vtt", + Method: "Hls", + }, + ], + TranscodingProfiles: [], }; diff --git a/utils/profiles/chromecast.ts b/utils/profiles/chromecast.ts index d13a75d8..73b0b9fc 100644 --- a/utils/profiles/chromecast.ts +++ b/utils/profiles/chromecast.ts @@ -11,7 +11,7 @@ const MediaTypes = { }; export const chromecastProfile: DeviceProfile = { - Name: "Chromecast", + Name: "Chromecast Video Profile", Id: "chromecast-001", MaxStreamingBitrate: 4000000, // 4 Mbps MaxStaticBitrate: 4000000, // 4 Mbps diff --git a/utils/profiles/ios.js b/utils/profiles/ios.js index 5a143609..7708a94c 100644 --- a/utils/profiles/ios.js +++ b/utils/profiles/ios.js @@ -3,147 +3,147 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -import MediaTypes from '../../constants/MediaTypes'; +import MediaTypes from "../../constants/MediaTypes"; -import BaseProfile from './base'; +import BaseProfile from "./base"; /** * Device profile for Expo Video player on iOS 13+ */ export default { - ...BaseProfile, - Name: 'Expo iOS Video Profile', - DirectPlayProfiles: [ - { - AudioCodec: 'aac,mp3,ac3,eac3,flac,alac', - Container: 'mp4,m4v', - Type: MediaTypes.Video, - VideoCodec: 'hevc,h264' - }, - { - AudioCodec: 'aac,mp3,ac3,eac3,flac,alac', - Container: 'mov', - Type: MediaTypes.Video, - VideoCodec: 'hevc,h264' - }, - { - Container: 'mp3', - Type: MediaTypes.Audio - }, - { - Container: 'aac', - Type: MediaTypes.Audio - }, - { - AudioCodec: 'aac', - Container: 'm4a', - Type: MediaTypes.Audio - }, - { - AudioCodec: 'aac', - Container: 'm4b', - Type: MediaTypes.Audio - }, - { - Container: 'flac', - Type: MediaTypes.Audio - }, - { - Container: 'alac', - Type: MediaTypes.Audio - }, - { - AudioCodec: 'alac', - Container: 'm4a', - Type: MediaTypes.Audio - }, - { - AudioCodec: 'alac', - Container: 'm4b', - Type: MediaTypes.Audio - }, - { - Container: 'wav', - Type: MediaTypes.Audio - } - ], - TranscodingProfiles: [ - { - AudioCodec: 'aac', - BreakOnNonKeyFrames: true, - Container: 'aac', - Context: 'Streaming', - MaxAudioChannels: '6', - MinSegments: '2', - Protocol: 'hls', - Type: MediaTypes.Audio - }, - { - AudioCodec: 'aac', - Container: 'aac', - Context: 'Streaming', - MaxAudioChannels: '6', - Protocol: 'http', - Type: MediaTypes.Audio - }, - { - AudioCodec: 'mp3', - Container: 'mp3', - Context: 'Streaming', - MaxAudioChannels: '6', - Protocol: 'http', - Type: MediaTypes.Audio - }, - { - AudioCodec: 'wav', - Container: 'wav', - Context: 'Streaming', - MaxAudioChannels: '6', - Protocol: 'http', - Type: MediaTypes.Audio - }, - { - AudioCodec: 'mp3', - Container: 'mp3', - Context: 'Static', - MaxAudioChannels: '6', - Protocol: 'http', - Type: MediaTypes.Audio - }, - { - AudioCodec: 'aac', - Container: 'aac', - Context: 'Static', - MaxAudioChannels: '6', - Protocol: 'http', - Type: MediaTypes.Audio - }, - { - AudioCodec: 'wav', - Container: 'wav', - Context: 'Static', - MaxAudioChannels: '6', - Protocol: 'http', - Type: MediaTypes.Audio - }, - { - AudioCodec: 'aac,mp3', - BreakOnNonKeyFrames: true, - Container: 'ts', - Context: 'Streaming', - MaxAudioChannels: '6', - MinSegments: '2', - Protocol: 'hls', - Type: MediaTypes.Video, - VideoCodec: 'h264' - }, - { - AudioCodec: 'aac,mp3,ac3,eac3,flac,alac', - Container: 'mp4', - Context: 'Static', - Protocol: 'http', - Type: MediaTypes.Video, - VideoCodec: 'h264' - } - ] + ...BaseProfile, + Name: "Expo iOS Video Profile", + DirectPlayProfiles: [ + { + AudioCodec: "aac,mp3,ac3,eac3,flac,alac", + Container: "mp4,m4v", + Type: MediaTypes.Video, + VideoCodec: "hevc,h264", + }, + { + AudioCodec: "aac,mp3,ac3,eac3,flac,alac", + Container: "mov", + Type: MediaTypes.Video, + VideoCodec: "hevc,h264", + }, + { + Container: "mp3", + Type: MediaTypes.Audio, + }, + { + Container: "aac", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "aac", + Container: "m4a", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "aac", + Container: "m4b", + Type: MediaTypes.Audio, + }, + { + Container: "flac", + Type: MediaTypes.Audio, + }, + { + Container: "alac", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "alac", + Container: "m4a", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "alac", + Container: "m4b", + Type: MediaTypes.Audio, + }, + { + Container: "wav", + Type: MediaTypes.Audio, + }, + ], + TranscodingProfiles: [ + { + AudioCodec: "aac", + BreakOnNonKeyFrames: true, + Container: "aac", + Context: "Streaming", + MaxAudioChannels: "6", + MinSegments: "2", + Protocol: "hls", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "aac", + Container: "aac", + Context: "Streaming", + MaxAudioChannels: "6", + Protocol: "http", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "mp3", + Container: "mp3", + Context: "Streaming", + MaxAudioChannels: "6", + Protocol: "http", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "wav", + Container: "wav", + Context: "Streaming", + MaxAudioChannels: "6", + Protocol: "http", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "mp3", + Container: "mp3", + Context: "Static", + MaxAudioChannels: "6", + Protocol: "http", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "aac", + Container: "aac", + Context: "Static", + MaxAudioChannels: "6", + Protocol: "http", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "wav", + Container: "wav", + Context: "Static", + MaxAudioChannels: "6", + Protocol: "http", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "aac,mp3", + BreakOnNonKeyFrames: true, + Container: "ts", + Context: "Streaming", + MaxAudioChannels: "6", + MinSegments: "2", + Protocol: "hls", + Type: MediaTypes.Video, + VideoCodec: "h264", + }, + { + AudioCodec: "aac,mp3,ac3,eac3,flac,alac", + Container: "mp4", + Context: "Static", + Protocol: "http", + Type: MediaTypes.Video, + VideoCodec: "h264", + }, + ], }; diff --git a/utils/profiles/native.js b/utils/profiles/native.js new file mode 100644 index 00000000..9e5f0152 --- /dev/null +++ b/utils/profiles/native.js @@ -0,0 +1,284 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +import MediaTypes from "../../constants/MediaTypes"; + +/** + * Device profile for Native video player + */ +export default { + Name: "1. Native iOS Video Profile", + MaxStaticBitrate: 100000000, + MaxStreamingBitrate: 120000000, + MusicStreamingTranscodingBitrate: 384000, + CodecProfiles: [ + { + Codec: "h264", + Conditions: [ + { + Condition: "NotEquals", + IsRequired: false, + Property: "IsAnamorphic", + Value: "true", + }, + { + Condition: "EqualsAny", + IsRequired: false, + Property: "VideoProfile", + Value: "high|main|baseline|constrained baseline", + }, + { + Condition: "LessThanEqual", + IsRequired: false, + Property: "VideoLevel", + Value: "80", + }, + { + Condition: "NotEquals", + IsRequired: false, + Property: "IsInterlaced", + Value: "true", + }, + ], + Type: MediaTypes.Video, + }, + { + Codec: "hevc", + Conditions: [ + { + Condition: "NotEquals", + IsRequired: false, + Property: "IsAnamorphic", + Value: "true", + }, + { + Condition: "EqualsAny", + IsRequired: false, + Property: "VideoProfile", + Value: "high|main|main 10", + }, + { + Condition: "LessThanEqual", + IsRequired: false, + Property: "VideoLevel", + Value: "175", + }, + { + Condition: "NotEquals", + IsRequired: false, + Property: "IsInterlaced", + Value: "true", + }, + ], + Type: MediaTypes.Video, + }, + ], + DirectPlayProfiles: [ + { + AudioCodec: "flac,alac,aac,eac3,ac3,opus", + Container: "mp4", + Type: MediaTypes.Video, + VideoCodec: "hevc,h264,mpeg4", + }, + { + AudioCodec: "alac,aac,ac3", + Container: "m4v", + Type: MediaTypes.Video, + VideoCodec: "h264,mpeg4", + }, + { + AudioCodec: + "alac,aac,eac3,ac3,mp3,pcm_s24be,pcm_s24le,pcm_s16be,pcm_s16le", + Container: "mov", + Type: MediaTypes.Video, + VideoCodec: "hevc,h264,mpeg4,mjpeg", + }, + { + AttrudioCodec: "aac,eac3,ac3,mp3", + Container: "mpegts", + Type: MediaTypes.Video, + VideoCodec: "h264", + }, + { + AttrudioCodec: "aac,amr_nb", + Container: "3gp,3g2", + Type: MediaTypes.Video, + VideoCodec: "h264,mpeg4", + }, + { + AttrudioCodec: "pcm_s16le,pcm_mulaw", + Container: "avi", + Type: MediaTypes.Video, + VideoCodec: "mjpeg", + }, + { + Container: "mp3", + Type: MediaTypes.Audio, + }, + { + Container: "aac", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "aac", + Container: "m4a", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "aac", + Container: "m4b", + Type: MediaTypes.Audio, + }, + { + Container: "flac", + Type: MediaTypes.Audio, + }, + { + Container: "alac", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "alac", + Container: "m4a", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "alac", + Container: "m4b", + Type: MediaTypes.Audio, + }, + { + Container: "wav", + Type: MediaTypes.Audio, + }, + ], + TranscodingProfiles: [ + { + AudioCodec: "flac,alac,aac,eac3,ac3,opus", + BreakOnNonKeyFrames: true, + Container: "mp4", + Context: "streaming", + MaxAudioChannels: "8", + MinSegments: 2, + Protocol: "hls", + Type: "video", + VideoCodec: "hevc,h264,mpeg4", + }, + { + AudioCodec: "aac", + BreakOnNonKeyFrames: true, + Container: "aac", + Context: "Streaming", + MaxAudioChannels: "6", + MinSegments: "2", + Protocol: "hls", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "aac", + Container: "aac", + Context: "Streaming", + MaxAudioChannels: "6", + Protocol: "http", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "mp3", + Container: "mp3", + Context: "Streaming", + MaxAudioChannels: "6", + Protocol: "http", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "wav", + Container: "wav", + Context: "Streaming", + MaxAudioChannels: "6", + Protocol: "http", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "mp3", + Container: "mp3", + Context: "Static", + MaxAudioChannels: "6", + Protocol: "http", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "aac", + Container: "aac", + Context: "Static", + MaxAudioChannels: "6", + Protocol: "http", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "wav", + Container: "wav", + Context: "Static", + MaxAudioChannels: "6", + Protocol: "http", + Type: MediaTypes.Audio, + }, + { + AudioCodec: "aac,mp3", + BreakOnNonKeyFrames: true, + Container: "ts", + Context: "Streaming", + MaxAudioChannels: "6", + MinSegments: "2", + Protocol: "hls", + Type: MediaTypes.Video, + VideoCodec: "h264", + }, + { + AudioCodec: "aac,mp3,ac3,eac3,flac,alac", + Container: "mp4", + Context: "Static", + Protocol: "http", + Type: MediaTypes.Video, + VideoCodec: "h264", + }, + ], + ResponseProfiles: [ + { + Container: "m4v", + MimeType: "video/mp4", + Type: MediaTypes.Video, + }, + ], + SubtitleProfiles: [ + { + Format: "pgssub", + Method: "encode", + }, + { + Format: "dvdsub", + Method: "encode", + }, + { + Format: "dvbsub", + Method: "encode", + }, + { + Format: "xsub", + Method: "encode", + }, + { + Format: "vtt", + Method: "hls", + }, + { + Format: "ttml", + Method: "embed", + }, + { + Format: "cc_dec", + Method: "embed", + }, + ], +}; diff --git a/utils/profiles/old.js b/utils/profiles/old.js new file mode 100644 index 00000000..f356320b --- /dev/null +++ b/utils/profiles/old.js @@ -0,0 +1,259 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +import MediaTypes from "../../constants/MediaTypes"; + +/** + * Device profile for old phones (aka does not support HEVC) + * + * This file is a modified version of the original file. + * + * Link to original: https://github.com/jellyfin/jellyfin-expo/blob/e7b7e736a8602c94612917ef02de22f87c7c28f2/utils/profiles/ios.js#L4 + */ +export default { + MaxStreamingBitrate: 3000000, + MaxStaticBitrate: 3000000, + MusicStreamingTranscodingBitrate: 256000, + DirectPlayProfiles: [ + { + Container: "mp4,m4v", + Type: "Video", + VideoCodec: "h264", + AudioCodec: "aac,mp3,mp2", + }, + { + Container: "mkv", + Type: "Video", + VideoCodec: "h264", + AudioCodec: "aac,mp3,mp2", + }, + { + Container: "mov", + Type: "Video", + VideoCodec: "h264", + AudioCodec: "aac,mp3,mp2", + }, + { + Container: "mp3", + Type: "Audio", + }, + { + Container: "aac", + Type: "Audio", + }, + { + Container: "m4a", + AudioCodec: "aac", + Type: "Audio", + }, + { + Container: "m4b", + AudioCodec: "aac", + Type: "Audio", + }, + { + Container: "hls", + Type: "Video", + VideoCodec: "h264", + AudioCodec: "aac,mp3,mp2", + }, + ], + TranscodingProfiles: [ + { + Container: "mp4", + Type: "Audio", + AudioCodec: "aac", + Context: "Streaming", + Protocol: "hls", + MaxAudioChannels: "2", + MinSegments: "1", + BreakOnNonKeyFrames: true, + }, + { + Container: "aac", + Type: "Audio", + AudioCodec: "aac", + Context: "Streaming", + Protocol: "http", + MaxAudioChannels: "2", + }, + { + Container: "mp3", + Type: "Audio", + AudioCodec: "mp3", + Context: "Streaming", + Protocol: "http", + MaxAudioChannels: "2", + }, + { + Container: "mp3", + Type: "Audio", + AudioCodec: "mp3", + Context: "Static", + Protocol: "http", + MaxAudioChannels: "2", + }, + { + Container: "aac", + Type: "Audio", + AudioCodec: "aac", + Context: "Static", + Protocol: "http", + MaxAudioChannels: "2", + }, + { + Container: "mp4", + Type: "Video", + AudioCodec: "aac,mp2", + VideoCodec: "h264", + Context: "Streaming", + Protocol: "hls", + MaxAudioChannels: "2", + MinSegments: "1", + BreakOnNonKeyFrames: true, + Conditions: [ + { + Condition: "LessThanEqual", + Property: "Width", + Value: "960", + IsRequired: false, + }, + { + Condition: "LessThanEqual", + Property: "Height", + Value: "960", + IsRequired: false, + }, + { + Condition: "LessThanEqual", + Property: "VideoFramerate", + Value: "60", + IsRequired: false, + }, + ], + }, + { + Container: "ts", + Type: "Video", + AudioCodec: "aac,mp3,mp2", + VideoCodec: "h264", + Context: "Streaming", + Protocol: "hls", + MaxAudioChannels: "2", + MinSegments: "1", + BreakOnNonKeyFrames: true, + Conditions: [ + { + Condition: "LessThanEqual", + Property: "Width", + Value: "960", + IsRequired: false, + }, + { + Condition: "LessThanEqual", + Property: "Height", + Value: "960", + IsRequired: false, + }, + { + Condition: "LessThanEqual", + Property: "VideoFramerate", + Value: "60", + IsRequired: false, + }, + ], + }, + ], + ContainerProfiles: [], + CodecProfiles: [ + { + Type: "VideoAudio", + Codec: "aac", + Conditions: [ + { + Condition: "Equals", + Property: "IsSecondaryAudio", + Value: "false", + IsRequired: false, + }, + ], + }, + { + Type: "VideoAudio", + Conditions: [ + { + Condition: "Equals", + Property: "IsSecondaryAudio", + Value: "false", + IsRequired: false, + }, + ], + }, + { + Type: "Video", + Codec: "h264", + Conditions: [ + { + Condition: "NotEquals", + Property: "IsAnamorphic", + Value: "true", + IsRequired: false, + }, + { + Condition: "EqualsAny", + Property: "VideoProfile", + Value: "high|main|baseline|constrained baseline", + IsRequired: false, + }, + { + Condition: "EqualsAny", + Property: "VideoRangeType", + Value: "SDR", + IsRequired: false, + }, + { + Condition: "LessThanEqual", + Property: "VideoLevel", + Value: "52", + IsRequired: false, + }, + { + Condition: "NotEquals", + Property: "IsInterlaced", + Value: "true", + IsRequired: false, + }, + ], + }, + { + Type: "Video", + Conditions: [ + { + Condition: "LessThanEqual", + Property: "Width", + Value: "960", + IsRequired: false, + }, + { + Condition: "LessThanEqual", + Property: "Height", + Value: "960", + IsRequired: false, + }, + { + Condition: "LessThanEqual", + Property: "VideoFramerate", + Value: "65", + IsRequired: false, + }, + ], + }, + ], + SubtitleProfiles: [ + { + Method: "Encode", + }, + ], +};