From 4fd6dcfb4432b71549fb2d4c3cc3b92f34c29665 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 10 Aug 2022 16:05:38 +0200 Subject: Fix transcoding of quad audio channels --- server/helpers/ffmpeg/ffprobe-utils.ts | 2 +- server/lib/transcoding/default-transcoding-profiles.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'server') diff --git a/server/helpers/ffmpeg/ffprobe-utils.ts b/server/helpers/ffmpeg/ffprobe-utils.ts index c45f9ec99..9746c2046 100644 --- a/server/helpers/ffmpeg/ffprobe-utils.ts +++ b/server/helpers/ffmpeg/ffprobe-utils.ts @@ -163,7 +163,7 @@ async function canDoQuickAudioTranscode (path: string, probe?: FfprobeData): Pro const channelLayout = parsedAudio.audioStream['channel_layout'] // Causes playback issues with Chrome - if (!channelLayout || channelLayout === 'unknown') return false + if (!channelLayout || channelLayout === 'unknown' || channelLayout === 'quad') return false return true } diff --git a/server/lib/transcoding/default-transcoding-profiles.ts b/server/lib/transcoding/default-transcoding-profiles.ts index 8f01f57a5..f47718819 100644 --- a/server/lib/transcoding/default-transcoding-profiles.ts +++ b/server/lib/transcoding/default-transcoding-profiles.ts @@ -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 }) + // Force stereo as it causes some issues with HLS playback in Chrome + const base = [ '-channel_layout', 'stereo' ] + 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 }) => { -- cgit v1.2.3