remotion-dev/remotion · error · Error
Error parsing vorbis codec private
Error message
Error parsing vorbis codec private
What it means
After reading the Xiph-laced identification-header and comment-header lengths, getAudioDescription expects the first laced packet to begin with byte 0x01 — the Vorbis identification-header packet type. A different byte means the lacing offsets are wrong or the payload is not a Vorbis identification header, so parsing aborts.
Source
Thrown at packages/media-parser/src/containers/webm/description.ts:43
let vorbisInfoLength = 0;
let vorbisSkipLength = 0;
while ((privateData[offset] & 0xff) === 0xff) {
vorbisInfoLength += 0xff;
offset++;
}
vorbisInfoLength += privateData[offset++] & 0xff;
while ((privateData[offset] & 0xff) === 0xff) {
vorbisSkipLength += 0xff;
offset++;
}
vorbisSkipLength += privateData[offset++] & 0xff;
if (privateData[offset] !== 0x01) {
throw new Error('Error parsing vorbis codec private');
}
const vorbisInfo = privateData.slice(offset, offset + vorbisInfoLength);
offset += vorbisInfoLength;
if (privateData[offset] !== 0x03) {
throw new Error('Error parsing vorbis codec private');
}
const vorbisComments = privateData.slice(offset, offset + vorbisSkipLength);
offset += vorbisSkipLength;
if (privateData[offset] !== 0x05) {
throw new Error('Error parsing vorbis codec private');
}
const vorbisBooks = privateData.slice(offset);
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Re-encode the audio with ffmpeg libvorbis.
- Validate the stream with ffprobe.
- Use Mediabunny; try/catch parseMedia().
Example fix
# rebuild Vorbis headers
ffmpeg -i in.webm -c:v copy -c:a libvorbis out.webm
await parseMedia({ src: 'out.webm' }); Defensive patterns
Strategy: try-catch
Validate before calling
// ffprobe validates Vorbis header structure // ffprobe -v error in.webm
Try / catch
try {
await parseMedia({ src: 'in.webm' });
} catch (err) {
if (err instanceof Error && /parsing vorbis codec private/i.test(err.message)) {
// corrupted Vorbis CodecPrivate — re-encode
} else throw err;
} Prevention
- Re-encode Vorbis tracks with libvorbis to rebuild headers.
- Validate WebM with ffprobe first.
- Use Mediabunny.
When it happens
Trigger: CodecPrivate whose first laced packet does not start with 0x01: corrupted length fields that shift the offset, a missing identification header, or a non-Vorbis payload tagged A_VORBIS.
Common situations: Corrupted CodecPrivate; wrong lacing lengths from a buggy muxer; partially-overwritten file.
Related errors
- Expected vorbis private data version 2
- Expected av1 private data to be version 1
- Expected av1 private data to be version 1, got ${version}
- Unexpected sampling frequency index ${samplingFrequencyIndex
- Could not find number of channels
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/aa9cc0821508962f.
Report an issue: GitHub.