# VideoDistanceMarking — Sample Settings
# Copy this file to settings.txt and adjust for your hill.
#
# Format: key=value (one per line)
#   @ prefix = XY coordinate (value: x,y)
#   * prefix = string value
#   % suffix = float/percentage value
#   otherwise = integer value

# --- UI / Display ---
frame_position_bar_height=10
mouse_position_speed=5.000000
big_window_height=540
big_window_width=1920
only_one_viewer=0
show_jumper_numbers=1
show_speed=1
show_name=1
movie_pad=30
meters_from_takeoff_to_visible=50
last_visible_meter_line=145

min_feed=0
show_lines_mode=1
showing_motion=0
draw_circle_around_blobs=0
font_size=24
font_window_width=320
font_window_height=120

# --- Video / Movie ---
min_type1_frames=60
min_type2_frames=60

# --- Motion Marker Colors (YUV) ---
mark_motion=1
mark_motion_Y=255
mark_motion_U=0
mark_motion_V=200

making_movie_Y=0
making_movie_U=128
making_movie_V=255

# --- Motion Detection Thresholds ---
# Percentage thresholds (how much of the frame can differ)
max_diff_y%=0.500000
max_diff_u%=0.500000
max_diff_v%=0.500000

max_diff_y_quick%=2.000000
max_diff_u_quick%=2.000000
max_diff_v_quick%=2.000000

min_diff_y%=0.010000
min_diff_u%=0.010000
min_diff_v%=0.010000

# Absolute thresholds
max_diff_y=10000
max_diff_u=10000
max_diff_v=10000

max_diff_y_quick=50000
max_diff_u_quick=50000
max_diff_v_quick=50000

min_diff_y=100
min_diff_u=100
min_diff_v=100

min_quick_size=200

# --- Motion / Movie Logic ---
min_frames=60
max_frames=520
debug_motion=0
debug_distance=0
debug_build=0
# debug_frame_log: 1 = Preview tab writes per-tick frame_log.csv; 0 = off (default)
debug_frame_log=0
play4_show_frame_rate=0
min_blob_neighbors=2

min_motion_count[0]=3
min_motion_count[1]=3
min_motion_count[2]=3
min_nomotion_count[0]=10
min_nomotion_count[1]=10
min_nomotion_count[2]=10

distance_look_back_n_frames=5

# --- Blob Detection ---
overlay_frame_offsets[0]=0
overlay_frame_offsets[1]=0
overlay_frame_offsets[2]=0
max_blob_size=50000
max_blob_count=50
min_blob_keep=20

min_blob_sizes[0]=30
min_blob_sizes[1]=30
min_blob_sizes[2]=30
min_blob_sizes[3]=30
min_blob_distance[0]=2
min_blob_distance[1]=2
min_blob_distance[2]=2
min_blob_distance[3]=2
max_blob_distance[0]=200
max_blob_distance[1]=200
max_blob_distance[2]=200
max_blob_distance[3]=200
erase_shadows=0

ydiff_max=255
udiff_max=255
vdiff_max=255
ydiff_min[0]=10
ydiff_min[1]=10
ydiff_min[2]=10
ydiff_min[3]=10
udiff_min[0]=10
udiff_min[1]=10
udiff_min[2]=10
udiff_min[3]=10
vdiff_min[0]=10
vdiff_min[1]=10
vdiff_min[2]=10
vdiff_min[3]=10

blob_fuzz_x=30
blob_fuzz_y=30

# --- Motion Regions (per feed) ---
# Define the rectangle in each camera where motion is detected.
# Set to full frame by default; narrow to exclude trees, buildings, etc.
motion_start_x[0]=0
motion_start_y[0]=0
motion_end_x[0]=1920
motion_end_y[0]=1080

motion_start_x[1]=0
motion_start_y[1]=0
motion_end_x[1]=1920
motion_end_y[1]=1080

motion_start_x[2]=0
motion_start_y[2]=0
motion_end_x[2]=1920
motion_end_y[2]=1080

feed_motion_on[0]=1
feed_motion_on[1]=1
feed_motion_on[2]=1

# --- Grid Lines (distance measurement) ---
# Each feed has its own set of meter lines defined by anchor points.
# meter_line_count = how many lines, start = first meter mark,
# increment = meters between lines (usually 1).
meter_line_count[0]=20
meter_line_start[0]=80
meter_line_increment[0]=1
meter_line_radius[0]=1

meter_line_count[1]=20
meter_line_start[1]=100
meter_line_increment[1]=1
meter_line_radius[1]=1

meter_line_count[2]=20
meter_line_start[2]=120
meter_line_increment[2]=1
meter_line_radius[2]=1

# --- Grid Line Colors (YUV) ---
meter_line_Y=200
meter_line_U=128
meter_line_V=128

meter1_line_Y=255
meter1_line_U=128
meter1_line_V=128

meterD_line_Y=128
meterD_line_U=200
meterD_line_V=128

# --- Grid Line Anchor Points ---
# Far = top of hill (vanishing point), Near = bottom (camera side).
# Format: @far[feed][line]=x,y  @near[feed][line]=x,y
# These must be calibrated for your specific camera positions.
# Example for feed 0, lines 0-2:
# @far[0][ 0]=960,100
# @near[0][ 0]=960,900
# @far[0][ 1]=980,100
# @near[0][ 1]=980,900

# --- Feed Offsets ---
# Frame offset to align feeds captured at different USB hub positions.
# Positive = delay this feed by N frames.
feed_offset[0]=0
feed_offset[1]=0
feed_offset[2]=0

default_view_frame_offset_from_end=30

# --- Upload / Archive (req #69, MAS todo #14) ---
# archive_dir: where videogen writes encoded jump_*.mp4 files (relative
#              to videogen.exe's cwd, or absolute).  Created on startup
#              if it doesn't exist.
# upload_host / upload_path / upload_signal_url: passed to
#              upload_video.bat as env vars VDM_UPLOAD_HOST /
#              VDM_UPLOAD_PATH / VDM_SIGNAL_URL.  Default values mirror
#              the legacy LegacyFiles/upload.s convention.
# upload_enabled: 1 = launch upload_video.bat after each encode; 0 =
#                 skip upload (files still archived locally).  Set to 0
#                 for venue-floor testing without internet uplink.
# FTP credentials live in %USERPROFILE%\.netrc - NOT in this file.
# See doc/install/deployment-runbook.html for the .netrc format.
*archive_dir=output_videos
*upload_host=thehansens.com
*upload_path=uploads
*upload_signal_url=http://www.thehansens.com/tournament/signal_next.cgi
upload_enabled=1
