{"record":{"id":"cd511fc8dc00c6fe","repo":"remotion-dev/remotion","slug":"expected-private-data-in-av1-track","errorCode":null,"errorMessage":"Expected private data in AV1 track","messagePattern":"Expected private data in AV1 track","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/webm/make-track.ts","lineNumber":125,"sourceCode":"\t\treturn NO_CODEC_PRIVATE_SHOULD_BE_DERIVED_FROM_SPS;\n\t}\n\n\tif (codec.value === 'V_MPEGH/ISO/HEVC') {\n\t\tconst priv = getPrivateData(track);\n\t\tconst iterator = getArrayBufferIterator({\n\t\t\tinitialData: priv as Uint8Array,\n\t\t\tmaxBytes: (priv as Uint8Array).length,\n\t\t\tlogLevel: 'error',\n\t\t});\n\n\t\treturn 'hvc1.' + getHvc1CodecString(iterator);\n\t}\n\n\tif (codec.value === 'V_AV1') {\n\t\tconst priv = getPrivateData(track);\n\n\t\tif (!priv) {\n\t\t\tthrow new Error('Expected private data in AV1 track');\n\t\t}\n\n\t\treturn parseAv1PrivateData(priv, null);\n\t}\n\n\tthrow new Error(`Unknown codec: ${codec.value}`);\n};\n\nexport const getMatroskaAudioCodecEnum = ({\n\ttrack,\n}: {\n\ttrack: TrackEntry;\n}): MediaParserAudioCodec => {\n\tconst codec = getCodecSegment(track);\n\tif (!codec) {\n\t\tthrow new Error('Expected codec segment');\n\t}\n","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/webm/make-track.ts#L107-L143","documentation":"Thrown by `getMatroskaVideoCodecString` (make-track.ts:125) for an AV1 (`V_AV1`) track whose TrackEntry has no `CodecPrivate` element. Unlike AVC (which can fall back to SPS derivation), AV1 strictly requires the OBU sequence header carried in CodecPrivate (`parseAv1PrivateData`), so its absence is fatal for codec-string construction.","triggerScenarios":"An AV1 WebM/MKV track whose TrackEntry omits `CodecPrivate`. Happens with malformed muxers, incomplete encodes, or files truncated mid-TrackEntry. Fires during the tracks resolution pass of `parseMedia()`.","commonSituations":"Files produced by buggy AV1 encoders/muxers; AV1 streams muxed without the AV1CodecConfigurationRecord-style OBU; interrupted encodes that wrote the track header before the sequence header was known.","solutions":["Re-mux/re-encode with a conformant tool so CodecPrivate is written: `ffmpeg -i in.webm -c:v libaom-av1 out.mkv`.","Verify with `ffprobe in.webm` — a healthy AV1 track reports `encoder` and stream info; missing extradata usually breaks ffprobe too.","Catch the error and reject the asset upstream."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Probe AV1 tracks for extradata presence before parsing.\nimport { execFile } from 'node:child_process';\nimport { promisify } from 'node:util';\nconst exec = promisify(execFile);\nasync function av1HasExtradata(filePath) {\n  const { stdout } = await exec('ffprobe', ['-v', 'error', '-select_entries', 'stream=codec_name', '-of', 'json', filePath]);\n  const info = JSON.parse(stdout);\n  return info.streams?.some((s) => s.codec_name === 'av1');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({ src, fields: { tracks: true } });\n} catch (err) {\n  if (err instanceof Error && err.message === 'Expected private data in AV1 track') {\n    console.error('AV1 track is missing CodecPrivate — re-encode the file.');\n  }\n  throw err;\n}","preventionTips":["Re-encode AV1 sources with a conformant muxer (libaom-av1 via ffmpeg) so CodecPrivate is written.","Validate AV1 files with ffprobe before parsing — missing extradata breaks other tools too.","Avoid partially-written AV1 encodes (encoder crashed mid-stream)."],"tags":["media-parser","webm","av1","codec-private","malformed-input"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}