I am using OpenCV to display a video my code is as
#include
#include
#include
#include
After having the same issue, I added one more header, opencv/ml.h
, which is for machine learning. With this header and the Path variable C:\opencv\sources\3rdparty\ffmpeg\
your code works on my machine.
I had the same problem. Very annoying (opencv 2.4.9). But what worked for me was passing the absolute file name (avi or mpeg), i.e whole path.
E.g.:
char* fileName = "D:/myVideos/video.avi"
...
VideoCapture capture(fileName );
I had the same problem, and I did two things (I'm using Python 2.7.9 on Windows 10):
First, add this folder to your Path variable:
C:\opencv\sources\3rdparty\ffmpeg\
And this file opencv_ffmpeg300.dll
must have the correct OpenCV version. For example, for me it's 3.0.0, so you need to change it for yourself.
Next, make sure to add an extra backslash slash in your video path:
video_capture = cv2.VideoCapture ('C:\Temp\\bouncingBall.avi')
Python has some special characters, so if there's only one backslash, it would interpret it differently and thus throw an error. You can see more here:
https://docs.python.org/2.0/ref/strings.html
Hence the double backslash.
Anyway, hope this helps!
If using absolute path, add double slash to path as below.
data = cv2.VideoCapture('C:\Data\MyVideo.mp4')
data.isOpened()
Out[11]: False
data = cv2.VideoCapture('C:\\\Data\\\MyVideo.mp4')
data.isOpened()
Out[13]: True
I'm facing the same issue, but the problem is I used the wrong resolution.
change
rtsp://admin:admin@192.168.1.58:554/h264/video.sdp?camera=13
to default solved it. (without indicating the resolution parameter)
rtsp://admin:admin@192.168.1.58:554/h264/video.sdp
BTW Device: EVO-05 Mini
to clear up some confusion here:
the error means, that it could not find or open your Video file. (either file not found, or codec not present)
"/home/vaibhav/opencv/modules/highgui/src/cap_ffmpeg_impl.hpp:553" is just the location of the code, where the error is thrown.
(and please, don't use the deprecated c-api any longer, they stopped developing it like 5 years ago, switch over to the c++ one. )