{"record":{"id":"aa9cc0821508962f","repo":"remotion-dev/remotion","slug":"error-parsing-vorbis-codec-private","errorCode":null,"errorMessage":"Error parsing vorbis codec private","messagePattern":"Error parsing vorbis codec private","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/webm/description.ts","lineNumber":43,"sourceCode":"\tlet vorbisInfoLength = 0;\n\tlet vorbisSkipLength = 0;\n\n\twhile ((privateData[offset] & 0xff) === 0xff) {\n\t\tvorbisInfoLength += 0xff;\n\t\toffset++;\n\t}\n\n\tvorbisInfoLength += privateData[offset++] & 0xff;\n\n\twhile ((privateData[offset] & 0xff) === 0xff) {\n\t\tvorbisSkipLength += 0xff;\n\t\toffset++;\n\t}\n\n\tvorbisSkipLength += privateData[offset++] & 0xff;\n\n\tif (privateData[offset] !== 0x01) {\n\t\tthrow new Error('Error parsing vorbis codec private');\n\t}\n\n\tconst vorbisInfo = privateData.slice(offset, offset + vorbisInfoLength);\n\toffset += vorbisInfoLength;\n\n\tif (privateData[offset] !== 0x03) {\n\t\tthrow new Error('Error parsing vorbis codec private');\n\t}\n\n\tconst vorbisComments = privateData.slice(offset, offset + vorbisSkipLength);\n\toffset += vorbisSkipLength;\n\n\tif (privateData[offset] !== 0x05) {\n\t\tthrow new Error('Error parsing vorbis codec private');\n\t}\n\n\tconst vorbisBooks = privateData.slice(offset);\n","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/webm/description.ts#L25-L61","documentation":"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.","triggerScenarios":"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.","commonSituations":"Corrupted CodecPrivate; wrong lacing lengths from a buggy muxer; partially-overwritten file.","solutions":["Re-encode the audio with ffmpeg libvorbis.","Validate the stream with ffprobe.","Use Mediabunny; try/catch parseMedia()."],"exampleFix":"# rebuild Vorbis headers\nffmpeg -i in.webm -c:v copy -c:a libvorbis out.webm\n\nawait parseMedia({ src: 'out.webm' });","handlingStrategy":"try-catch","validationCode":"// ffprobe validates Vorbis header structure\n// ffprobe -v error in.webm","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({ src: 'in.webm' });\n} catch (err) {\n  if (err instanceof Error && /parsing vorbis codec private/i.test(err.message)) {\n    // corrupted Vorbis CodecPrivate — re-encode\n  } else throw err;\n}","preventionTips":["Re-encode Vorbis tracks with libvorbis to rebuild headers.","Validate WebM with ffprobe first.","Use Mediabunny."],"tags":["webm","matroska","media-parser","vorbis","corrupt-file","audio","codec"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}