Timeline scripts and Event scripts

Scripts

Build Timeline scripts for ordered camera, light, and GPIO actions, or Event scripts that respond to Camera Server events.

Timeline script examples

These recipes are starting points. Replace placeholder serials, group IDs, zones, node IDs, IPs, and preset IDs with values from your installation. Validate and test with a small target before using a full rig.

1. Reverse interval

“Reverse the trigger order for the cameras in my ring group while keeping a 30 ms interval between cameras.”

For a regular group cadence in the opposite direction, configure Interval mode with reversed: true:

{
  "schemaVersion": 1,
  "id": "reverse-interval",
  "name": "Reverse interval",
  "groups": [{ "id": "ring", "serials": ["CAM_001", "CAM_002", "CAM_003"] }],
  "steps": [
    {
      "type": "set-trigger-mode",
      "params": { "target": { "groupId": "ring" }, "mode": "interval", "intervalMs": 30, "reversed": true },
      "duration": 0
    },
    { "type": "trigger", "params": { "target": { "groupId": "ring" } }, "duration": 0 }
  ]
}

This reverses a regular group order. It does not create an arbitrary order.

2. Custom order with changing intervals

“Create a custom camera order with cameras 1 through 5 at 10 ms spacing, cameras 6 through 55 at 30 ms spacing, and cameras 56 through 65 at 10 ms spacing.”

A shot uses one action per camera. The offsets below demonstrate the requested pattern: cameras 1–5 at 10 ms spacing, cameras 6–55 at 30 ms spacing, and cameras 56–65 at 10 ms spacing.

Generate the complete 65-camera document from this pattern when preparing the cameras to avoid manually typing 65 nearly identical objects. The example shows two entries; the comments give the remaining offsets:

{
  "schemaVersion": 1,
  "id": "custom-mixed-intervals",
  "name": "5 fast, 50 slower, 10 fast",
  "description": "Custom camera schedule on one shared clock.",
  "groups": [
    { "id": "camera-001", "serials": ["CAM_001"] },
    { "id": "camera-002", "serials": ["CAM_002"] }
    // Add one single-camera group for each remaining camera.
  ],
  "steps": [
    {
      "type": "shot",
      "params": {
        "actions": [
          { "atMs": 0, "action": { "type": "trigger", "params": { "target": { "groupId": "camera-001" } } } },
          { "atMs": 10, "action": { "type": "trigger", "params": { "target": { "groupId": "camera-002" } } } }
          // Cameras 3-5: 20, 30, 40 ms.
          // Camera 6: 70 ms; cameras 7-55: add 30 ms each.
          // Camera 56: 1550 ms; cameras 57-65: add 10 ms each.
        ]
      },
      "duration": 0
    }
  ]
}

The offsets are absolute: camera 1 at 0 ms, camera 5 at 40 ms, camera 6 at 70 ms, camera 55 at 1540 ms, camera 56 at 1550 ms, and camera 65 at 1640 ms. For production, use explicit serials or generated single-camera groups so camera renumbering cannot silently change the order.

3. Staggered groups

“Trigger each camera group together, with one action per group, on a shared clock.”

Use one action per group when all cameras in each group should fire together. See the shipped example-shot-staggered-groups example for a three-group shared-clock timeline.

4. Prompt: odd cameras together, then even cameras with a delay

“I want to trigger all odd cameras at the same time, then all even one with a delay of 500ms between each”

This example triggers cameras 1, 3, and 5 together, then triggers even cameras 2, 4, and 6 at 500 ms intervals. Replace the numbered groups with the camera numbers from your fleet.

{
  "schemaVersion": 1,
  "id": "odd-then-even-delayed",
  "name": "Odd cameras, then delayed even cameras",
  "groups": [
    { "id": "odd-cameras", "numbers": [1, 3, 5] },
    { "id": "even-camera-2", "numbers": [2] },
    { "id": "even-camera-4", "numbers": [4] },
    { "id": "even-camera-6", "numbers": [6] }
  ],
  "steps": [
    {
      "type": "shot",
      "params": {
        "actions": [
          { "atMs": 0, "action": { "type": "trigger", "params": { "target": { "groupId": "odd-cameras" } } } },
          { "atMs": 500, "action": { "type": "trigger", "params": { "target": { "groupId": "even-camera-2" } } } },
          { "atMs": 1000, "action": { "type": "trigger", "params": { "target": { "groupId": "even-camera-4" } } } },
          { "atMs": 1500, "action": { "type": "trigger", "params": { "target": { "groupId": "even-camera-6" } } } }
        ]
      },
      "duration": 0
    }
  ]
}

5. Prompt: odd and even groups on a 176-camera bullet time rig

“On a 176-camera bullet time rig, create one group containing all odd cameras and one group containing all even cameras, then trigger the two groups one at a time.”

This example declares every camera number from 1 through 176 in one odd group and one even group. The two trigger steps run sequentially: the odd group is triggered first, then the even group. Replace the group numbers if your rig uses a different numbering scheme.

{
  "schemaVersion": 1,
  "id": "bullet-time-176-odd-even",
  "name": "176-camera bullet time: odd then even",
  "description": "Creates odd and even camera groups for a 176-camera bullet time rig, then triggers the groups sequentially.",
  "groups": [
    {
      "id": "odd-cameras",
      "numbers": [
        1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
        33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63,
        65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
        97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123,
        125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151,
        153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175
      ]
    },
    {
      "id": "even-cameras",
      "numbers": [
        2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32,
        34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64,
        66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96,
        98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124,
        126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152,
        154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176
      ]
    }
  ],
  "steps": [
    {
      "type": "trigger",
      "params": { "target": { "groupId": "odd-cameras" } },
      "duration": 0
    },
    {
      "type": "trigger",
      "params": { "target": { "groupId": "even-cameras" } },
      "duration": 0
    }
  ]
}

6. Shutter and ISO ramp across cameras

“Ramp up the shutter speed by 1/3 of a stop across my cameras starting from 1/60s while inverting the iso starting from iso 400 then take a single shot”

Assign each camera a one-third-stop faster shutter speed and the inverse ISO setting, then take one synchronized shot. This seven-camera pattern starts at 1/60 and ISO 400 and ends at 1/250 and ISO 100. Replace the numbered groups with the camera numbers from your fleet before running it.

{
  "schemaVersion": 1,
  "id": "shutter-iso-ramp",
  "name": "Shutter/ISO ramp across cameras",
  "groups": [
    { "id": "ramp-camera-1", "numbers": [1] },
    { "id": "ramp-camera-2", "numbers": [2] },
    { "id": "ramp-camera-3", "numbers": [3] },
    { "id": "ramp-camera-4", "numbers": [4] },
    { "id": "ramp-camera-5", "numbers": [5] },
    { "id": "ramp-camera-6", "numbers": [6] },
    { "id": "ramp-camera-7", "numbers": [7] },
    { "id": "ramp-cameras", "numbers": [1, 2, 3, 4, 5, 6, 7] }
  ],
  "steps": [
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-1" }, "setting": "shutter_speed", "value": { "label": "1/60" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-1" }, "setting": "iso", "value": { "label": "400" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-2" }, "setting": "shutter_speed", "value": { "label": "1/80" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-2" }, "setting": "iso", "value": { "label": "320" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-3" }, "setting": "shutter_speed", "value": { "label": "1/100" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-3" }, "setting": "iso", "value": { "label": "250" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-4" }, "setting": "shutter_speed", "value": { "label": "1/125" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-4" }, "setting": "iso", "value": { "label": "200" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-5" }, "setting": "shutter_speed", "value": { "label": "1/160" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-5" }, "setting": "iso", "value": { "label": "160" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-6" }, "setting": "shutter_speed", "value": { "label": "1/200" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-6" }, "setting": "iso", "value": { "label": "125" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-7" }, "setting": "shutter_speed", "value": { "label": "1/250" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "groupId": "ramp-camera-7" }, "setting": "iso", "value": { "label": "100" } }, "duration": 0 },
    { "type": "trigger", "params": { "target": { "groupId": "ramp-cameras" }, "phase": "warmup" }, "duration": 1000 },
    { "type": "trigger", "params": { "target": { "groupId": "ramp-cameras" } }, "duration": 0 }
  ]
}

7. Prompt: five ISO iterations in one dataset

“I need to take 5 consecutive shots with all cameras with a delay of 5 seconds between each. Each iteration should step down ISO value. Starting point for iso should be 1600. I need a single dataset with 5 iterations”

This example uses one-stop ISO steps of 1600, 800, 400, 200, and 100. combineAsIterations: true keeps all five captures in one dataset with one iteration per repeat count. Each iteration applies the ISO setting, warms up the cameras, and captures one shot before waiting 5 seconds.

{
  "schemaVersion": 1,
  "id": "five-iso-iterations",
  "name": "Five ISO iterations in one dataset",
  "steps": [
    {
      "type": "repeat",
      "params": {
        "count": 5,
        "combineAsIterations": true,
        "steps": [],
        "stepsByIteration": [
          [
            {
              "type": "set-setting",
              "params": { "target": { "all": true }, "setting": "iso", "value": { "label": "1600" } },
              "duration": 0
            },
            {
              "type": "trigger",
              "params": { "target": { "all": true }, "phase": "warmup" },
              "duration": 1000
            },
            {
              "type": "trigger",
              "params": { "target": { "all": true } },
              "duration": 5000
            }
          ],
          [
            {
              "type": "set-setting",
              "params": { "target": { "all": true }, "setting": "iso", "value": { "label": "800" } },
              "duration": 0
            },
            {
              "type": "trigger",
              "params": { "target": { "all": true }, "phase": "warmup" },
              "duration": 1000
            },
            {
              "type": "trigger",
              "params": { "target": { "all": true } },
              "duration": 5000
            }
          ],
          [
            {
              "type": "set-setting",
              "params": { "target": { "all": true }, "setting": "iso", "value": { "label": "400" } },
              "duration": 0
            },
            {
              "type": "trigger",
              "params": { "target": { "all": true }, "phase": "warmup" },
              "duration": 1000
            },
            {
              "type": "trigger",
              "params": { "target": { "all": true } },
              "duration": 5000
            }
          ],
          [
            {
              "type": "set-setting",
              "params": { "target": { "all": true }, "setting": "iso", "value": { "label": "200" } },
              "duration": 0
            },
            {
              "type": "trigger",
              "params": { "target": { "all": true }, "phase": "warmup" },
              "duration": 1000
            },
            {
              "type": "trigger",
              "params": { "target": { "all": true } },
              "duration": 5000
            }
          ],
          [
            {
              "type": "set-setting",
              "params": { "target": { "all": true }, "setting": "iso", "value": { "label": "100" } },
              "duration": 0
            },
            {
              "type": "trigger",
              "params": { "target": { "all": true }, "phase": "warmup" },
              "duration": 1000
            },
            {
              "type": "trigger",
              "params": { "target": { "all": true } },
              "duration": 5000
            }
          ]
        ]
      },
      "duration": 0
    }
  ]
}

8. Repeat capture

“Repeat the complete trigger timeline script and pause after each trigger, including camera operation time in the effective cadence.”

Use a repeat block for repeated complete triggers. Its duration is the pause after each trigger, so the effective cadence also includes the camera operation time. For a long-running operator-controlled schedule, use Camera Server Repeat capture instead; it is separate from a Timeline script and has its own stop/status behavior.

9. Forward and reverse in one dataset

Trigger cameras sequentially from first to last, then in reverse order without repeating the final camera, with a 500 ms delay between each trigger, all saved into a single dataset.

This five-camera example fires in the order 1, 2, 3, 4, 5, 4, 3, 2, 1. One shot schedules every capture on a shared clock and uses one capture request for the dataset. Replace the numbered groups with your actual camera numbers; for a larger rig, extend the ascending and descending actions without duplicating the turning-point camera.

{
  "schemaVersion": 1,
  "id": "forward-reverse-single-dataset",
  "name": "Forward and reverse, 500 ms spacing",
  "groups": [
    { "id": "sweep", "numbers": [1, 2, 3, 4, 5] },
    { "id": "camera-1", "numbers": [1] },
    { "id": "camera-2", "numbers": [2] },
    { "id": "camera-3", "numbers": [3] },
    { "id": "camera-4", "numbers": [4] },
    { "id": "camera-5", "numbers": [5] }
  ],
  "steps": [
    {
      "type": "trigger",
      "params": { "target": { "groupId": "sweep" }, "phase": "warmup" },
      "duration": 1000
    },
    {
      "type": "shot",
      "params": {
        "actions": [
          { "atMs": 0, "action": { "type": "trigger", "params": { "target": { "groupId": "camera-1" } } } },
          { "atMs": 500, "action": { "type": "trigger", "params": { "target": { "groupId": "camera-2" } } } },
          { "atMs": 1000, "action": { "type": "trigger", "params": { "target": { "groupId": "camera-3" } } } },
          { "atMs": 1500, "action": { "type": "trigger", "params": { "target": { "groupId": "camera-4" } } } },
          { "atMs": 2000, "action": { "type": "trigger", "params": { "target": { "groupId": "camera-5" } } } },
          { "atMs": 2500, "action": { "type": "trigger", "params": { "target": { "groupId": "camera-4" } } } },
          { "atMs": 3000, "action": { "type": "trigger", "params": { "target": { "groupId": "camera-3" } } } },
          { "atMs": 3500, "action": { "type": "trigger", "params": { "target": { "groupId": "camera-2" } } } },
          { "atMs": 4000, "action": { "type": "trigger", "params": { "target": { "groupId": "camera-1" } } } }
        ]
      },
      "duration": 4000
    }
  ]
}

The atMs offsets specify 500 ms between capture commands. The shot's trailing duration keeps the script active through the final scheduled command; it does not change those offsets. Use single-photo capture mode and cameras and Raspberry Pi clients that support scheduled commands. Physical exposure timing and transfer completion depend on the hardware.

10. Two bursts with different ISO values in one dataset

Set cameras to f/2.8, 1/60s shutter speed, ISO 400, and switch to burst mode. Then burst for 4 frames (1200 ms hold). Change ISO to 3200, then burst for 2 frames (600 ms hold). Finally, set ISO to 200. Keep everything in a single dataset.

Set the exposure and burst mode first, then use a two-iteration repeat with combineAsIterations: true. The first iteration requests up to four frames with a 1200 ms hold; the second changes ISO and requests up to two frames with a 600 ms hold. Both captures belong to one dataset, with one iteration for each burst.

{
  "schemaVersion": 1,
  "id": "two-bursts-single-dataset",
  "name": "Four frames at ISO 400, two at ISO 3200",
  "steps": [
    { "type": "set-setting", "params": { "target": { "all": true }, "setting": "aperture", "value": { "label": "2.8" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "all": true }, "setting": "shutter_speed", "value": { "label": "1/60" } }, "duration": 0 },
    { "type": "set-setting", "params": { "target": { "all": true }, "setting": "iso", "value": { "label": "400" } }, "duration": 0 },
    { "type": "set-mode", "params": { "target": { "all": true }, "modeId": "burst" }, "duration": 600 },
    {
      "type": "repeat",
      "params": {
        "count": 2,
        "combineAsIterations": true,
        "steps": [],
        "stepsByIteration": [
          [
            { "type": "trigger", "params": { "target": { "all": true }, "phase": "warmup" }, "duration": 1000 },
            { "type": "trigger", "params": { "target": { "all": true }, "burst": { "durationMs": 1200, "maxFrames": 4 } }, "duration": 0 }
          ],
          [
            { "type": "set-setting", "params": { "target": { "all": true }, "setting": "iso", "value": { "label": "3200" } }, "duration": 0 },
            { "type": "trigger", "params": { "target": { "all": true }, "phase": "warmup" }, "duration": 1000 },
            { "type": "trigger", "params": { "target": { "all": true }, "burst": { "durationMs": 600, "maxFrames": 2 } }, "duration": 0 }
          ]
        ]
      },
      "duration": 0
    },
    { "type": "set-setting", "params": { "target": { "all": true }, "setting": "iso", "value": { "label": "200" } }, "duration": 0 }
  ]
}

Before running, confirm that the selected cameras expose these settings, a burst mode, and frame-count limits. Use the setting labels and mode IDs reported by your cameras if they differ.

maxFrames is a cap, not a guarantee: a hold can end before the requested number of frames is captured. The trigger step waits for its hold, so its trailing duration is zero rather than another 1200 or 600 ms pause.

After a successful run, ISO is 200; aperture, shutter speed, and burst mode remain as configured. Cancellation does not execute the final ISO step or automatically restore earlier settings.

11. Shipped examples

“Show me the shipped Timeline script examples for timelapse repeat, burst then single photo, staggered groups, delayed groups, setting changes, lights, light effects, presets, and GPIO.”

Camera Server includes examples for timelapse repeat, burst then single photo, staggered groups, delayed groups, setting changes, lights, light effects, presets, and GPIO. Restore an example to its shipped content, duplicate it, replace local identifiers, validate, and run it manually before binding it.

Updated

Page links