Fix transcoding of quad audio channels

pull/5190/head
Chocobozzz 2022-08-10 16:05:38 +02:00
parent 0cfc8c4fe4
commit 4fd6dcfb44
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 6 additions and 3 deletions

View File

@ -163,7 +163,7 @@ async function canDoQuickAudioTranscode (path: string, probe?: FfprobeData): Pro
const channelLayout = parsedAudio.audioStream['channel_layout'] const channelLayout = parsedAudio.audioStream['channel_layout']
// Causes playback issues with Chrome // Causes playback issues with Chrome
if (!channelLayout || channelLayout === 'unknown') return false if (!channelLayout || channelLayout === 'unknown' || channelLayout === 'quad') return false
return true return true
} }

View File

@ -76,11 +76,14 @@ const defaultAACOptionsBuilder: EncoderOptionsBuilder = async ({ input, streamNu
logger.debug('Calculating audio bitrate of %s by AAC encoder.', input, { bitrate: parsedAudio.bitrate, audioCodecName }) logger.debug('Calculating audio bitrate of %s by AAC encoder.', input, { bitrate: parsedAudio.bitrate, audioCodecName })
// Force stereo as it causes some issues with HLS playback in Chrome
const base = [ '-channel_layout', 'stereo' ]
if (bitrate !== -1) { if (bitrate !== -1) {
return { outputOptions: [ buildStreamSuffix('-b:a', streamNum), bitrate + 'k' ] } return { outputOptions: base.concat([ buildStreamSuffix('-b:a', streamNum), bitrate + 'k' ]) }
} }
return { outputOptions: [ ] } return { outputOptions: base }
} }
const defaultLibFDKAACVODOptionsBuilder: EncoderOptionsBuilder = ({ streamNum }) => { const defaultLibFDKAACVODOptionsBuilder: EncoderOptionsBuilder = ({ streamNum }) => {