Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't direct play opus audio files + transcode audio to AAC #1468

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 35 additions & 28 deletions source/utils/deviceCapabilities.brs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ function GetDirectPlayProfiles() as object
end for
end for

' remove audio codecs not supported as standalone audio files (opus)
' also add aac back to the list so it gets added to the direct play profile
audioCodecs = ["aac", "mp3", "mp2", "pcm", "lpcm", "wav", "ac3", "ac4", "aiff", "wma", "flac", "alac", "aac", "dts", "wmapro", "vorbis", "eac3", "mpg123"]

' check audio codecs with no container
supportedAudio = []
for each audioCodec in audioCodecs
Expand Down Expand Up @@ -368,40 +372,40 @@ function getTranscodingProfiles() as object
end for
end for

' add mp3 to TranscodingProfile for music
' add aac to TranscodingProfile for stereo audio
' NOTE: multichannel aac is not supported. only decode to stereo on some devices
transcodingProfiles.push({
"Container": "mp3",
"Container": "aac",
"Type": "Audio",
"AudioCodec": "mp3",
"AudioCodec": "aac",
"Context": "Streaming",
"Protocol": "http",
"MaxAudioChannels": maxAudioChannels
"MaxAudioChannels": "2"
})
transcodingProfiles.push({
"Container": "mp3",
"Container": "aac",
"Type": "Audio",
"AudioCodec": "mp3",
"AudioCodec": "aac",
"Context": "Static",
"Protocol": "http",
"MaxAudioChannels": maxAudioChannels
"MaxAudioChannels": "2"
})
' add aac to TranscodingProfile for stereo audio
' NOTE: multichannel aac is not supported. only decode to stereo on some devices
' add mp3 to TranscodingProfile for multichannel music
transcodingProfiles.push({
"Container": "ts",
"Container": "mp3",
"Type": "Audio",
"AudioCodec": "aac",
"AudioCodec": "mp3",
"Context": "Streaming",
"Protocol": "http",
"MaxAudioChannels": "2"
"MaxAudioChannels": maxAudioChannels
})
transcodingProfiles.push({
"Container": "ts",
"Container": "mp3",
"Type": "Audio",
"AudioCodec": "aac",
"AudioCodec": "mp3",
"Context": "Static",
"Protocol": "http",
"MaxAudioChannels": "2"
"MaxAudioChannels": maxAudioChannels
})

tsArray = {
Expand Down Expand Up @@ -506,19 +510,22 @@ function getCodecProfiles() as object
if di.CanDecodeAudio({ Codec: audioCodec, ChCnt: audioChannel }).Result
channelSupportFound = true
for each codecType in ["VideoAudio", "Audio"]
codecProfiles.push({
"Type": codecType,
"Codec": audioCodec,
"Conditions": [
{
"Condition": "LessThanEqual",
"Property": "AudioChannels",
"Value": audioChannel,
"IsRequired": true
}
]
})

if audioCodec = "opus" and codecType = "Audio"
' opus audio files not supported by roku
else
codecProfiles.push({
"Type": codecType,
"Codec": audioCodec,
"Conditions": [
{
"Condition": "LessThanEqual",
"Property": "AudioChannels",
"Value": audioChannel,
"IsRequired": true
}
]
})
end if
end for
end if
if channelSupportFound
Expand Down