Open JayThibs opened 7 years ago
Can you check that your video is not corrupt etc. That error comes from OpenCv not being able to open the file.
For further troubleshooting you could always try and load the video into OpenCV yourself in a test file to make sure that it works. That should give you some more error information too.
@jubjamie Thanks for replying. I ran the exact same video with darknet + openCV and it worked fine!
I'm currently reinstalling openCV to see if it could solve the issue.
Hmm that's odd. Did you get any further with this? If not I can give you some test code to run the video through.
I am assuming that u have installed opencv with the pip install command.This version of opencv is unrecommended as it doesnt provide functions like cv2.imshow(),responsible for captioning feed from webcam or a video.Try find some tutorials on installing opencv from source.
Hi, I've also ran into the same problem. I'm using Anaconda (conda 4.3.40) in Ubuntu 16.04, and installed OpenCV 3.1.0 via conda (channel = menpo).
After reading @EmmanouelP 's comment, I used the following sample code to test my OpenCV to load the test video:
import cv2
cap = cv2.VideoCapture('test.avi') #use this to load test video
#cap = cv2.VideoCapture(0) #use this to get frames from webcam
while(cap.isOpened()):
ret, frame = cap.read()
cv2.imshow('frame', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
It can show frames from my webcam, but do nothing when I fed it the test video.
Then I searched and found the link as follows. It might provide some workaround or solutions: OpenCV video capture from file fails on Linux #121
In short, you may reinstall OpenCV from source, or try using scikit-video
as a workaround.
(and I myself have not tried any of them yet...)
i solve this issue, ref this url : https://github.com/ContinuumIO/anaconda-issues/issues/121 pip uninstall opencv-python conda remove opencv conda install -c anaconda opencv
the root cause is opencv-python for linux before 3.3.1 not built with FFMpeg, the newest conda opencv3.3.1 fix this.
I'm working on Ubuntu 14.04. I can run darknet with openCV, but I'm having problems with darkflow. It works with:
./flow --imgdir sample_img/ --model cfg/yolo.cfg --load bin/yolo.weights --gpu 0.95
But if I run:
./flow --model cfg/yolo.cfg --load bin/yolo.weights --demo uberarizona.avi --gpu 0.95
or
./flow --model cfg/yolo.cfg --load bin/yolo.weights --demo preview.png --gpu 0.95
I get the following message:
I've downloaded ffmpeg, tried the whole path to the file, and with quotes and no quotes. If I remove the video file from the darkflow folder, it says:
Anybody have any ideas on what I should try next?