aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-10 16:05:38 +0200
committerChocobozzz <me@florianbigard.com>2022-08-10 16:05:38 +0200
commit4fd6dcfb4432b71549fb2d4c3cc3b92f34c29665 (patch)
tree4544b2cc4a80ca058669e460b560a3b9924ad8ad
parent0cfc8c4fe4f44ef98b7be3683dae76da8236e641 (diff)
downloadPeerTube-4fd6dcfb4432b71549fb2d4c3cc3b92f34c29665.tar.gz
PeerTube-4fd6dcfb4432b71549fb2d4c3cc3b92f34c29665.tar.zst
PeerTube-4fd6dcfb4432b71549fb2d4c3cc3b92f34c29665.zip
Fix transcoding of quad audio channels
-rw-r--r--server/helpers/ffmpeg/ffprobe-utils.ts2
-rw-r--r--server/lib/transcoding/default-transcoding-profiles.ts7
2 files changed, 6 insertions, 3 deletions
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
163 163
164 const channelLayout = parsedAudio.audioStream['channel_layout'] 164 const channelLayout = parsedAudio.audioStream['channel_layout']
165 // Causes playback issues with Chrome 165 // Causes playback issues with Chrome
166 if (!channelLayout || channelLayout === 'unknown') return false 166 if (!channelLayout || channelLayout === 'unknown' || channelLayout === 'quad') return false
167 167
168 return true 168 return true
169} 169}
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
76 76
77 logger.debug('Calculating audio bitrate of %s by AAC encoder.', input, { bitrate: parsedAudio.bitrate, audioCodecName }) 77 logger.debug('Calculating audio bitrate of %s by AAC encoder.', input, { bitrate: parsedAudio.bitrate, audioCodecName })
78 78
79 // Force stereo as it causes some issues with HLS playback in Chrome
80 const base = [ '-channel_layout', 'stereo' ]
81
79 if (bitrate !== -1) { 82 if (bitrate !== -1) {
80 return { outputOptions: [ buildStreamSuffix('-b:a', streamNum), bitrate + 'k' ] } 83 return { outputOptions: base.concat([ buildStreamSuffix('-b:a', streamNum), bitrate + 'k' ]) }
81 } 84 }
82 85
83 return { outputOptions: [ ] } 86 return { outputOptions: base }
84} 87}
85 88
86const defaultLibFDKAACVODOptionsBuilder: EncoderOptionsBuilder = ({ streamNum }) => { 89const defaultLibFDKAACVODOptionsBuilder: EncoderOptionsBuilder = ({ streamNum }) => {