feat: measure footage across segments and test X11 capture

Matroska output can stay buffered until a segment closes, so progress counts
bytes across all segments and the stall limit scales with segment length.
Unknown capture source types now fail instead of recording an empty
placeholder. The rig gains an Xwayland mode for Xcomposite window capture.
This commit is contained in:
2026-10-08 14:25:23 +02:00
parent 263e7a964e
commit 444758f9ec
4 changed files with 142 additions and 75 deletions
+7 -3
View File
@@ -318,7 +318,11 @@ fn record(options: &Options) -> Result<bool, Box<dyn std::error::Error>> {
let started = Instant::now();
let elapsed = || format!("{:.3}", started.elapsed().as_secs_f64());
let recording = engine.start_recording(config)?;
let mut tracker = StatusTracker::new(started, options.min_free_mb * 1_000_000);
let mut tracker = StatusTracker::new(
started,
options.min_free_mb * 1_000_000,
Duration::from_secs(options.segment_seconds as u64),
);
let mut status = RecordingStatus::Starting;
println!("t={} status={}", elapsed(), status.label());
@@ -332,7 +336,7 @@ fn record(options: &Options) -> Result<bool, Box<dyn std::error::Error>> {
next_sample += Duration::from_secs(1);
let health = recording.health();
println!(
"t={} health source={}x{} streaming={:?} active={} frames={} dropped={} lagged={} muxer_bytes={} segment_bytes={}",
"t={} health source={}x{} streaming={:?} active={} frames={} dropped={} lagged={} muxer_bytes={} disk_bytes={}",
elapsed(),
health.source_width,
health.source_height,
@@ -342,7 +346,7 @@ fn record(options: &Options) -> Result<bool, Box<dyn std::error::Error>> {
health.dropped_frames,
health.lagged_frames,
health.total_bytes,
health.current_segment_bytes
health.written_bytes
);
report_status(&mut status, tracker.sample(&health, now), &elapsed());
}