Appearance
Command-line guide
Run commands with the same CameraObscura.exe that opens the desktop app. Launch it without arguments to open the app, or pass one .obscura path to open that project. The CLI writes JSON to stdout and reports errors on stderr with a nonzero exit code. --help prints text. In PowerShell, pipe the results so the shell waits for the Windows executable and captures the output.
Create and export a clip project
Run from the repository root after building the app. Substitute the path to your own file.
powershell
$camera = '.\zig-out\bin\CameraObscura.exe'
$project = 'Boss showcase.obscura'
& $camera --help | Out-String
& $camera project init $project | ConvertFrom-Json
& $camera clip add $project 'Boss clip.mp4' --name 'Second phase' | ConvertFrom-Json
$added = & $camera output add $project --preset youtube-shorts --framing crop | ConvertFrom-Json
$output = $added.selected_output
& $camera clip trim $project 1 $output --start 1.25 --end 6.5 | ConvertFrom-Json
& $camera output check $project --output $output | ConvertFrom-Json
& $camera export $project --output $output | ConvertFrom-JsonClip, lane, and placement numbers start at 1. Beat and output IDs are stable. Use clip list, beat list, output list, and presets to look up values. export uses the selected clip and all outputs unless you select a beat, clip, or specific output.
Record a promo beat from PowerShell
Set $camera as above. Create a new project and beat, then inspect windows for the decimal hwnd and pid of the game window.
powershell
$project = 'Promo beat.obscura'
& $camera project init $project | ConvertFrom-Json
$beat = (& $camera beat create $project 'Boss promo' | ConvertFrom-Json).id
& $camera windows | ConvertFrom-Json
# Substitute the handle and process ID from windows.
& $camera record $project --beat $beat --hwnd 12345 --pid 678 --seconds 8 --name 'Boss phase' | ConvertFrom-Json
& $camera clip add $project 'Logo.png' --beat $beat --copy | ConvertFrom-Json
& $camera clip add $project 'Boss music.wav' --beat $beat --copy | ConvertFrom-Json
& $camera output promo-pack $project | ConvertFrom-Json
& $camera beat show $project $beat | ConvertFrom-JsonThe first visual source auto-places on an empty beat. Later sources are available for you to place using timeline JSON. With recording, --lane and --at let you place the take directly. Use --no-place with clip add to import a source to the bin while keeping the timeline as it is. --copy creates a managed copy.
Window capture needs an interactive Windows desktop and a visible window. Without --hwnd, capture uses the focused window after the optional --delay. Pass --compatibility-capture for GDI, --desktop-audio for the default playback device, or --no-audio for video only. The result’s audio field indicates whether sound was saved. A fresh --stop-file path can act as a stop signal when created by another process.
record saves the take up to the time limit or early stop. replay saves one snapshot of up to the last 30 seconds at the end of a run. Omit PROJECT for a draft outside a project. For narration, use record-mic PROJECT --beat ID --seconds N --lane 1 --at 0 to save a WAV directly onto the audio track.
Edit and verify a project from a script or AI agent
Close the project in the desktop app while the CLI writes it. Read the latest snapshot, make a targeted change, validate it, and apply it with the snapshot revision.
powershell
$snapshot = & $camera beat show $project $beat | ConvertFrom-Json
$snapshot.timeline.video_track_names[0] = 'Gameplay'
$json = $snapshot.timeline | ConvertTo-Json -Depth 30
$json | & $camera beat validate $project $beat - | ConvertFrom-Json
$json | & $camera beat apply $project $beat - --if-revision $snapshot.revision | ConvertFrom-Json- reads JSON from stdin. You can also pass a JSON file path. If the revision has changed, the CLI returns ProjectChanged. Retrieve a fresh snapshot and reapply the intended edit. Validation leaves the saved file intact.
Use project show to read the entire project. Edit its document property for changes across beats or to project-wide settings. Use project validate and project apply for this document. Save a copy of the original document if you may want to restore it later. See the format guide for how numbering differs between the two JSON formats.
Reopen the .obscura file in the app to inspect your edits, or use beat frame to render a frame. To export a beat, specify its ID.
powershell
& $camera output list $project --beat $beat | ConvertFrom-Json
& $camera beat frame $project $beat 1 'preview.png' --at 0.5 | ConvertFrom-Json
& $camera export $project --beat $beat | ConvertFrom-JsonSee the CLI reference for capture, managed media deletion, output trimming, and replacement options.