首页 > 解决方案 > 保存视频的功能(OpenCV python)

问题描述

有谁知道在openCV中保存视频的任何功能。

最好是能够使用它的功能。

我试图实施,但我不能

标签: pythonopencv

解决方案


OpenCV 有您可以使用的 VideoWriter API。请参见下面的示例代码:

##define the video writer
out = cv2.VideoWriter(<filename_with_extention>,<compression_format>, <frames_per_second>, (frame_width,frame_height)) 

## write a frame in the loop
out.write(<your_frame>)

## Release the video writer outside of the scope of the loop 
out.release()

推荐阅读