Question

I'm currently using OpenCV 2.4.6 with gcc 4.7.3 on Lubuntu x64. To view the AVI I use gnome-mplayer 1.0.8 (installed with Lubuntu). All the kit is running on a VM in VirtualBox.

I use the common code suite to grab images then add them to the VideoWriter. In a (second) thread, I do this:

cv::Mat lImg;
cv::VideoCapture lVidCap( 0 );
cv::VideoWriter lVidWrt( lFileName, CV_FOURCC( 'M', 'J', 'P', 'G' ), 15, cv::Size( 640, 480 ) );

while ( true )
{
    // Here check if we must quite the loop.

    lVidCap.read( lImg );
    lVidWrt.write( lImg );
}

// This is not required according to the doc...
lVidWrt.release();
  1. It works correctly sometimes.

  2. On other times, I have to wait for many seconds before the file is valid (despite it is indicated that it takes many Mb, in gnome-mplayer it is written 0k).

Why is the file not always available as soon as the VideoWriter is destroyed?

If you have any suggestion, I would like to read it! ;-) Thanks!

Was it helpful?

Solution

See OpenCV questions for a longer answer. The problem resides probably in the way VirtualBox synchronizes its virtual disks...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top