15:36
I am writing a machine learning football analysis system, and I want to store the result video as seen in the code block. I can see the video normally under Windows' media player, but in VSCode and Streamlit, I can't open/show the video.
Edit: On Mac, it works perfectly well.
def save_video(frames: List[np.ndarray], path: str, fps: int=24) -> None:
fourcc = cv2.VideoWriter_fourcc(*"avc1") # codec for compressing the video
out = cv2.VideoWriter(filename=path, fourcc=fourcc, fps=fps, frameSize=(frames[0].shape[1], frames[0].shape[0]))
for frame in (...)