feat: round output JSON floats to 2dp + unify ensure_ascii for asr/asrx

This commit is contained in:
Accusys
2026-08-16 06:38:39 +08:00
parent 39e9ce4c3b
commit 5e6a7b7d51
18 changed files with 249 additions and 45 deletions
+6 -6
View File
@@ -205,8 +205,8 @@ def rebuild_scenes(
"scene_number": len(scenes) + 1,
"start_frame": prev_frame,
"end_frame": end_frame - 1,
"start_time": prev_time,
"end_time": t - (1.0 / fps) if fps > 0 else t,
"start_time": round(prev_time, 2),
"end_time": round(t - (1.0 / fps) if fps > 0 else t, 2),
}
)
prev_time = t
@@ -220,8 +220,8 @@ def rebuild_scenes(
"scene_number": len(scenes) + 1,
"start_frame": prev_frame,
"end_frame": last_frame - 1,
"start_time": prev_time,
"end_time": duration,
"start_time": round(prev_time, 2),
"end_time": round(duration, 2),
}
)
@@ -265,7 +265,7 @@ def process_cut(video_path: str, output_path: str, uuid: str = ""):
"start_frame": 0,
"end_frame": total_frames - 1,
"start_time": 0.0,
"end_time": duration,
"end_time": round(duration, 2),
}
]
if publisher:
@@ -275,7 +275,7 @@ def process_cut(video_path: str, output_path: str, uuid: str = ""):
result = {
"frame_count": total_frames,
"fps": fps,
"fps": round(fps, 2),
"scenes": scenes,
}