如下所示:
1
2
3
4
5
6
7
8
9
|
import cv2 fps = 16 size = (width,height) videowriter = cv2.VideoWriter( "a.avi" ,cv2.VideoWriter_fourcc( 'M' , 'J' , 'P' , 'G' ),fps,size) for i in range ( 1 , 200 ): img = cv2.imread( '%d' .jpg % i) videowriter.write(img) |
以上这篇对Python+opencv将图片生成视频的实例详解就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持服务器之家。
原文链接:https://blog.csdn.net/qq_37124237/article/details/80913466