fix: support videos with no audio or no faces

1. trace_done now checks for 'no_faces' status in face_traced.json
   - Videos with no detected faces now complete correctly
   - Previously stuck because trace_count=0 returned false

2. ASRX fallback to ASR segments includes start_frame/end_frame
   - Added _convert_asr_segments_to_asrx helper function
   - TKG can now process fallback segments correctly

This allows processing of:
- Videos with no audio track (ASR: no_audio_track)
- Videos with no faces (face_traced.json: no_faces)
This commit is contained in:
Accusys
2026-07-06 15:54:14 +08:00
parent 27660f48e4
commit dd63dbff9b
2 changed files with 47 additions and 2 deletions

View File

@@ -1201,6 +1201,17 @@ impl JobWorker {
if std::path::Path::new(&traced_path).exists() {
if let Ok(content) = std::fs::read_to_string(&traced_path) {
if let Ok(traced_data) = serde_json::from_str::<serde_json::Value>(&content) {
// Check if status is no_faces (valid completion with no faces)
if let Some(status) = traced_data.get("status").and_then(|s| s.as_str()) {
if status == "no_faces" {
tracing::info!(
"[Ingestion] No faces detected for {} - trace_done=true",
uuid
);
return true;
}
}
if let Some(traces) = traced_data.get("traces") {
// traces can be an object (dictionary) or array
let trace_count = if traces.is_object() {