feat: trace video shows frame number overlay
This commit is contained in:
@@ -310,6 +310,13 @@ async fn trace_video(
|
|||||||
|
|
||||||
// Build filters: bbox+drawtext (1 filter + 1 drawtext per detection)
|
// Build filters: bbox+drawtext (1 filter + 1 drawtext per detection)
|
||||||
let mut parts: Vec<String> = Vec::new();
|
let mut parts: Vec<String> = Vec::new();
|
||||||
|
|
||||||
|
// Global frame number overlay (top-left corner, always visible)
|
||||||
|
let global_frame_text = format!(
|
||||||
|
"drawtext=text='Frame\\: %{{n}}+{}':fontsize=16:fontcolor=white:box=1:boxcolor=black@0.6:x=10:y=10",
|
||||||
|
first_frame as i64 - (padding * fps) as i64
|
||||||
|
);
|
||||||
|
parts.push(global_frame_text);
|
||||||
for (i, (frame, x, y, w, h)) in rows.iter().enumerate() {
|
for (i, (frame, x, y, w, h)) in rows.iter().enumerate() {
|
||||||
let start_off = frame - first_frame + pad_frames;
|
let start_off = frame - first_frame + pad_frames;
|
||||||
// End at next detection, or at the last frame of the video (not beyond)
|
// End at next detection, or at the last frame of the video (not beyond)
|
||||||
|
|||||||
Reference in New Issue
Block a user