Checking a video
The tool check runs a video's timeline and answers with what it found: what is wrong, with the line each finding comes from, and how long the video is. An agent calls it after every change, before it looks at a frame. Check draws nothing: the video's source is read and linted, and its timeline is run on the app's own server, its files read but never decoded, so it answers in moments, and a check of a video nothing it loads changed in answers from what the last one found. Framescript also runs the same check on every change an agent writes through bash, on the videos that change reaches, and writes nothing that fails it. Every export runs it before anything is drawn and refuses on an error with the findings, whoever starts it: the studio's Export, the tool exports or render.
The samples here read basics/tweens. A call names its video with video, as bash shows it, or works on the video of the window you used last (Which video):
{ "video": "/videos/basics/tweens" }
What it answers
{
"ok": true,
"video": "tweens",
"status": "ready",
"duration": 2.7,
"frames": 162,
"diagnostics": [],
"files": []
}
statusisreadywhen the timeline ran to its end,failedwhen it threw, andskippedwhen it was not run, with why inskipped(What check does not judge yet).diagnosticslists what is wrong. Each has theruleit breaks, one of the rules of the check, aseverity(errororwarning), amessagethat says what to do, thesiteof the call asfile:line:column(ornull), and thetimeandframeit belongs to.okistruewhen no diagnostic is an error and the timeline did not fail. Warnings alone leaveoktrue. Whenokis false, the tool's answer is marked as an error and still holds the diagnostics.diagnosticsalso holds what the video shows that is not seen as meant: an object added to be drawn that no moment shows, a material that takes light with none, a camera, viewport or image out of its picture's proportions. These are judged on the running video at taste's moments, at the start, middle and end of each object's animations and at least every quarter second, so an object that only crosses the frame quickly, or shows for a moment within a long animation, is seen; each finding names its object by name and line (the objects' rules).diagnosticsalso holds what taste finds: texts that overlap, leave the frame or are too small to read, titles that only fade, moves that stop at speed. Such a finding names what is on screen: itsrule, theobjectsit is about by name with their lines and where they lie, theclipit happens in and thecropthat shows them (what a finding carries).tasteExceptions, there when a text is let off a rule withallow, lists each exception with its rule and reason; an exception never fails the check.diagnosticsalso holds what the lint of the video's source finds, each at itsfile:line:column: a step never run for want ofyield*,Math.randomand the other calls that differ on every run, an async function, a request outsideload, acustomthat assigns what lies outside it, aletat the top of a module (the rules of the video's source). A line breaks one of them on purpose with a comment above it,// framescript-allow module-state: <reason>; a comment without a reason is an error of its own.- Check runs the timeline a second time and plays sample frames forwards and then backwards. When the second run records anything else, or a moment comes out otherwise in the other order,
diagnosticsholds an error ofnondeterminismat the first thing that differs. The run reaches only the video's own files: afetchof the web fails there, and in an export. - Check also runs the video at its controls' limits, one control at a time over the others' values: a slider or a number at its least and its most, a toggle the other way and a choice at each other option. An error such a run finds where the video's own run finds none is in
diagnosticswith theinputsit happens with, such as{ "count": 10 }. Those runs are judged by their timeline and by taste, and say only errors: a warning that a value brings, such as a length past what a video plays without scenes, is judgement, not a broken video. At most 12 are made. fileslists the files the run read throughload.*, each by the address the video names it, a sequence's pictures each apart, and the fonts its texts are laid out in.
A video with an error
{
"ok": false,
"video": "broken",
"status": "ready",
"duration": 1.6,
"frames": 48,
"diagnostics": [
{
"severity": "error",
"rule": "unknown-label",
"message": "There is no label \"beat\" in this clip or the clips around it. A label is made with label(\"beat\", time) before it is used.",
"site": "broken/index.ts:22:12",
"span": "s6",
"time": 1.1,
"frame": 33
}
],
"files": []
}
A diagnostic's message says what is wrong and what to do, and its site is the place to do it at. Treat warnings as work as well: The loop an agent works in shows them and how to act on them.
A video whose file cannot be built, or throws before it exports its video, fails the same way, with one error that names the file and no site: broken/index.ts could not be loaded: missing is not defined. Only that video fails; the other videos answer as before.
A timeline that does not end within a minute is ended and fails with an error of runaway: a wait or a tween given a time that never comes is the usual cause.
What check does not judge yet
Check judges what a video's run records, without drawing a frame or decoding a file, so these are not part of it yet:
- What a video costs to draw: its draw calls, its passes and what a frame holds. The studio's inspector shows them.
- How loud the mix is and how its sounds are mixed. See Loudness and the master for how to hear it.
- Whatever reads a frame's pixels, such as a picture whose transparent pixels are drawn solid.
- Whether the browser has a decoder for a media file's codec: check reads a media file's length, picture size and frame times from its container.
A video that loads a glTF model, an SVG drawing or what a media file sounds like (listening), a picture whose header does not say its size, starts a worker of its own or reads a file from the network is not run: its status is skipped and skipped says why. That is neither a pass nor an error; what the lint and the video's layout find is still said.
Pictures of what taste finds
With shots set to true, check also draws a picture of each taste finding's moment, cut to its crop with each of its objects outlined, and names it in the finding as shot. The first eight come back as pictures beside the answer, also when the check fails, so an agent that can see looks at what a finding points at at once. At most 24 are drawn; shots in the answer says how many were drawn and how many findings were left without one.
{ "video": "/videos/launch", "shots": true }
Values to try
inputs runs the check with other values for the video's controls, the object itself or a JSON file of it in the video, and writes nothing; the runs at the controls' limits start from them:
{ "video": "/videos/hello", "inputs": { "rise": 0.9 } }
See also
- Taste: the rules the check holds a video to
- The loop an agent works in
- Reading a video and Looking at a frame
- The tools an agent has