python - 保存视频的功能(OpenCV python)
问题描述
有谁知道在openCV中保存视频的任何功能。
最好是能够使用它的功能。
我试图实施,但我不能
解决方案
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()
推荐阅读
- css - PurgeCSS 和 Markdown 输出,如何将元素选择器列入白名单?
- css - Media Query overriding other media query when it shouldn't be
- javascript - 反应:不可能呈现获取状态的地图
- php - String to Int 应抛出而不是返回 0
- mongodb - MongoDB查询从嵌套数组中过滤子文档
- c - 为什么编译器认为 GCC 中嵌套函数(GNU 扩展)的地址“不是常量”?
- javascript - How to get an interface's properties from typescript
- apache - 如果文件夹存在,mod_rewrite 会尝试重定向
- windows - webrtc: how to simulate slow connections?
- forms - Symfony Form never returns a value