Ask Your Question

Revision history [back]

Videocapture problem on Linux

I am trying to write a program that just reads and displays videos. The code runs fine on Windows but not on Linux. My Linux environment is Centos (and Red Hat on a different machine), both 64-bit versions. I have built OpenCV 2.4.9, and made sure that FFMPEG is enabled. In fact, I built FFMPEG from tarball on the Red Hat machine and the install put the libav* files in /usr/local/lib. I have tried to step through the code and it says that when I create the VideoCapture object, the object is invalid. I am completely baffled and will appreciate any ideas on what could be wrong.

On the same machine (and in the same code), I have been able to read a still JPEG image and display it without any issue.

click to hide/show revision 2
Added small code to show the problem.

Videocapture problem on Linux

I am trying to write a program that just reads and displays videos. The code runs fine on Windows but not on Linux. My Linux environment is Centos (and Red Hat on a different machine), both 64-bit versions. I have built OpenCV 2.4.9, and made sure that FFMPEG is enabled. In fact, I built FFMPEG from tarball on the Red Hat machine and the install put the libav* files in /usr/local/lib. I have tried to step through the code and it says that when I create the VideoCapture object, the object is invalid. I am completely baffled and will appreciate any ideas on what could be wrong.

On the same machine (and in the same code), I have been able to read a still JPEG image and display it without any issue.

Here is some more information.

(gdb) n
22              video.open ( VIDEO );
(gdb) p video
$1 = <incomplete type>
(gdb)

Notice that I am trying to print the contents of video just before it has opened a video file. At this point, the only statement executed is cv::VideoCapture video;. So, it looks like the system does not like the declaration for some reason.