{"record":{"id":"9b4f927f83a127c8","repo":"remotion-dev/remotion","slug":"unsupported-avcc-version-confversion","errorCode":null,"errorMessage":"Unsupported AVCC version ${confVersion}","messagePattern":"Unsupported AVCC version (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/iso-base-media/stsd/avcc.ts","lineNumber":18,"sourceCode":"import type {BufferIterator} from '../../../iterator/buffer-iterator';\n\nexport interface AvccBox {\n\ttype: 'avcc-box';\n\tprivateData: Uint8Array;\n\tconfigurationString: string;\n}\n\nexport const parseAvcc = ({\n\tdata,\n\tsize,\n}: {\n\tdata: BufferIterator;\n\tsize: number;\n}): AvccBox => {\n\tconst confVersion = data.getUint8();\n\tif (confVersion !== 1) {\n\t\tthrow new Error(`Unsupported AVCC version ${confVersion}`);\n\t}\n\n\tconst profile = data.getUint8();\n\tconst profileCompatibility = data.getUint8();\n\tconst level = data.getUint8();\n\n\tconst str = `${profile.toString(16).padStart(2, '0')}${profileCompatibility.toString(16).padStart(2, '0')}${level.toString(16).padStart(2, '0')}`;\n\n\tdata.counter.decrement(4);\n\n\tconst privateData = data.getSlice(size - 8);\n\n\treturn {\n\t\ttype: 'avcc-box',\n\t\tprivateData,\n\t\tconfigurationString: str,\n\t};\n};","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/iso-base-media/stsd/avcc.ts#L1-L36","documentation":"Thrown in parseAvcc() after reading the first byte of an avcC (AVC/H.264 decoder configuration) box. The AVCC spec mandates configurationVersion === 1; any other value means the box is not a valid AVCC record and the parser cannot derive the H.264 profile/level/codec string, so it aborts.","triggerScenarios":"parseMedia({src}) on an H.264 MP4/MOV whose avcC box has a version byte other than 1 — e.g. a corrupt avcC, a box that is not actually AVCC (different NALU framing), or a file damaged in transfer. The avcC is read when processBox() encounters the 'avcC' box type.","commonSituations":"Corrupted H.264 sample descriptions; files with non-standard NALU layouts; truncated/malformed avcC boxes from faulty muxers; bit-flipped version bytes.","solutions":["Re-mux the H.264 stream to rebuild a compliant avcC: ffmpeg -i in.mp4 -c:v copy out.mp4.","If the version byte is genuinely corrupt, re-encode: ffmpeg -i in.mp4 -c:v libx264 -crf 20 out.mp4.","Validate with ffprobe <file> (it reads avcC and will report the H.264 profile/level; failure indicates a bad avcC).","Re-fetch the source if you suspect transfer corruption.","Migrate to @remotion/mediabunny (parseMedia is deprecated)."],"exampleFix":"// before\nconst {videoCodec} = await parseMedia({src, reader: nodeReader});\n\n// after\ntry {\n  const {videoCodec} = await parseMedia({src, reader: nodeReader});\n} catch (err) {\n  if (err instanceof Error && /Unsupported AVCC version/.test(err.message)) {\n    // avcC version byte invalid; re-mux or re-encode the H.264 stream\n  } else throw err;\n}","handlingStrategy":"try-catch","validationCode":"// Confirm the H.264 avcC is readable via ffprobe (it reports profile/level):\n//   ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,profile,level -of json in.mp4\nimport {execFileSync} from 'node:child_process';\nfunction h264ConfigReadable(file: string): boolean {\n  try {\n    const out = execFileSync('ffprobe',\n      ['-v','error','-select_streams','v:0','-show_entries','stream=codec_name,profile,level','-of','json', file],\n      {encoding:'utf8'});\n    const j = JSON.parse(out);\n    const s = j.streams?.[0];\n    return s?.codec_name === 'h264' && typeof s.profile === 'string';\n  } catch { return false; }\n}","typeGuard":"// The avcC version byte is a deep binary field; not caller-type-guardable.\n// => typeGuard: null","tryCatchPattern":"try {\n  const {videoCodec} = await parseMedia({src, reader: nodeReader});\n} catch (err) {\n  if (err instanceof Error && /Unsupported AVCC version/.test(err.message)) {\n    // avcC version byte invalid; re-mux or re-encode the H.264 stream\n  } else {\n    throw err;\n  }\n}","preventionTips":["Re-mux H.264 files with ffmpeg to rebuild a compliant avcC (version 1).","Re-encode with libx264 if the avcC is genuinely corrupt.","Validate H.264 config with ffprobe before parsing.","Re-fetch sources suspected of corruption.","Migrate to @remotion/mediabunny (parseMedia is deprecated)."],"tags":["mp4","iso-base-media","media-parser","avcc","h264","video","corrupt-file","codec"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}