Spaces:
Paused
Paused
Zhen Ye commited on
Commit ·
bbef397
1
Parent(s): 955fa9e
Add granular logging for frame processing and ffmpeg
Browse filesFiles changed (2)
1308 unmodified lines13091310131113121313131417 unmodified lines1332133313341335133613371308 unmodified linesexcept Exception as e:logging.exception("Writer loop failed")finally:writer_finished = Truewriter_thread = Thread(target=writer_loop, daemon=True)17 unmodified linesqueue_in.put((frames_fed, frame)) # Blocks if fullframes_fed += 1# Update total_frames to actual count so writer knows when to stopif frames_fed != total_frames:logging.info("Updating total_frames from %d to %d (actual fed)", total_frames, frames_fed)1308 unmodified lines130913101311131213131314131517 unmodified lines133313341335133613371338133913401308 unmodified linesexcept Exception as e:logging.exception("Writer loop failed")finally:logging.info("Writer loop finished. Wrote %d frames (target %d)", next_idx, total_frames)writer_finished = Truewriter_thread = Thread(target=writer_loop, daemon=True)17 unmodified linesqueue_in.put((frames_fed, frame)) # Blocks if fullframes_fed += 1logging.info("Feeder finished. Fed %d frames (expected %d)", frames_fed, total_frames)# Update total_frames to actual count so writer knows when to stopif frames_fed != total_frames:logging.info("Updating total_frames from %d to %d (actual fed)", total_frames, frames_fed)
49 unmodified lines5051525354555649 unmodified lines]process = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False)if process.returncode != 0:raise RuntimeError(process.stderr.decode("utf-8", errors="ignore"))def write_video(frames: List[np.ndarray], output_path: str, fps: float, width: int, height: int) -> None:49 unmodified lines505152535455565758596049 unmodified lines]process = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False)if process.returncode != 0:err_msg = process.stderr.decode("utf-8", errors="ignore")logging.error("ffmpeg failed with code %d: %s", process.returncode, err_msg)raise RuntimeError(err_msg)else:logging.info("ffmpeg success")def write_video(frames: List[np.ndarray], output_path: str, fps: float, width: int, height: int) -> None:
inference.py+3
utils/video.py+5-1