SubtitleEdit/subtitleedit · error · InvalidOperationException
Unknown time format '{timeFormat}'
Error message
Unknown time format '{timeFormat}' What it means
Thrown by ClqttJson.LoadSubtitle when the JSON 'meta' object has a 'timeFormat' field whose value is not 'FRAMES' (case-insensitive). The CLQTT importer only supports frame-based timing, so any other value (seconds, milliseconds, or a typo) is rejected before any events are read.
Source
Thrown at src/libse/SubtitleFormats/ClqttJson.cs:53
var text = sb.ToString().TrimStart();
if (text.IndexOf("\"events\"", StringComparison.Ordinal) < 0)
{
return;
}
subtitle.Paragraphs.Clear();
var parser = new SeJsonParser();
var frameRate = Configuration.Settings.General.CurrentFrameRate;
var rootElements = parser.GetRootElements(text);
var metaElement = rootElements.Find(element => element.Name.Equals("meta", StringComparison.InvariantCultureIgnoreCase));
if (metaElement != null)
{
var timeFormat = parser.GetFirstObject(metaElement.Json, "timeFormat");
if (!timeFormat.Equals("FRAMES", StringComparison.InvariantCultureIgnoreCase))
{
throw new InvalidOperationException($"Unknown time format '{timeFormat}'");
}
var fpsString = parser.GetFirstObject(metaElement.Json, "fps");
if (fpsString.Equals("FPS_2397", StringComparison.InvariantCultureIgnoreCase))
{
frameRate = 24000.0 / 1001.0;
}
else if (fpsString.Equals("FPS_2997", StringComparison.InvariantCultureIgnoreCase))
{
frameRate = 30000.0 / 1001.0;
}
else if (fpsString.Equals("FPS_5994", StringComparison.InvariantCultureIgnoreCase))
{
frameRate = 60000.0 / 1001.0;
}
else
{
tryView on GitHub (pinned to 17a9f07487)
Solutions
- Inspect the .clqtt file's meta object and set timeFormat to "FRAMES".
- Convert the file's timing to frames using its native tool before importing.
- Upgrade SubtitleEdit — newer builds may support additional time formats.
- If producing CLQTT output, ensure your exporter writes timeFormat=FRAMES.
Example fix
// before
"meta": { "timeFormat": "seconds", "fps": "FPS_2397" }
// after
"meta": { "timeFormat": "FRAMES", "fps": "FPS_2397" } Defensive patterns
Strategy: validation
Validate before calling
// Check meta.timeFormat before importing a CLQTT payload
var timeFormat = parser.GetFirstObject(metaElement.Json, "timeFormat");
if (!timeFormat.Equals("FRAMES", StringComparison.OrdinalIgnoreCase))
{
// convert or reject instead of letting LoadSubtitle throw
Console.WriteLine($"Unsupported timeFormat '{timeFormat}'; convert to FRAMES first.");
} Try / catch
try
{
new ClqttJson().LoadSubtitle(sub, lines, fileName);
}
catch (InvalidOperationException ex) when (ex.Message.Contains("Unknown time format"))
{
// inform user the file's timing mode is unsupported
logger.Warning(ex.Message);
} Prevention
- Verify CLQTT files come from a producer that emits timeFormat=FRAMES.
- Inspect the meta object in a JSON viewer before batch-importing.
- Keep SubtitleEdit updated for new time-format support.
When it happens
Trigger: Feeding a .clqtt file whose meta.timeFormat is 'SECONDS', 'ms', 'TIME', empty, or any string other than 'FRAMES'. Also occurs if a future CLQTT spec version introduces a new time format this importer does not yet handle.
Common situations: Using a CLQTT file produced by a tool that emits a different timing mode; version mismatch between the file producer and this SubtitleEdit build; hand-crafted CLQTT JSON.
Related errors
- Unknown type of event #{i + 1}: '{type}'
- Element 'events' not found.
- Parse error in event #{i + 1} style: {ex.Message}
- Parse error in event #{i + 1}: {ex.Message}
- Invalid ASSA time code: {time}
AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13).
Data as JSON: /api/errors/384381a3055f2ef8.
Report an issue: GitHub.