I am trying to write the frame into my local machine in mp4 format. The frame
is read from an existing
mp4 file. After running the following code, I was able to see the VideoOutput.mp4
file, but it is corrupted for some reason. Anyone knows why?
VideoCapture capture("videoSample.mp4");
if (capture.isOpened())
{
while (true)
{
capture >> frame;
}
VideoWriter video("somepath\\videoOutput.mp4", VideoWriter::fourcc('m', 'p', '4', 'v'), 10, Size(win_width, win_width * 2));
video.write(frame);
}