Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Videocapture *mov`s seems to time out in virtualbox

I get a strange behavior with Videocapture when I run code inside a Virtualbox client (Client: Ubuntu 15.10 x64) (confirmed with following host systems: Windows & Arch Linux). When the Videocapture object opens a video file everything is fine but when the system idles for too long (e.g. waiting for keyboard input) ~30 seconds the video capture returns an empty list and not the next frame of the video file (VideoCapture::grab returns false). This only seem to happen with *.mov files like the one attached (http://80.86.85.151:91/small.mov). Is this a problem in OpenCV or might something else be the cause?

#include <cv.h>
#include <highgui.h>
#include <opencv2/core/core.hpp> 
#include <opencv2/videoio/videoio.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <string>
#include <iostream>

using namespace cv;
using namespace std;

int main(){

const string ref = "/home/biotracker/Downloads/MVI_7555.MOV";

cv::VideoCapture capt(ref); 
Mat im;
capt >> im;

for (int i = 0; i < 10; i++) {
    cout << "im empty: " << im.empty() << endl;     
    imshow("qq", im);
    char c = waitKey(60000);
    cout << "time is over, nextframe" << endl;
    capt >> im;
}


return 0;
}