feat: apply 5x volume boost to all FFmpeg audio processing (broadcast sequences, HLS, DFPWM) to maximize loudness
This commit is contained in:
@@ -1289,7 +1289,7 @@ function buildSequenceWavFile(seq) {
|
||||
|
||||
const inputs = files.map(f => `-i "${f}"`).join(' ');
|
||||
const filterResamples = files.map((_, i) => `[${i}:a]aformat=sample_rates=48000:channel_layouts=mono,aresample=48000[a${i}]`).join(';');
|
||||
const filterConcat = files.map((_, i) => `[a${i}]`).join('') + `concat=n=${files.length}:v=0:a=1[a]`;
|
||||
const filterConcat = files.map((_, i) => `[a${i}]`).join('') + `concat=n=${files.length}:v=0:a=1,volume=5.0[a]`;
|
||||
const filterComplex = `${filterResamples};${filterConcat}`;
|
||||
|
||||
try {
|
||||
@@ -1330,7 +1330,7 @@ function runFfmpegRtmpPush(streamName, seq) {
|
||||
const tmpAacPath = path.join(tmpDir, `prebuild-${Date.now()}-${Math.random().toString(16).slice(2)}.aac`);
|
||||
const inputs = files.map(f => `-i "${f}"`).join(' ');
|
||||
const filterResamples = files.map((_, i) => `[${i}:a]aformat=sample_rates=48000:channel_layouts=mono,aresample=48000[a${i}]`).join(';');
|
||||
const filterConcat = files.map((_, i) => `[a${i}]`).join('') + `concat=n=${files.length}:v=0:a=1[a]`;
|
||||
const filterConcat = files.map((_, i) => `[a${i}]`).join('') + `concat=n=${files.length}:v=0:a=1,volume=5.0[a]`;
|
||||
const filterComplex = `${filterResamples};${filterConcat}`;
|
||||
|
||||
const buildArgs = [
|
||||
@@ -1425,7 +1425,7 @@ function runFfmpegRtmpPush(streamName, seq) {
|
||||
}
|
||||
|
||||
const filterResamples = files.map((_, i) => `[${i}:a]aformat=sample_rates=48000:channel_layouts=mono,aresample=48000[a${i}]`).join(';');
|
||||
const filterConcat = files.map((_, i) => `[a${i}]`).join('') + `concat=n=${files.length}:v=0:a=1[a]`;
|
||||
const filterConcat = files.map((_, i) => `[a${i}]`).join('') + `concat=n=${files.length}:v=0:a=1,volume=5.0[a]`;
|
||||
const filterComplex = `${filterResamples};${filterConcat}`;
|
||||
|
||||
const args = [
|
||||
@@ -2086,7 +2086,8 @@ function convertToDfpwm(filePath) {
|
||||
// -f s8: signed 8-bit pcm
|
||||
// -ac 1: mono
|
||||
// -ar 48000: 48kHz
|
||||
execSync(`ffmpeg -y -v quiet -i "${filePath}" -f s8 -acodec pcm_s8 -ac 1 -ar 48000 "${rawPath}"`);
|
||||
// -filter:a volume=5.0: boost volume significantly
|
||||
execSync(`ffmpeg -y -v quiet -i "${filePath}" -filter:a volume=5.0 -f s8 -acodec pcm_s8 -ac 1 -ar 48000 "${rawPath}"`);
|
||||
|
||||
if (fs.existsSync(rawPath)) {
|
||||
const buffer = fs.readFileSync(rawPath);
|
||||
@@ -2714,7 +2715,7 @@ function buildTempBroadcastFromWav(prefixWavPath, contentWavPath) {
|
||||
const filterComplex = [
|
||||
'[0:a]aformat=sample_rates=48000:channel_layouts=mono,aresample=48000[a0]',
|
||||
'[1:a]aformat=sample_rates=48000:channel_layouts=mono,aresample=48000[a1]',
|
||||
'[a0][a1]concat=n=2:v=0:a=1[a]'
|
||||
'[a0][a1]concat=n=2:v=0:a=1,volume=5.0[a]'
|
||||
].join(';');
|
||||
|
||||
execSync(`ffmpeg -hide_banner -loglevel error -y -i "${prefixWavPath}" -i "${contentWavPath}" -filter_complex "${filterComplex}" -map "[a]" -ac 1 -ar 48000 -c:a pcm_s16le "${outWavPath}"`);
|
||||
|
||||
Reference in New Issue
Block a user