Skip to content

Commit

Permalink
Revert "don't add aac directly to transcode profile when surround sou…
Browse files Browse the repository at this point in the history
…nd is supported"

This reverts commit 9ea0466.
  • Loading branch information
cewert committed Sep 28, 2023
1 parent cb474dc commit 04fb03c
Showing 1 changed file with 51 additions and 52 deletions.
103 changes: 51 additions & 52 deletions source/utils/deviceCapabilities.brs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 04fb03c

Please sign in to comment.