I would like to write all my image files entitled "pictures_1/2/3/etc..." into a video file.
The code below is creating the video.avi file successfully. However, there is no data written inside the latter.
I'm aware that the videocapture opencv function is mainly used to capture data from a video, but i heard it was possible to use it for images too (As described here (1rst answer))
void video (void)
{
VideoCapture in_capture("/path/.../pictures_%d.jpg");
Mat img;
VideoWriter out_capture("path/.../video.avi", CV_FOURCC('M','J','P','G'), 30, Size(1989,1680));
while (true)
{
in_capture >> img;
if(img.empty())
break;
out_capture.write(img);
}
}