{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tools.osmo.inc/notes/footage-notes.schema.json",
  "title": "Osmo Notes footage-notes.json (osmo-footage-notes/1)",
  "description": "What a person marked on their footage in Osmo Notes: every clip in the folder, and the parts they picked, with a note on each. Times are seconds from the first frame of the file; tc_in / tc_out are source timecode, non drop frame, on a base of round(fps).",
  "type": "object",
  "required": ["format", "app", "title", "footage_root", "written", "summary", "clips"],
  "properties": {
    "format": { "type": "string", "enum": ["osmo-footage-notes/1"] },
    "app": { "type": "string", "description": "Osmo Notes and its version" },
    "title": { "type": "string", "description": "Project name (the footage folder's name unless renamed)" },
    "footage_root": { "type": "string", "description": "Absolute path of the footage folder on the machine that wrote this file" },
    "written": { "type": "string", "description": "When this file was written, ISO 8601 with UTC offset" },
    "how_to_read": { "type": "string" },
    "summary": {
      "type": "object",
      "required": ["clips", "reviewed", "wont_use", "ranges", "notes"],
      "properties": {
        "clips": { "type": "integer" }, "reviewed": { "type": "integer", "description": "reviewed + wont_use clips" },
        "wont_use": { "type": "integer" }, "ranges": { "type": "integer" }, "notes": { "type": "integer" }
      }
    },
    "clips": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["path", "file_name", "folder", "abs_path", "timecode_start", "fps", "duration", "status", "ranges"],
        "properties": {
          "path": { "type": "string", "description": "Relative to footage_root, with / separators. Unique per clip." },
          "file_name": { "type": "string" },
          "folder": { "type": "string", "description": "Display folder (camera card internals like PRIVATE/M4ROOT/CLIP left out)" },
          "abs_path": { "type": "string" },
          "proxy_path": { "type": ["string", "null"], "description": "The camera's own proxy, when there is one (Sony SUB, RED / BRAW proxies)" },
          "timecode_start": { "type": ["string", "null"], "description": "Source timecode of the first frame, HH:MM:SS:FF" },
          "fps": { "type": ["number", "null"] },
          "duration": { "type": ["number", "null"], "description": "Seconds" },
          "width": { "type": ["integer", "null"] },
          "height": { "type": ["integer", "null"] },
          "codec": { "type": ["string", "null"] },
          "status": {
            "type": "string",
            "enum": ["unreviewed", "in_progress", "reviewed", "wont_use", "missing"],
            "description": "reviewed and wont_use: watched end to end, unmarked parts are not wanted. unreviewed: not looked at. missing: the file is gone but it had notes."
          },
          "ranges": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["id", "in", "out", "duration", "tc_in", "tc_out", "label", "note", "tags"],
              "properties": {
                "id": { "type": "string" },
                "in": { "type": "number", "description": "Seconds from the first frame" },
                "out": { "type": "number" },
                "duration": { "type": "number" },
                "tc_in": { "type": ["string", "null"], "description": "Source timecode at in" },
                "tc_out": { "type": ["string", "null"] },
                "label": { "type": "string", "enum": ["usable", "hero", "not_usable"], "description": "usable: fine to cut in. hero: one of the best moments. not_usable: avoid." },
                "note": { "type": "string", "description": "What the person wrote about this part (can be empty)" },
                "tags": { "type": "array", "items": { "type": "string" } }
              }
            }
          }
        }
      }
    }
  }
}
