标签:ffmepg ffmpeg capture tps es2017 读取 flip 无效 下载地址
报错。
我的视频和文件在同一目录下.
#coding=utf-8 import numpy as np import cv2 cap = cv2.VideoCapture(‘man.avi‘) while(cap.isOpened()): # 从摄像头读取一帧,ret是表明成功与否 ret, frame = cap.read() if ret: #处理得到的帧,这里将其翻转 frame = cv2.flip(frame,0) cv2.imshow(‘frame‘,frame) else: break # 监听键盘,按下q键退出 if cv2.waitKey(25) & 0xFF == ord(‘q‘): break ##释放 cap.release() cv2.destroyAllWindows()
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow, file C:\build\master_winpack-bindings-win32-vc14-static\opencv\modules\highgui\src\window.cpp, line 325 Traceback (most recent call last): File "C:/PycharmProjects11/day5 ????/2 MOG2????????.py", line 18, in <module> cv2.imshow(‘frame‘,fgmask) cv2.error: C:\build\master_winpack-bindings-win32-vc14-static\opencv\modules\highgui\src\window.cpp:325: error: (-215) size.width>0 && size.height>0 in function cv::imshow
#-*- coding:utf-8 -*- import cv2 import numpy as np from matplotlib import pyplot as plt #1.读入avi对象 cap = cv2.VideoCapture(‘C:\\PycharmProjects11\\video\\people.avi‘) #2.视频有多少秒 fps = cap.get(cv2.CAP_PROP_FPS) print fps #3.视频的width,height size = (int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))) print size
显示根本没有读取进来视频
无效
参考博客:http://blog.csdn.net/djcxym/article/details/52177220
解决方案:(亲测可行),
搜索文件用Everything(推荐),下载地址:https://www.so.com/s?ie=utf-8&src=360se7_addr&q=Everything
标签:ffmepg ffmpeg capture tps es2017 读取 flip 无效 下载地址
原文地址:http://www.cnblogs.com/venicid/p/7834637.html