Add ffmpeg/x11grab-based video capture (libx264rgb, qp=0, true lossless RGB) and an evdev-based keyboard state logger, orchestrated by a single frame-tick loop so each JSONL input row lines up 1:1 with its video frame. Unit-tested with fake keyboard/video components (no real device or ffmpeg needed); real hardware capture still needs validation on the recording PC. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
18 lines
546 B
Python
18 lines
546 B
Python
from pathlib import Path
|
|
|
|
from spelunkai_recording.capture import CaptureConfig, VideoCapture
|
|
|
|
|
|
def test_build_command_includes_resolution_offset_and_output_path():
|
|
config = CaptureConfig(display=":1", width=800, height=600, offset_x=10, offset_y=20, fps=25)
|
|
capture = VideoCapture(config, Path("/tmp/out.mp4"))
|
|
|
|
cmd = capture.build_command()
|
|
|
|
assert "800x600" in cmd
|
|
assert ":1+10,20" in cmd
|
|
assert "25" in cmd
|
|
assert cmd[-1] == "/tmp/out.mp4"
|
|
assert "libx264rgb" in cmd
|
|
assert "0" in cmd # -qp 0 (lossless)
|