bim
bim

Reputation: 839

How to read .mp4 files in opencv

I am totally newbie in OpenCV, C++. Trying to read an mp4 video but found OpenCV does not support mp4, it only reads avi(I am not sure whether I am write or wrong). After an online research came to know ffmpeg is the best option to convert mp4 to avi for further processing.

I am using OpenCV 3.0 with visual studio 2012. I saw there is a dll file, opencv_ffmpeg300.dll in OpenCV C:\opencv\build\x86\vc11\bin folder. Is there any way I can use this dll file to read and convert my video?

It will be really appreciating if someone can provide me some guidelines, I am lost in the OpenCV world totally.

For video,

Video I/O:
   Video for Windows:           YES
   DC1394 1.x:                  NO
   DC1394 2.x:                  NO
   FFMPEG:                      YES (prebuilt binaries)
     codec:                     YES (ver 55.18.102)
     format:                    YES (ver 55.12.100)
     util:                      YES (ver 52.38.100)
     swscale:                   YES (ver 2.3.100)
     resample:                  NO
     gentoo-style:              YES
   OpenNI:                      NO
   OpenNI PrimeSensor Modules:  NO
   OpenNI2:                     NO
   PvAPI:                       NO
   GigEVisionSDK:               NO
   DirectShow:                  YES
   Media Foundation:            NO
   XIMEA:                       NO
   Intel PerC:                  NO

Upvotes: 0

Views: 6616

Answers (1)

sturkmen
sturkmen

Reputation: 3550

let me try to help to solve your problem.

first, i advise you to check your build information with the code below

#include "opencv2/highgui.hpp"
#include <iostream>

using namespace cv;

int main(int argc, char** argv)
{
    std::cout <<
         "Using OpenCV version " << CV_VERSION << "\n" << std::endl;

    std::cout << getBuildInformation();

    return 0;
}

i have like below and read mp4 files

  Video I/O:
    Video for Windows:           YES
    DC1394 1.x:                  NO
    DC1394 2.x:                  NO
    FFMPEG:                      YES (prebuilt binaries)
      codec:                     YES (ver 56.41.100)
      format:                    YES (ver 56.36.101)
      util:                      YES (ver 54.27.100)
      swscale:                   YES (ver 3.1.101)
      resample:                  NO
      gentoo-style:              YES
    GStreamer:                   NO
    OpenNI:                      NO
    OpenNI PrimeSensor Modules:  NO
    OpenNI2:                     NO
    PvAPI:                       NO
    GigEVisionSDK:               NO
    DirectShow:                  YES
    Media Foundation:            NO
    XIMEA:                       NO
    Intel PerC:                  NO

Upvotes: 2

Related Questions