fix(audio): low-samplerate ogg encode + post-2.0 QA hygiene

Quality-VBR ogg (libvorbis -q:a) fixes 8 kHz 'encoder setup failed' in both ogg paths; drop empty COOKIE_SECRET ENV (app auto-generates); emit real bundle extractedSize; fix stale image-pad/compress-pdf QA specs.
This commit is contained in:
SnapOtter
2026-06-20 10:41:50 +08:00
committed by GitHub
parent b847dcc2ab
commit 19d9ed181a
6 changed files with 63 additions and 29 deletions
+4 -1
View File
@@ -94,7 +94,10 @@ const AUDIO_OUTPUTS: Record<string, AudioOutput> = {
".ogg": {
ext: ".ogg",
contentType: "audio/ogg",
encodeArgs: ["-c:a", "libvorbis", "-b:a", "192k"],
// Quality-based VBR, not a fixed bitrate: libvorbis fails with "encoder setup
// failed" when a high fixed bitrate (192k) is requested for a low sample rate
// (e.g. 8 kHz mono). -q:a 6 is ~192 kbps for normal audio and adapts to the rate.
encodeArgs: ["-c:a", "libvorbis", "-q:a", "6"],
},
".opus": {
ext: ".opus",
+7 -11
View File
@@ -43,17 +43,13 @@ export function registerConvertAudio(app: FastifyInstance) {
];
case "wav":
return ["-i", inPath, "-vn", "-c:a", "pcm_s16le", out];
case "ogg":
return [
"-i",
inPath,
"-vn",
"-c:a",
"libvorbis",
"-b:a",
`${settings.bitrateKbps}k`,
out,
];
case "ogg": {
// libvorbis ABR (-b:a) fails with "encoder setup failed" when the bitrate is
// too high for the source sample rate (e.g. 8 kHz). Use quality VBR (-q:a),
// which adapts to the rate. Map bitrate -> quality (~bitrate/32: 192k -> q6).
const quality = (settings.bitrateKbps / 32).toFixed(1);
return ["-i", inPath, "-vn", "-c:a", "libvorbis", "-q:a", quality, out];
}
case "flac":
return ["-i", inPath, "-vn", "-c:a", "flac", out];
case "m4a":