{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "IndiaDigital video edit plan (v2)",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "version",
    "aspect",
    "shots"
  ],
  "properties": {
    "version": {
      "const": 2
    },
    "title": {
      "type": "string",
      "maxLength": 120
    },
    "aspect": {
      "enum": [
        "16:9",
        "9:16",
        "1:1"
      ]
    },
    "acts": {
      "type": "array",
      "maxItems": 12,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "start",
          "end"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 60
          },
          "start": {
            "type": "number",
            "minimum": 0,
            "maximum": 600
          },
          "end": {
            "type": "number",
            "minimum": 0,
            "maximum": 600
          }
        }
      }
    },
    "shots": {
      "type": "array",
      "minItems": 1,
      "maxItems": 120,
      "description": "Main track, in play order. in/out are SOURCE seconds of assetId.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "assetId",
          "in",
          "out"
        ],
        "properties": {
          "assetId": {
            "type": "string"
          },
          "in": {
            "type": "number",
            "minimum": 0,
            "maximum": 86400
          },
          "out": {
            "type": "number",
            "minimum": 0,
            "maximum": 86400
          },
          "speed": {
            "type": "number",
            "minimum": 0.25,
            "maximum": 8
          },
          "reverse": {
            "type": "boolean"
          },
          "motion": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "preset"
            ],
            "properties": {
              "preset": {
                "enum": [
                  "none",
                  "kenburns",
                  "zoom-out",
                  "drift",
                  "pan-left",
                  "pan-right",
                  "pan-up",
                  "pan-down",
                  "dolly",
                  "punch",
                  "shake",
                  "pulse",
                  "whip",
                  "handheld",
                  "parallax",
                  "zoom-through",
                  "whirl-dive",
                  "burst",
                  "spin-in"
                ]
              },
              "zoomFrom": {
                "type": "number",
                "minimum": 1,
                "maximum": 6
              },
              "zoomTo": {
                "type": "number",
                "minimum": 1,
                "maximum": 6
              },
              "focusFrom": {
                "type": "array",
                "items": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "minItems": 2,
                "maxItems": 2
              },
              "focusTo": {
                "type": "array",
                "items": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "minItems": 2,
                "maxItems": 2
              },
              "amount": {
                "type": "number",
                "minimum": 0,
                "maximum": 3
              },
              "shake": {
                "type": "number",
                "minimum": 0,
                "maximum": 2
              },
              "ease": {
                "enum": [
                  "linear",
                  "inOutSine",
                  "outCubic",
                  "inCubic",
                  "inOutCubic",
                  "outExpo",
                  "outBack",
                  "inExpo",
                  "inOutExpo",
                  "outQuart",
                  "inOutBack",
                  "outElastic",
                  "bounce",
                  "spring"
                ]
              }
            }
          },
          "grade": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "preset"
            ],
            "properties": {
              "preset": {
                "enum": [
                  "none",
                  "before",
                  "after",
                  "cinematic",
                  "warm",
                  "cold",
                  "bw",
                  "vintage",
                  "luxury",
                  "vivid",
                  "moody",
                  "teal-orange",
                  "noir",
                  "pastel",
                  "golden-hour",
                  "bleach-bypass",
                  "film-kodak",
                  "matte",
                  "cyberpunk",
                  "clean"
                ]
              },
              "brightness": {
                "type": "number",
                "minimum": -0.5,
                "maximum": 0.5
              },
              "contrast": {
                "type": "number",
                "minimum": 0.3,
                "maximum": 2
              },
              "saturation": {
                "type": "number",
                "minimum": 0,
                "maximum": 2.5
              },
              "gamma": {
                "type": "number",
                "minimum": 0.4,
                "maximum": 2.5
              },
              "temperature": {
                "type": "number",
                "minimum": -1,
                "maximum": 1
              },
              "tint": {
                "type": "number",
                "minimum": -1,
                "maximum": 1
              },
              "shadows": {
                "type": "array",
                "items": {
                  "type": "number",
                  "minimum": -0.3,
                  "maximum": 0.3
                },
                "minItems": 3,
                "maxItems": 3
              },
              "highlights": {
                "type": "array",
                "items": {
                  "type": "number",
                  "minimum": -0.3,
                  "maximum": 0.3
                },
                "minItems": 3,
                "maxItems": 3
              },
              "vignette": {
                "type": "number",
                "minimum": 0,
                "maximum": 1.5
              },
              "grain": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "sharpen": {
                "type": "number",
                "minimum": 0,
                "maximum": 1.5
              },
              "bloom": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "fade": {
                "type": "number",
                "minimum": 0,
                "maximum": 0.5
              }
            }
          },
          "transition": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "duration"
            ],
            "properties": {
              "type": {
                "enum": [
                  "cut",
                  "match-cut",
                  "fade",
                  "dissolve",
                  "flash",
                  "dip-white",
                  "dip-black",
                  "light-leak",
                  "wipe",
                  "wipe-left",
                  "wipe-right",
                  "wipe-up",
                  "wipe-down",
                  "smooth-left",
                  "smooth-right",
                  "smooth-up",
                  "smooth-down",
                  "gradient-wipe",
                  "luma",
                  "circle-open",
                  "circle-close",
                  "diamond",
                  "radial",
                  "clock",
                  "barn-door",
                  "blinds",
                  "slide-left",
                  "slide-right",
                  "slide-up",
                  "slide-down",
                  "push-left",
                  "push-right",
                  "push-up",
                  "push-down",
                  "whip",
                  "whip-left",
                  "whip-right",
                  "whip-up",
                  "whip-down",
                  "zoom-through",
                  "zoom-in",
                  "zoom-out",
                  "cross-zoom",
                  "spin",
                  "blur",
                  "pixelize",
                  "glitch",
                  "slider"
                ]
              },
              "duration": {
                "type": "number",
                "minimum": 0,
                "maximum": 2
              },
              "ease": {
                "enum": [
                  "linear",
                  "inOutSine",
                  "outCubic",
                  "inCubic",
                  "inOutCubic",
                  "outExpo",
                  "outBack",
                  "inExpo",
                  "inOutExpo",
                  "outQuart",
                  "inOutBack",
                  "outElastic",
                  "bounce",
                  "spring"
                ]
              },
              "params": {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "number",
                    "string",
                    "boolean"
                  ]
                },
                "maxProperties": 24
              }
            },
            "description": "Transition INTO this shot."
          },
          "compare": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "assetId",
              "in"
            ],
            "properties": {
              "assetId": {
                "type": "string"
              },
              "in": {
                "type": "number",
                "minimum": 0,
                "maximum": 86400
              },
              "wipeAt": {
                "type": "number",
                "minimum": 0,
                "maximum": 30
              },
              "wipeDur": {
                "type": "number",
                "minimum": 0.1,
                "maximum": 5
              }
            }
          },
          "role": {
            "type": "string",
            "maxLength": 40
          },
          "label": {
            "type": "string",
            "maxLength": 80
          },
          "effects": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id"
              ],
              "properties": {
                "id": {
                  "enum": [
                    "bloom",
                    "vignette",
                    "light-leak",
                    "grain",
                    "sharpen",
                    "matte-fade",
                    "blur-gaussian",
                    "blur-zoom",
                    "blur-motion",
                    "blur-radial",
                    "pixelate",
                    "glitch",
                    "chromatic",
                    "letterbox",
                    "vhs",
                    "dreamy",
                    "flicker",
                    "chroma-key"
                  ]
                },
                "params": {
                  "type": "object",
                  "additionalProperties": {
                    "type": [
                      "number",
                      "string",
                      "boolean"
                    ]
                  },
                  "maxProperties": 24
                }
              }
            }
          },
          "layout": {
            "enum": [
              "full",
              "pip-top-left",
              "pip-top-right",
              "pip-bottom-left",
              "pip-bottom-right",
              "split-left",
              "split-right",
              "split-top",
              "split-bottom",
              "grid-1",
              "grid-2",
              "grid-3",
              "grid-4"
            ]
          },
          "fx": {
            "type": "object",
            "description": "Advanced render-engine ClipFx (transform/keyframes, crop, masks, colour, looks, timeRemap…). See render/schema.ts."
          },
          "volume": {
            "type": "number",
            "minimum": 0,
            "maximum": 2
          }
        }
      }
    },
    "texts": {
      "type": "array",
      "maxItems": 60,
      "description": "Kinetic text; start/end are OUTPUT seconds.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "start",
          "end",
          "text",
          "preset"
        ],
        "properties": {
          "start": {
            "type": "number",
            "minimum": 0,
            "maximum": 600
          },
          "end": {
            "type": "number",
            "minimum": 0,
            "maximum": 600
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 140
          },
          "preset": {
            "enum": [
              "none",
              "fade",
              "rise",
              "slide",
              "pop",
              "stamp",
              "word-pop",
              "wave",
              "glitch",
              "blur-in",
              "letter-reveal",
              "typewriter",
              "big-serif",
              "label",
              "tag",
              "chapter",
              "underline-title",
              "lower-third",
              "counter",
              "karaoke"
            ]
          },
          "position": {
            "enum": [
              "top",
              "upper",
              "center",
              "lower",
              "bottom",
              "lower-left"
            ]
          },
          "size": {
            "type": "number",
            "minimum": 0.015,
            "maximum": 0.2
          },
          "font": {
            "enum": [
              "sans",
              "devanagari",
              "serif",
              "mono",
              "serif-italic",
              "light"
            ]
          },
          "color": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "kicker": {
            "type": "string",
            "maxLength": 8
          },
          "spacing": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "box": {
            "enum": [
              "dark",
              "light"
            ]
          }
        }
      }
    },
    "endCard": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "duration"
      ],
      "properties": {
        "duration": {
          "type": "number",
          "minimum": 0.5,
          "maximum": 10
        },
        "background": {
          "type": "string",
          "pattern": "^#[0-9a-fA-F]{6}$"
        },
        "color": {
          "type": "string",
          "pattern": "^#[0-9a-fA-F]{6}$"
        },
        "title": {
          "type": "string",
          "maxLength": 80
        },
        "subtitle": {
          "type": "string",
          "maxLength": 80
        },
        "logoAssetId": {
          "type": "string"
        },
        "transition": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "duration"
          ],
          "properties": {
            "type": {
              "enum": [
                "cut",
                "match-cut",
                "fade",
                "dissolve",
                "flash",
                "dip-white",
                "dip-black",
                "light-leak",
                "wipe",
                "wipe-left",
                "wipe-right",
                "wipe-up",
                "wipe-down",
                "smooth-left",
                "smooth-right",
                "smooth-up",
                "smooth-down",
                "gradient-wipe",
                "luma",
                "circle-open",
                "circle-close",
                "diamond",
                "radial",
                "clock",
                "barn-door",
                "blinds",
                "slide-left",
                "slide-right",
                "slide-up",
                "slide-down",
                "push-left",
                "push-right",
                "push-up",
                "push-down",
                "whip",
                "whip-left",
                "whip-right",
                "whip-up",
                "whip-down",
                "zoom-through",
                "zoom-in",
                "zoom-out",
                "cross-zoom",
                "spin",
                "blur",
                "pixelize",
                "glitch",
                "slider"
              ]
            },
            "duration": {
              "type": "number",
              "minimum": 0,
              "maximum": 2
            },
            "ease": {
              "enum": [
                "linear",
                "inOutSine",
                "outCubic",
                "inCubic",
                "inOutCubic",
                "outExpo",
                "outBack",
                "inExpo",
                "inOutExpo",
                "outQuart",
                "inOutBack",
                "outElastic",
                "bounce",
                "spring"
              ]
            },
            "params": {
              "type": "object",
              "additionalProperties": {
                "type": [
                  "number",
                  "string",
                  "boolean"
                ]
              },
              "maxProperties": 24
            }
          }
        },
        "credit": {
          "type": "boolean",
          "description": "Show \"Made with IndiaDigital.org\" (default true)."
        }
      }
    },
    "music": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "source"
      ],
      "properties": {
        "source": {
          "enum": [
            "procedural",
            "asset",
            "none"
          ]
        },
        "style": {
          "enum": [
            "house",
            "cinematic",
            "lofi",
            "tabla",
            "corporate"
          ]
        },
        "bpm": {
          "type": "number",
          "minimum": 50,
          "maximum": 200
        },
        "dropAt": {
          "type": "number",
          "minimum": 0,
          "maximum": 600
        },
        "assetId": {
          "type": "string"
        },
        "volume": {
          "type": "number",
          "minimum": 0,
          "maximum": 2
        },
        "sfx": {
          "type": "boolean"
        },
        "seed": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "beatSync": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode"
      ],
      "properties": {
        "mode": {
          "enum": [
            "off",
            "beat",
            "half",
            "bar"
          ]
        },
        "bpm": {
          "type": "number",
          "minimum": 50,
          "maximum": 200
        },
        "offset": {
          "type": "number",
          "minimum": 0,
          "maximum": 4
        }
      }
    },
    "captions": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "enabled"
      ],
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "style": {
          "enum": [
            "bold-pop",
            "karaoke",
            "minimal"
          ]
        }
      }
    },
    "summary": {
      "type": "string",
      "maxLength": 1000
    }
  },
  "$id": "https://indiadigital.org/video/edit-plan-schema.json",
  "description": "Edit plan for https://indiadigital.org/video/editor/. shots[].in/out are SOURCE seconds of each asset (ids from get_project); texts[], acts[] and music.dropAt are OUTPUT seconds. Preset names come from the shared catalogue (motion, grade, transition, text, effect, layout). End cards show \"Made with IndiaDigital.org\" unless endCard.credit is false. Guide: https://indiadigital.org/video/agents/"
}