Open deep0learning opened 5 years ago
you can check VideoWriter:
from cv2 import VideoWriter, VideoWriter_fourcc
Initialize video
w, h, fps = (1280, 720, 30)
fourcc = VideoWriter_fourcc(*'H264')
self.video = VideoWriter('./test_video.mp4', fourcc, fps, (w, h))
you can save frame to frame where image_np is an numpy image of shape (h, w, 3)
video.write(image_np)
and then release
video.release()
you can check VideoWriter:
from cv2 import VideoWriter, VideoWriter_fourcc
Initialize video
w, h, fps = (1280, 720, 30) fourcc = VideoWriter_fourcc(*'H264') self.video = VideoWriter('./test_video.mp4', fourcc, fps, (w, h))
you can save frame to frame where image_np is an numpy image of shape (h, w, 3)
video.write(image_np)
and then release
video.release()
Where do I put this code?
Hi,
How can I save the detected video? Thanks in advance.