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:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user