{"record":{"id":"fdad3df8bba9e7cb","repo":"remotion-dev/remotion","slug":"ext-x-discontinuity-sequence-directive-must-have","errorCode":null,"errorMessage":"#EXT-X-DISCONTINUITY-SEQUENCE directive must have a value","messagePattern":"#EXT-X-DISCONTINUITY-SEQUENCE directive must have a value","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/m3u/parse-directive.ts","lineNumber":92,"sourceCode":"\t\t\ttype: 'm3u-playlist-type',\n\t\t\tplaylistType: value,\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-MEDIA-SEQUENCE') {\n\t\tif (!value) {\n\t\t\tthrow new Error('#EXT-X-MEDIA-SEQUENCE directive must have a value');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: 'm3u-media-sequence',\n\t\t\tvalue: Number(value),\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-DISCONTINUITY-SEQUENCE') {\n\t\tif (!value) {\n\t\t\tthrow new Error(\n\t\t\t\t'#EXT-X-DISCONTINUITY-SEQUENCE directive must have a value',\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\ttype: 'm3u-discontinuity-sequence',\n\t\t\tvalue: Number(value),\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-STREAM-INF') {\n\t\tif (!value) {\n\t\t\tthrow new Error('EXT-X-STREAM-INF directive must have a value');\n\t\t}\n\n\t\tconst res = parseStreamInf(value);\n\t\treturn res;\n\t}","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/m3u/parse-directive.ts#L74-L110","documentation":"Thrown by parseM3uDirective() at parse-directive.ts:92 when a line matches #EXT-X-DISCONTINUITY-SEQUENCE but has no numeric value. This optional directive indicates the sequence number of the first discontinuity in the playlist. The parser converts the value via Number().","triggerScenarios":"A playlist line '#EXT-X-DISCONTINUITY-SEQUENCE' with no colon, or '#EXT-X-DISCONTINUITY-SEQUENCE:' with an empty or non-numeric value.","commonSituations":"Corrupted playlist where the discontinuity sequence number was removed or left empty; encoder bug producing incomplete directives; hand-edited live playlists.","solutions":["Ensure the directive carries a non-negative integer: #EXT-X-DISCONTINUITY-SEQUENCE:0","Remove the directive if discontinuity numbering is not needed (it is optional)","Regenerate the playlist with a compliant packager"],"exampleFix":"// before\n#EXT-X-DISCONTINUITY-SEQUENCE:\n\n// after\n#EXT-X-DISCONTINUITY-SEQUENCE:0","handlingStrategy":"validation","validationCode":"// Pre-fetch and check EXT-X-DISCONTINUITY-SEQUENCE has a numeric value\nconst text = await (await fetch(url)).text();\nfor (const line of text.split('\\n')) {\n  const trimmed = line.trim();\n  if (trimmed.startsWith('#EXT-X-DISCONTINUITY-SEQUENCE')) {\n    const colonIdx = trimmed.indexOf(':');\n    const val = colonIdx === -1 ? '' : trimmed.slice(colonIdx + 1).trim();\n    if (!val || isNaN(Number(val))) {\n      throw new Error('#EXT-X-DISCONTINUITY-SEQUENCE is missing its value');\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({src: url});\n} catch (e) {\n  if (e instanceof Error && e.message.includes('EXT-X-DISCONTINUITY-SEQUENCE')) {\n    // fix the value or remove the optional directive\n  }\n  throw e;\n}","preventionTips":["Remove the optional #EXT-X-DISCONTINUITY-SEQUENCE directive if discontinuity numbering is not needed","Otherwise ensure it carries a non-negative integer"],"tags":["hls","m3u8","directive","ext-x-discontinuity-sequence","malformed"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}