feat: ASR output frame numbers + rename start/end to start_time/end_time
- Python: asr_processor.py detects FPS from CUT/ffprobe (no fallback), outputs start_frame/end_frame - Rust: All AsrSegment structs use start_time/end_time with #[serde(alias)] for backward compat - store_asr_chunks: prefers ASR output frames, falls back to time-based conversion - Added backward compatibility test for old JSON format (start/end) Breaking change: ffprobe/CUT FPS failure now aborts instead of using default 24fps
This commit is contained in:
@@ -4,8 +4,10 @@ use std::path::PathBuf;
|
||||
#[derive(Debug, Clone, serde::Deserialize)]
|
||||
#[allow(dead_code)]
|
||||
pub struct AsrSegment {
|
||||
pub start: f64,
|
||||
pub end: f64,
|
||||
#[serde(alias = "start")]
|
||||
pub start_time: f64,
|
||||
#[serde(alias = "end")]
|
||||
pub end_time: f64,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
@@ -103,7 +105,7 @@ impl AsrOverlay {
|
||||
self.current_text = String::new();
|
||||
|
||||
for segment in &self.segments {
|
||||
if current_time >= segment.start && current_time <= segment.end {
|
||||
if current_time >= segment.start_time && current_time <= segment.end_time {
|
||||
self.current_text = segment.text.clone();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user