'Qimagewriter to ffmpeg video file?

I have this code that genarates an image sequence, is there any way I can turn this into a video with ffmpeg?

                QImageWriter writer(filepath);
                writer.setCompression(1); // use compression for tiff+jpeg
                writer.setOptimizedWrite(true);
                writer.write(image);

I have tried searching around the internet with a similar question but no luck.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source