When I use in the function: 'x'.write(frame) for write to video file in opencv the program pass the code and I compile it without Errors but when I open the file I see that it's 0 kb and the player can't play it. Can someone help me?
Here my code:
    // Setup output video
    cv::VideoWriter output_cap("output.avi",
        CV_CAP_PROP_FOURCC,
        CV_CAP_PROP_FPS,
        cv::Size(1376, 768));
    // Loop to read frames from the image and write it to the output capture
    cv::Mat frame = imread("1.jpg", 0);
    for(int hgf=1;hgf<=300;hgf++)
    {
        if (!frame.data)
        {
            break;
        }
            output_cap.write(frame);
    }
Good Day everybody!!