Ask Your Question

mnogono's profile - activity

2020-06-22 20:07:11 -0600 received badge  Notable Question (source)
2019-05-30 18:33:09 -0600 received badge  Popular Question (source)
2018-07-24 00:44:15 -0600 received badge  Enthusiast
2016-08-11 10:53:09 -0600 commented question OpenCV 3.1 VideoCapture ffmpeg

So for myself I change original source code of opencv, and recompile opencv project. I just swap code blocks as follow

bool VideoCapture::open(const String& filename, int apiPreference)
{
    cap.reset(cvCreateFileCaptureWithPreference(filename.c_str(), apiPreference));
    if (isOpened()) {
        return true;
    }

    if (isOpened()) release();
    icap = IVideoCapture_create(filename);
    return !icap.empty();
}
2016-08-11 09:47:15 -0600 commented answer Explicitly set ffmpeg to open video

No, here I just provide more information about topic

2016-08-11 00:19:18 -0600 asked a question OpenCV 3.1 VideoCapture ffmpeg

Hello every one. I'm using opencv 3.1

how can I using ffmpeg explicity?

std::string filename = "1440x1072.avi";
capture.open(filename, CAP_FFMPEG);

does not work...

//internally it invoke follow code
//opencv code
bool VideoCapture::open(const String& filename, int apiPreference)
{
    if (isOpened()) release();
    icap = IVideoCapture_create(filename);
    if (!icap.empty())
        return true;

    cap.reset(cvCreateFileCaptureWithPreference(filename.c_str(), apiPreference)); // !! <- and only here opencv start working with apiPreference!
    return isOpened();
}    
//opencv code

so how to using apiPreference correctly? In my case, i get cap = IVideoCapture_create(filename) not empty and cvCreateFileCaptureWithPreference never invoke. Does it bug?

Just in case, I open "ProcessExplorer" app and check what kind of dll was started with my application. There no any ffmpeg dll in list.

Then I rename video file with non english words (some russians symbols) and after that string cap = IVideoCapture_create(filename) make empty, and program go to execute cvCreateFileCaptureWithPreference. I open "ProcessExplorer" and see now application using opencv_ffmpeg310_64.dll

Also the video file has some kind of interlines capture, and after capture.read(mat) procedure, the height ot the output mat is half of original video frame (536 instead of 1072). When opencv_ffmpeg310_64.dll using I get original frame

2016-08-11 00:16:36 -0600 received badge  Editor (source)
2016-08-11 00:06:23 -0600 answered a question Explicitly set ffmpeg to open video

Hello every one. I'm using opencv 3.1

std::string filename = "1440x1072.avi";
capture.open(filename, CAP_FFMPEG);

//internally it invoke follow code
//opencv code
bool VideoCapture::open(const String& filename, int apiPreference)
{
    if (isOpened()) release();
    icap = IVideoCapture_create(filename);
    if (!icap.empty())
        return true;

    cap.reset(cvCreateFileCaptureWithPreference(filename.c_str(), apiPreference)); // !! <- and only here opencv start working with apiPreference!
    return isOpened();
}    
//opencv code

so how to using apiPreference correctly? In my case, i get cap = IVideoCapture_create(filename) not empty and cvCreateFileCaptureWithPreference never invoke. Does it bug?

Just in case, I open "ProcessExplorer" app and check what kind of dll was started with my application. There no any ffmpeg dll in list.

Then I rename video file with non english words (some russians symbols) and after that string cap = IVideoCapture_create(filename) make empty, and program go to execute cvCreateFileCaptureWithPreference. I open "ProcessExplorer" and see now application using opencv_ffmpeg310_64.dll

Also the video file has some kind of interlines capture, and after capture.read(mat) procedure, the height ot the output mat is half of original video frame (536 instead of 1072). When opencv_ffmpeg310_64.dll using I get original frame