2020-05-31 10:57:41 +00:00
|
|
|
'Device Capabilities for Roku.
|
2020-07-11 07:52:52 +00:00
|
|
|
'This will likely need further tweaking
|
2020-05-31 10:57:41 +00:00
|
|
|
|
|
|
|
function getDeviceCapabilities() as object
|
|
|
|
|
|
|
|
return {
|
|
|
|
"PlayableMediaTypes": [
|
|
|
|
"Audio",
|
|
|
|
"Video"
|
|
|
|
],
|
|
|
|
"SupportedCommands": [],
|
|
|
|
"SupportsPersistentIdentifier": false,
|
|
|
|
"SupportsMediaControl": false,
|
|
|
|
"DeviceProfile": getDeviceProfile()
|
|
|
|
}
|
|
|
|
end function
|
|
|
|
|
|
|
|
|
|
|
|
function getDeviceProfile() as object
|
|
|
|
|
|
|
|
'Check if 5.1 Audio Output connected
|
|
|
|
maxAudioChannels = 2
|
|
|
|
di = CreateObject("roDeviceInfo")
|
|
|
|
if di.GetAudioOutputChannel() = "5.1 surround" then
|
|
|
|
maxAudioChannels = 6
|
|
|
|
end if
|
|
|
|
|
|
|
|
return {
|
|
|
|
"MaxStreamingBitrate": 120000000,
|
|
|
|
"MaxStaticBitrate": 100000000,
|
|
|
|
"MusicStreamingTranscodingBitrate": 192000,
|
2020-07-11 07:52:52 +00:00
|
|
|
"DirectPlayProfiles": GetDirectPlayProfiles(),
|
2020-05-31 10:57:41 +00:00
|
|
|
"TranscodingProfiles": [
|
|
|
|
{
|
|
|
|
"Container": "aac",
|
|
|
|
"Type": "Audio",
|
|
|
|
"AudioCodec": "aac",
|
|
|
|
"Context": "Streaming",
|
|
|
|
"Protocol": "http",
|
2020-09-22 14:33:53 +00:00
|
|
|
"MaxAudioChannels": StrI(maxAudioChannels) ' Currently Jellyfin server expects this as a string
|
2020-05-31 10:57:41 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"Container": "mp3",
|
|
|
|
"Type": "Audio",
|
|
|
|
"AudioCodec": "mp3",
|
|
|
|
"Context": "Streaming",
|
|
|
|
"Protocol": "http",
|
2020-09-22 14:33:53 +00:00
|
|
|
"MaxAudioChannels": "2"
|
2020-05-31 10:57:41 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"Container": "mp3",
|
|
|
|
"Type": "Audio",
|
|
|
|
"AudioCodec": "mp3",
|
|
|
|
"Context": "Static",
|
|
|
|
"Protocol": "http",
|
2020-09-22 14:33:53 +00:00
|
|
|
"MaxAudioChannels": "2"
|
2020-05-31 10:57:41 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"Container": "aac",
|
|
|
|
"Type": "Audio",
|
|
|
|
"AudioCodec": "aac",
|
|
|
|
"Context": "Static",
|
|
|
|
"Protocol": "http",
|
2020-09-22 14:33:53 +00:00
|
|
|
"MaxAudioChannels": StrI(maxAudioChannels) ' Currently Jellyfin server expects this as a string
|
2020-05-31 10:57:41 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"Container": "ts",
|
|
|
|
"Type": "Video",
|
|
|
|
"AudioCodec": "aac",
|
|
|
|
"VideoCodec": "h264",
|
|
|
|
"Context": "Streaming",
|
|
|
|
"Protocol": "hls",
|
2020-09-22 14:33:53 +00:00
|
|
|
"MaxAudioChannels": StrI(maxAudioChannels) ' Currently Jellyfin server expects this as a string
|
2020-05-31 10:57:41 +00:00
|
|
|
"MinSegments": "1",
|
|
|
|
"BreakOnNonKeyFrames": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Container": "mp4",
|
|
|
|
"Type": "Video",
|
|
|
|
"AudioCodec": "aac,opus,flac,vorbis",
|
|
|
|
"VideoCodec": "h264",
|
|
|
|
"Context": "Static",
|
|
|
|
"Protocol": "http"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"ContainerProfiles": [],
|
|
|
|
"CodecProfiles": [
|
|
|
|
{
|
|
|
|
"Type": "VideoAudio",
|
|
|
|
"Codec": "aac",
|
|
|
|
"Conditions": [
|
|
|
|
{
|
|
|
|
"Condition": "Equals",
|
|
|
|
"Property": "IsSecondaryAudio",
|
|
|
|
"Value": "false",
|
|
|
|
"IsRequired": false
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Type": "Video",
|
|
|
|
"Codec": "h264",
|
|
|
|
"Conditions": [
|
|
|
|
{
|
|
|
|
"Condition": "EqualsAny",
|
|
|
|
"Property": "VideoProfile",
|
|
|
|
"Value": "high|main|baseline|constrained baseline",
|
|
|
|
"IsRequired": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Condition": "LessThanEqual",
|
|
|
|
"Property": "VideoLevel",
|
|
|
|
"Value": "51",
|
|
|
|
"IsRequired": false
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"SubtitleProfiles": [
|
|
|
|
{
|
|
|
|
"Format": "vtt",
|
|
|
|
"Method": "External"
|
|
|
|
},
|
|
|
|
{
|
2020-07-11 07:52:52 +00:00
|
|
|
"Format": "srt",
|
2020-05-31 10:57:41 +00:00
|
|
|
"Method": "External"
|
|
|
|
},
|
|
|
|
{
|
2020-07-11 07:52:52 +00:00
|
|
|
"Format": "ttml",
|
2020-05-31 10:57:41 +00:00
|
|
|
"Method": "External"
|
|
|
|
}
|
2020-07-11 07:52:52 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
end function
|
|
|
|
|
|
|
|
|
|
|
|
function GetDirectPlayProfiles() as object
|
|
|
|
|
|
|
|
mp4Video = "h264"
|
|
|
|
mp4Audio = "mp3,pcm,lpcm,wav"
|
|
|
|
mkvVideo = "h264,vp8"
|
|
|
|
mkvAudio = "mp3,pcm,lpcm,wav"
|
|
|
|
audio = "mp3,pcm,lpcm,wav"
|
|
|
|
|
|
|
|
di = CreateObject("roDeviceInfo")
|
|
|
|
|
|
|
|
'Check for Supported Video Codecs
|
|
|
|
if di.CanDecodeVideo({Codec: "hevc"}).Result = true
|
|
|
|
mp4Video = mp4Video + ",h265"
|
|
|
|
mkvVideo =mkvVideo + ",h265"
|
|
|
|
end if
|
|
|
|
|
|
|
|
if di.CanDecodeVideo({Codec: "vp9"}).Result = true
|
|
|
|
mkvVideo =mkvVideo + ",vp9"
|
|
|
|
end if
|
|
|
|
|
|
|
|
' Check for supported Audio
|
2020-07-22 19:30:13 +00:00
|
|
|
if di.CanDecodeAudio({ Codec: "ac3"}).result then
|
2020-07-11 07:52:52 +00:00
|
|
|
mkvAudio = mkvAudio + ",ac3"
|
|
|
|
mp4Audio = mp4Audio + ",ac3"
|
|
|
|
audio = audio + ",ac3"
|
|
|
|
end if
|
|
|
|
|
2020-07-22 19:30:13 +00:00
|
|
|
if di.CanDecodeAudio({ Codec: "wma"}).result then
|
2020-07-11 07:52:52 +00:00
|
|
|
audio = audio + ",wma"
|
|
|
|
end if
|
|
|
|
|
2020-07-22 19:30:13 +00:00
|
|
|
if di.CanDecodeAudio({ Codec: "flac"}).result then
|
2020-07-11 07:52:52 +00:00
|
|
|
mkvAudio = mkvAudio + ",flac"
|
|
|
|
audio = audio + ",flac"
|
|
|
|
end if
|
|
|
|
|
2020-07-22 19:30:13 +00:00
|
|
|
if di.CanDecodeAudio({ Codec: "alac"}).result then
|
2020-07-11 07:52:52 +00:00
|
|
|
mkvAudio = mkvAudio + ",alac"
|
|
|
|
mp4Audio = mp4Audio + ",alac"
|
|
|
|
audio = audio + ",alac"
|
|
|
|
end if
|
|
|
|
|
2020-07-22 19:30:13 +00:00
|
|
|
if di.CanDecodeAudio({ Codec: "aac"}).result then
|
2020-07-11 07:52:52 +00:00
|
|
|
mkvAudio = mkvAudio + ",aac"
|
|
|
|
mp4Audio = mp4Audio + ",aac"
|
|
|
|
audio = audio + ",aac"
|
|
|
|
end if
|
|
|
|
|
2020-07-22 19:30:13 +00:00
|
|
|
if di.CanDecodeAudio({ Codec: "opus"}).result then
|
2020-07-11 07:52:52 +00:00
|
|
|
mkvAudio = mkvAudio + ",opus"
|
|
|
|
end if
|
|
|
|
|
2020-07-22 19:30:13 +00:00
|
|
|
if di.CanDecodeAudio({ Codec: "dts"}).result then
|
|
|
|
mkvAudio = mkvAudio + ",dts"
|
|
|
|
audio = audio + ",dts"
|
2020-07-11 07:52:52 +00:00
|
|
|
end if
|
|
|
|
|
2020-07-22 19:30:13 +00:00
|
|
|
if di.CanDecodeAudio({ Codec: "wmapro"}).result then
|
2020-07-11 07:52:52 +00:00
|
|
|
audio = audio + ",wmapro"
|
|
|
|
end if
|
|
|
|
|
2020-07-22 19:30:13 +00:00
|
|
|
if di.CanDecodeAudio({ Codec: "vorbis"}).result then
|
2020-07-11 07:52:52 +00:00
|
|
|
mkvAudio = mkvAudio + ",vorbis"
|
|
|
|
end if
|
|
|
|
|
2020-07-22 19:30:13 +00:00
|
|
|
if di.CanDecodeAudio({ Codec: "eac3"}).result then
|
2020-07-11 07:52:52 +00:00
|
|
|
mkvAudio = mkvAudio + ",eac3"
|
|
|
|
end if
|
|
|
|
|
|
|
|
return [
|
2020-05-31 10:57:41 +00:00
|
|
|
{
|
2020-07-11 07:52:52 +00:00
|
|
|
"Container": "mp4,m4v,mov",
|
2020-05-31 10:57:41 +00:00
|
|
|
"Type": "Video",
|
2020-07-11 07:52:52 +00:00
|
|
|
"VideoCodec": mp4Video,
|
|
|
|
"AudioCodec": mp4Audio
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Container": "mkv,webm",
|
|
|
|
"Type": "Video",
|
|
|
|
"VideoCodec": mkvVideo,
|
|
|
|
"AudioCodec": mkvAudio
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Container": audio,
|
|
|
|
"Type": "Audio",
|
2020-05-31 10:57:41 +00:00
|
|
|
}
|
2020-07-11 07:52:52 +00:00
|
|
|
]
|
|
|
|
|
2020-05-31 10:57:41 +00:00
|
|
|
end function
|