{"record":{"id":"6d3f290340c8aaf3","repo":"remotion-dev/remotion","slug":"ext-x-program-date-time-directive-must-have-a-val","errorCode":null,"errorMessage":"#EXT-X-PROGRAM-DATE-TIME directive must have a value","messagePattern":"#EXT-X-PROGRAM-DATE-TIME directive must have a value","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/m3u/parse-directive.ts","lineNumber":147,"sourceCode":"\tif (directive === '#EXT-X-MAP') {\n\t\tif (!value) {\n\t\t\tthrow new Error('#EXT-X-MAP directive must have a value');\n\t\t}\n\n\t\tconst p = parseM3uKeyValue(value);\n\t\tif (!p.URI) {\n\t\t\tthrow new Error('EXT-X-MAP directive must have a URI');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: 'm3u-map',\n\t\t\tvalue: p.URI,\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-PROGRAM-DATE-TIME') {\n\t\tif (!value) {\n\t\t\tthrow new Error('#EXT-X-PROGRAM-DATE-TIME directive must have a value');\n\t\t}\n\n\t\t// Store the raw ISO 8601 date-time string without validation.\n\t\t// This directive associates media segments with absolute dates but\n\t\t// doesn't affect parsing of tracks, dimensions, or other metadata.\n\t\treturn {\n\t\t\ttype: 'm3u-program-date-time',\n\t\t\tdateTime: value,\n\t\t};\n\t}\n\n\tthrow new Error(`Unknown directive ${directive}. Value: ${value}`);\n};\n","sourceCodeStart":129,"sourceCodeEnd":161,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/m3u/parse-directive.ts#L129-L161","documentation":"Thrown by parseM3uDirective() at parse-directive.ts:147 when a line matches #EXT-X-PROGRAM-DATE-TIME but has no value. This optional directive associates the first sample of a segment with an absolute date and time using ISO 8601 format. The parser stores the raw string without validation but requires it to be non-empty.","triggerScenarios":"A playlist line '#EXT-X-PROGRAM-DATE-TIME' with no colon, or '#EXT-X-PROGRAM-DATE-TIME:' with an empty value.","commonSituations":"Corrupted playlist where the timestamp was removed; encoder bug producing an incomplete directive; hand-edited live playlists where the date-time was accidentally deleted.","solutions":["Ensure the directive carries an ISO 8601 date-time: #EXT-X-PROGRAM-DATE-TIME:2024-01-01T00:00:00.000Z","Remove the directive if absolute timestamps are not needed (it is optional per spec)","Regenerate the playlist with a compliant packager"],"exampleFix":"// before\n#EXT-X-PROGRAM-DATE-TIME:\n\n// after\n#EXT-X-PROGRAM-DATE-TIME:2024-01-01T00:00:00.000Z","handlingStrategy":"validation","validationCode":"// Pre-fetch and check EXT-X-PROGRAM-DATE-TIME has a 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-PROGRAM-DATE-TIME')) {\n    const colonIdx = trimmed.indexOf(':');\n    if (colonIdx === -1 || !trimmed.slice(colonIdx + 1).trim()) {\n      throw new Error('#EXT-X-PROGRAM-DATE-TIME 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-PROGRAM-DATE-TIME')) {\n    // fix the value or remove the optional directive\n  }\n  throw e;\n}","preventionTips":["Remove the optional #EXT-X-PROGRAM-DATE-TIME directive if absolute timestamps are not needed","Otherwise ensure it carries an ISO 8601 date-time string"],"tags":["hls","m3u8","directive","ext-x-program-date-time","malformed"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}