diff --git a/source/utils/deviceCapabilities.brs b/source/utils/deviceCapabilities.brs index 0911ad9a0..17a4aae23 100644 --- a/source/utils/deviceCapabilities.brs +++ b/source/utils/deviceCapabilities.brs @@ -396,10 +396,57 @@ function getDeviceProfile() as object "Protocol": "http", "MaxAudioChannels": maxAudioChannels }) + ' add aac to TranscodingProfile for stereo audio + ' NOTE: multichannel aac is not supported. only decode to stereo on some devices + deviceProfile.TranscodingProfiles.push({ + "Container": "ts", + "Type": "Audio", + "AudioCodec": "aac", + "Context": "Streaming", + "Protocol": "http", + "MaxAudioChannels": "2" + }) + deviceProfile.TranscodingProfiles.push({ + "Container": "ts", + "Type": "Audio", + "AudioCodec": "aac", + "Context": "Static", + "Protocol": "http", + "MaxAudioChannels": "2" + }) + + tsArray = { + "Container": "ts", + "Context": "Streaming", + "Protocol": "hls", + "Type": "Video", + "AudioCodec": tsAudioCodecs, + "VideoCodec": tsVideoCodecs, + "MaxAudioChannels": maxAudioChannels, + "MinSegments": 1, + "BreakOnNonKeyFrames": false + } + mp4Array = { + "Container": "mp4", + "Context": "Streaming", + "Protocol": "hls", + "Type": "Video", + "AudioCodec": mp4AudioCodecs, + "VideoCodec": mp4VideoCodecs, + "MaxAudioChannels": maxAudioChannels, + "MinSegments": 1, + "BreakOnNonKeyFrames": false + } + + ' apply max res to transcoding profile + if maxResSetting <> "off" + tsArray.Conditions = [maxVideoHeightArray, maxVideoWidthArray] + mp4Array.Conditions = [maxVideoHeightArray, maxVideoWidthArray] + end if - ' set preferred audio codec for transcoding - if isValid(surroundSoundCodec) - ' use preferred surround sound codec + ' surround sound + if surroundSoundCodec <> invalid + ' add preferred surround sound codec to TranscodingProfile deviceProfile.TranscodingProfiles.push({ "Container": surroundSoundCodec, "Type": "Audio", @@ -417,7 +464,7 @@ function getDeviceProfile() as object "MaxAudioChannels": maxAudioChannels }) - ' put preferred surround sound codec in the front of AudioCodec strings + ' put codec in front of AudioCodec string if tsArray.AudioCodec = "" tsArray.AudioCodec = surroundSoundCodec else @@ -429,54 +476,6 @@ function getDeviceProfile() as object else mp4Array.AudioCodec = surroundSoundCodec + "," + mp4Array.AudioCodec end if - else - ' add aac for stereo audio. - ' stereo aac is supported on all devices - deviceProfile.TranscodingProfiles.push({ - "Container": "ts", - "Type": "Audio", - "AudioCodec": "aac", - "Context": "Streaming", - "Protocol": "http", - "MaxAudioChannels": "2" - }) - deviceProfile.TranscodingProfiles.push({ - "Container": "ts", - "Type": "Audio", - "AudioCodec": "aac", - "Context": "Static", - "Protocol": "http", - "MaxAudioChannels": "2" - }) - end if - - tsArray = { - "Container": "ts", - "Context": "Streaming", - "Protocol": "hls", - "Type": "Video", - "AudioCodec": tsAudioCodecs, - "VideoCodec": tsVideoCodecs, - "MaxAudioChannels": maxAudioChannels, - "MinSegments": 1, - "BreakOnNonKeyFrames": false - } - mp4Array = { - "Container": "mp4", - "Context": "Streaming", - "Protocol": "hls", - "Type": "Video", - "AudioCodec": mp4AudioCodecs, - "VideoCodec": mp4VideoCodecs, - "MaxAudioChannels": maxAudioChannels, - "MinSegments": 1, - "BreakOnNonKeyFrames": false - } - - ' apply max res to transcoding profile - if maxResSetting <> "off" - tsArray.Conditions = [maxVideoHeightArray, maxVideoWidthArray] - mp4Array.Conditions = [maxVideoHeightArray, maxVideoWidthArray] end if deviceProfile.TranscodingProfiles.push(tsArray)