Open App

Script Sniper

Use motion tracking to automatically generate script points from video content.

Overview

Script Sniper tracks a point in your video and translates its vertical motion into script points in real time. It uses optical flow tracking powered by OpenCV.js running directly in your browser.

Points are added directly to the timeline as tracking progresses. There is no separate apply step.

Enhanced with the Bridge
Script Sniper works entirely in your browser using OpenCV.js. If you have the ScriptCompiler Bridge installed, tracking runs as a native process on your machine for improved performance. The Bridge is optional and Script Sniper works without it.

How It Works

  1. You define a tracking region (bounding box) over the video
  2. You click inside the box to select a specific point to track
  3. The tracker follows that point as the video plays
  4. Vertical movement within the box is mapped to position values (0-100)
  5. Script points are generated directly on the timeline at approximately 30 points per second

The bounding box defines the full range of motion. By default, the bottom of the box maps to position 0 and the top to position 100. You can reverse this direction or switch to horizontal mode where left maps to 0 and right maps to 100.

Getting Started

  1. Load a video into ScriptCompiler
  2. Open Script Sniper from the Tools Panel
  3. A bounding box appears over the video. You can resize and position it, or draw a new one by clicking and dragging anywhere on the video.
  4. Click inside the box on the specific point you want to follow
  5. The video starts playing and script points are generated automatically

The box displays "0%" and "100%" labels to show the position range, and a direction arrow indicates which way the stroke maps. A small circle and trailing line show the current tracked position.

Bounding Box Controls

Moving the Box

  • Click and drag anywhere on the box border to move it
  • Or use the move handle on the left side of the box

Resizing the Box

  • Drag any of the 4 corner handles to resize diagonally
  • Drag any of the 4 edge handles to resize along one axis
  • Scroll the mouse wheel while hovering over the box to scale it (5% per tick)

Rotating the Box

  • Drag the rotation handle (circular icon above the box center)
  • Press Q to rotate counter-clockwise or E to rotate clockwise
  • Rotating is useful when the motion axis is not perfectly vertical

All handles scale proportionally to the box size, so small boxes have smaller controls and large boxes have larger ones.

Drawing a New Box (Rectangle Lasso)

Instead of adjusting the existing box, you can draw a brand new one at any time by clicking and dragging anywhere on the video outside or inside the current box. This works like a rectangle lasso tool.

  • Click and drag to define the new box area
  • The minimum box size is 50x50 pixels
  • The new box inherits the current reverse and horizontal axis settings
  • If tracking is active, it automatically restarts from the center of the new box

Direction Controls

Script Sniper lets you control how tracked motion maps to position values. An arrow inside the bounding box shows the current stroke direction.

Reverse Toggle

Swaps the 0% and 100% sides. By default, bottom is 0% and top is 100%. Reversing flips them so top becomes 0% and bottom becomes 100%.

  • Press F during tracking mode
  • Or click the reverse button on the right side of the bounding box
  • The 0% and 100% labels swap positions to reflect the change

Horizontal Axis Mode

Switches from vertical to horizontal stroke mapping. Instead of tracking up/down motion (bottom to top), it tracks left/right motion (left to right). This is useful for scenes where the primary motion is horizontal.

  • Press Shift+F during tracking mode
  • Or click the axis button at the bottom of the bounding box
  • The 0% and 100% labels move to the left and right sides
  • The direction arrow updates to show the horizontal mapping
Combining direction controls
You can combine reverse and horizontal mode. For example, horizontal mode with reverse gives you right-to-left mapping (right = 0%, left = 100%). The direction arrow always reflects the current configuration.

Tracking Process

Once you click a point inside the bounding box:

  1. The tracking engine initializes on that point
  2. If the video is paused, it starts playing automatically
  3. The tracker follows the point and generates script points approximately 30 times per second
  4. Points appear on the timeline in real time

You can adjust the bounding box position, size, or rotation while tracking is active. The tracker adapts to the new configuration without stopping.

To stop tracking, use the stop button or navigate away from Script Sniper. After tracking, apply Smoothing to clean up tracking jitter.

Tracking Settings

Fine-tune tracking behavior in Settings under the Script Sniper tab:

Setting Description
Template size Size of the tracked feature template in pixels (10-200). Larger values track bigger features but are slower.
Search region Area around the last known position to search for the feature (20-500). Larger values handle faster movement but cost more processing.
Match threshold Minimum confidence for a match (0.1-1.0). Lower values accept weaker matches, higher values require closer resemblance.
Trail length Number of tracked points shown as the trailing line (5-200).
Trail thickness Width of the trail line in pixels (1-8).
Box thickness Width of the bounding box border in pixels (1-8).
Direction arrow Show or hide the direction arrow inside the bounding box that indicates the stroke mapping direction. Enabled by default.
Trail color / Box color Customize the colors of the tracking trail and bounding box.

Click Reset Defaults to restore all tracking settings to their original values.

Tips for Best Results

Good Tracking Conditions

  • Clear, consistent motion with good lighting
  • Minimal camera movement
  • Good contrast between the tracked object and its background

Selecting the Tracking Point

  • Click on a distinct, high-contrast feature
  • Avoid edges of objects where tracking may jump

Bounding Box Placement

  • Size the box to cover the full range of vertical motion
  • Position "0%" at the minimum position and "100%" at the maximum
  • Rotate the box if the motion axis is diagonal

Post-Processing

  • Apply Smoothing to reduce tracking jitter
  • Use Position Multiplier to adjust intensity
  • Manually fix any sections where tracking lost the point
Combine methods
Use Script Sniper for the main motion, then add manual points or use Drawing Mode for sections that need more detail.