Basically what I want is to encode a video using QMediaRecorder by supplying as a source a sequence of QImages that I generate in custom code at run-time.
So far I have found no easy way to do this, and everything points at the solution where I have to somehow implement my own subclass of QMediaService and/or QMediaControl that takes QImage as input, register them and somehow make QMediaRecorder use them. But according to this page in the official Qt documentation on the subject, this is a road less traveled and I am on my own:
In general, implementing a QMediaService is outside of the scope of this documentation and support on the relevant mailing lists or IRC channels should be sought.
I am with this post hoping someone who possesses this knowledge may shed some light on how this would be done. I think documenting this set of features will open up many useful possibilities for the users of Qt5.
Update 2020-06-16: It has been almost 4 years and still not a single answer. I will put a bounty on this question and accept the best answer with working example code for recent Qt5.
It is quite simple to do this directly with ffmpeg. You can either save the images on disk then use an ffmpeg filter from the command line, via QProcess. You can also create a video stream in the code, therefore avoiding the loss of time and performance due to the images being saved on the disk, save the images in that stream