MCPcopy Create free account
hub / github.com/drinkingcoder/NeuralMarker / read_video

Function read_video

demo_video.py:20–33  ·  view source on GitHub ↗
(video_path)

Source from the content-addressed store, hash-verified

18from config import get_demo_video_args, get_life_args
19
20def read_video(video_path):
21 cap = cv2.VideoCapture(video_path)
22 imgs = []
23 plt.figure()
24 while(cap.isOpened()):
25 ret, frame = cap.read()
26 if ret == True:
27 imgs.append(frame)
28 else:
29 break
30 fps = cap.get(cv2.CAP_PROP_FPS)
31 cap.release()
32 print(f"Load {len(imgs)} frames")
33 return imgs, fps
34
35def save_video(imgs, size, video_path, fps=30):
36 fourcc = cv2.VideoWriter_fourcc(*'XVID')

Callers 1

demoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected