MCPcopy Create free account
hub / github.com/MatrixTeam-AI/RAIN / save_video

Function save_video

pipeline_example.py:141–151  ·  view source on GitHub ↗
( imgs, vid_file_name, fps=24)

Source from the content-addressed store, hash-verified

139
140
141def save_video( imgs, vid_file_name, fps=24):
142 video_codec = cv2.VideoWriter_fourcc(*"mp4v")
143 segment_file = cv2.VideoWriter(vid_file_name, video_codec, fps, (imgs[0].shape[1], imgs[0].shape[0]))
144 if(imgs[0].dtype == np.uint8):
145 for f in imgs:
146 segment_file.write(f[:,:,::-1])
147 else:
148 for f in imgs:
149 segment_file.write(np.uint8(255*f)[:,:,::-1])
150
151 segment_file.release()
152
153#### generation
154

Callers 1

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected