# Settings Reference

## File Format

Settings are stored in `settings.txt` as key=value pairs, one per line. Lines starting with `#` are comments.

    # Comment line
    key=value
    array_key[0]=value
    *string_key=text value
    @coord_key=x,y
    float_key%=0.500000

Prefix/Suffix | Type | Example
--- | --- | ---
(none) | Integer | `min_frames=60`
`%` suffix | Float/percentage | `max_diff_y%=0.500000`
`*` prefix | String | `*font_file=font.bmp`
`@` prefix | XY coordinate | `@far[0][ 0]=960,100`

## UI / Display

Setting | Default | Description
--- | --- | ---
`big_window_width` | 1920 | Viewer window width in pixels
`big_window_height` | 540 | Viewer window height in pixels
`frame_position_bar_height` | 10 | Height of the position bar overlay (pixels)
`mouse_position_speed` | 5 | Speed multiplier for right-click drag scrolling
`only_one_viewer` | 0 | If 1, prevent launching multiple viewer instances
`show_jumper_numbers` | 1 | Show jumper number overlay on video
`show_speed` | 1 | Show speed overlay on video
`show_name` | 1 | Show jumper name overlay on video
`show_lines_mode` | 1 | Grid line mode at startup (0=off, 1=main, 2=sub-meter)
`showing_motion` | 0 | Show motion detection overlay at startup
`draw_circle_around_blobs` | 0 | Draw circles around detected motion blobs

## Font

Setting | Default | Description
--- | --- | ---
`*font_file` | (empty) | Path to bitmap font file
`font_size` | 24 | Font rendering size
`font_window_width` | 320 | Width of text overlay area
`font_window_height` | 120 | Height of text overlay area

## Video / Movie

Setting | Default | Description
--- | --- | ---
`min_frames` | 60 | Minimum clip length in frames (1 sec at 60fps)
`max_frames` | 520 | Maximum clip length (limited by circular buffer)
`movie_pad` | 30 | Extra frames captured before/after motion event
`min_type1_frames` | 60 | Minimum frames for type 1 display (feeds 0+1)
`min_type2_frames` | 60 | Minimum frames for type 2 display (feeds 1+2)
`additional_frame_count[N]` | 0 | Extra frames to capture for feed N after trigger
`overlay_frame_offsets[N]` | 0 | Frame offset for text overlay timing on feed N
`meters_from_takeoff_to_visible` | 50 | Distance from takeoff to first visible point
`last_visible_meter_line` | 145 | Last meter line visible in the camera view
`default_view_frame_offset_from_end` | 30 | Viewer starts this many frames before clip end
`min_feed` | 0 | Lowest feed number in use

## Motion Detection Thresholds

### Percentage Thresholds

Control what fraction of the frame must show differences for motion to be considered. Values are 0.0–100.0.

Setting | Default | Description
--- | --- | ---
`max_diff_y%` | 0.5 | Maximum Y-plane diff percentage (above = too much change, likely lighting)
`max_diff_u%` | 0.5 | Maximum U-plane diff percentage
`max_diff_v%` | 0.5 | Maximum V-plane diff percentage
`min_diff_y%` | 0.01 | Minimum Y-plane diff percentage (below = noise)
`min_diff_u%` | 0.01 | Minimum U-plane diff percentage
`min_diff_v%` | 0.01 | Minimum V-plane diff percentage

### Absolute Thresholds

Setting | Default | Description
--- | --- | ---
`max_diff_y` | 10000 | Maximum absolute Y diff pixel count
`min_diff_y` | 100 | Minimum absolute Y diff pixel count
`ydiff_min[N]` | 10 | Per-pixel Y difference threshold for feed N
`ydiff_max` | 255 | Maximum per-pixel Y difference (above = ignore)
`udiff_min[N]` | 10 | Per-pixel U difference threshold for feed N
`vdiff_min[N]` | 10 | Per-pixel V difference threshold for feed N

## Blob Detection

Setting | Default | Description
--- | --- | ---
`min_blob_sizes[N]` | 30 | Minimum blob area (pixels) to keep for feed N
`max_blob_size` | 50000 | Maximum blob area (above = not a jumper)
`min_blob_distance[N]` | 2 | Minimum blob movement (pixels/frame) for feed N
`max_blob_distance[N]` | 200 | Maximum blob movement (above = noise) for feed N
`max_blob_count` | 50 | Maximum blobs to track per frame
`min_blob_keep` | 20 | Minimum blob area to keep after merge
`min_blob_neighbors` | 2 | Minimum neighbor count for flood fill (noise filter)
`blob_fuzz_x` | 30 | X tolerance for merging nearby blobs
`blob_fuzz_y` | 30 | Y tolerance for merging nearby blobs
`min_quick_size` | 200 | Minimum quick-scan blob area
`erase_shadows` | 0 | Enable shadow erasure in blob detection
`distance_look_back_n_frames` | 5 | Frames to look back for blob movement calculation

## Motion Regions

Define the rectangle within each feed where motion detection is active. Pixels outside this region are ignored.

Setting | Default | Description
--- | --- | ---
`motion_start_x[N]` | 0 | Left edge of motion region for feed N
`motion_start_y[N]` | 0 | Top edge of motion region for feed N
`motion_end_x[N]` | 1920 | Right edge of motion region for feed N
`motion_end_y[N]` | 1080 | Bottom edge of motion region for feed N
`feed_motion_on[N]` | 1 | Enable motion detection for feed N (0=off, 1=on)

## Motion / Movie Logic

Setting | Default | Description
--- | --- | ---
`min_motion_count[N]` | 3 | Consecutive frames of motion needed to trigger recording on feed N
`min_nomotion_count[N]` | 10 | Consecutive frames without motion to stop recording on feed N
`feed_offset[N]` | 0 | Frame offset to align feed N (for USB timing differences)

## Grid Lines (Distance Measurement)

Setting | Default | Description
--- | --- | ---
`meter_line_count[N]` | 20 | Number of grid lines for feed N
`meter_line_start[N]` | varies | First meter mark for feed N (e.g., 80m, 100m, 120m)
`meter_line_increment[N]` | 1 | Meters between grid lines for feed N
`meter_line_radius[N]` | 1 | Line thickness (half-width in pixels) for feed N
`@far[N][L]` | (none) | Far anchor point (x,y) for feed N, line L
`@near[N][L]` | (none) | Near anchor point (x,y) for feed N, line L

See Grid Line Calibration for how to set anchor points.

## Grid Line Colors (YUV)

Setting | Default | Description
--- | --- | ---
`meter_line_Y/U/V` | 200/128/128 | Main meter line color (light gray)
`meter1_line_Y/U/V` | 255/128/128 | Highlighted meter line color (white)
`meterD_line_Y/U/V` | 128/200/128 | Sub-meter division line color

## Motion Marker Colors (YUV)

Setting | Default | Description
--- | --- | ---
`mark_motion` | 1 | Enable motion blob marking in output
`mark_motion_Y/U/V` | 255/0/200 | Blob marker color (pink)
`making_movie_Y/U/V` | 0/128/255 | Recording indicator color

## Debug

Setting | Default | Description
--- | --- | ---
`debug_motion` | 0 | Print motion detection diagnostics
`debug_distance` | 0 | Print distance calculation diagnostics
`debug_build` | 0 | Print frame builder diagnostics
`play4_show_frame_rate` | 0 | Show frame rate in viewer title bar

## See Also

- Grid Line Calibration
- Motion Detection Tuning
- Quick Start Guide