OpenCV中cv2.VideoWriter_fourcc()函数和cv2.VideoWriter()函数的结合使用
一、VideoWriter_fourcc()常见的编码参数参数列表cv2.VideoWriter_fourcc('M', 'P', '4', 'V')MPEG-4编码 .mp4可指定结果视频的大小cv2.VideoWriter_fourcc('X','2','6','4')MPEG-4编码.mp4 可指定结果视频的大小cv2.VideoWriter_fourcc('I', '4',
·
一、VideoWriter_fourcc()常见的编码参数
| |
| |
| |
| |
| |
| |
| |
二、使用案例
import cv2
vid = cv2.VideoCapture('./ship.mp4')
video_frame_cnt = int(vid.get(7))
video_width = int(vid.get(3))
video_height = int(vid.get(4))
video_fps = int(vid.get(5))
f = cv2.VideoWriter_fourcc('M', 'P', '4', 'V')#VideoWriter_fourcc为视频编解码器
videoWriter = cv2.VideoWriter('./result.mp4', f, video_fps, (video_width, video_height))
更多推荐
已为社区贡献2条内容
所有评论(0)