From: Chocobozzz Date: Tue, 11 Dec 2018 16:48:14 +0000 (+0100) Subject: Fix broken audio with transcoding X-Git-Tag: v1.2.0-rc.1~76 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=64e3e27053a5881fa9efca32f5a0debace617ced;p=oweals%2Fpeertube.git Fix broken audio with transcoding --- diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts index b59e7e40e..0caa86efc 100644 --- a/server/helpers/ffmpeg-utils.ts +++ b/server/helpers/ffmpeg-utils.ts @@ -328,10 +328,10 @@ async function presetH264 (command: ffmpeg.FfmpegCommand, resolution: VideoResol const audioCodecName = parsedAudio.audioStream[ 'codec_name' ] let bitrate: number if (audio.bitrate[ audioCodecName ]) { - bitrate = audio.bitrate[ audioCodecName ](parsedAudio.audioStream[ 'bit_rate' ]) + localCommand = localCommand.audioCodec('aac') - if (bitrate === -1) localCommand = localCommand.audioCodec('copy') - else if (bitrate !== undefined) localCommand = localCommand.audioBitrate(bitrate) + bitrate = audio.bitrate[ audioCodecName ](parsedAudio.audioStream[ 'bit_rate' ]) + if (bitrate !== undefined && bitrate !== -1) localCommand = localCommand.audioBitrate(bitrate) } }