5

I'm trying to compare 3 videos that are encoded by H.264, H.265, and VP9. All of them are made by a same YUV video.

I want to use OpenCV's function to read each frame of the video and do some comparison:

VideoCapture vCap1, vCap2, vCap3;
vCap1.open("h264.mp4");
vCap2.open("h265.mp4");
vCap3.open("vp9.webm");
Mat frame1, frame2, frame3;

while (vCap1.read(frame1) && vCap2.read(frame2) && vCap3.read(frame3))
{
    //do something
}

The vCap1 opened successfully, but vCap2 and vCap3 won't open. Did I miss something to include to make it work?

Or OpenCV even not support the other 2 formats?

Dia
  • 851
  • 1
  • 15
  • 35

1 Answers1

4

After using google :-) I found that http://answers.opencv.org/question/10741/videocapture-format-supported-by-opencv/

Especially you have the needed codecs installed on your system. You can visit also http://www.fourcc.org/codecs.php

for codecs.

The documentation from OpenCV is indeed not very helpful. :-)

What I would try if you are running under linux:

strace -xfo dump

and take a look in the system calls. Maybe you can find some hints of missing codec files, used configuration files and or other failed system function calls. If so, you have a startpoint.

Klaus
  • 24,205
  • 7
  • 58
  • 113