I cannot open a video file with C ++ and OpenCV3

I tried to read the saved video file (.avi) using the following code:

#include <iostream> // for standard I/O
#include <string>   // for strings
#include <opencv2/core/core.hpp>        
#include <opencv2/highgui/highgui.hpp> 
using namespace std;
using namespace cv;
int main(int argc, char *argv[])
{
    const string source = argv[1];          
    VideoCapture inputVideo(source);        

    if (!inputVideo.isOpened())
    {
       cout  << "Could not open the input video: " << source << endl;
       return -1;
    }
       cout  << "YESSSSSSSSSSSSSSS : open the input video: " << source <<endl;
 }

There are no compilation errors. But when I ran it, I got this error

GStreamer: Error opening bin: Unrecoverable syntax error while parsing pipeline 4p-c0.avi

Help me please.

+4
source share

Source: https://habr.com/ru/post/1661728/


All Articles