Getting QImages into QMediaRecoder to create video files (e.g. avi, mp4, or animated gif)?

  • Relative to this topic, "Video file generation from Qt application, other than FFmpeg" (thread: there's been suggestions in related Qt forums, possibly referring to the Qt5 QMediaRecorder class, that video file generation can be done in "just" Qt. (I'm not sure how authoritative such suggestions are).

    In the Qt5 documentation, there is just a little information about using QCamera in conjunction with QMediaRecorder to create video files ("record video to disk") ... 

    However, I'm not seeing any way to get QImages or QPixmaps into either of these classes (QCamera or QMediaRecorder), nor their base classes. So I don't see how these can be used to generate video files from synthetic (program-created) images. (Ultimately, they would come from "rendering" our QWidgets to QPixmaps or QImages).

    Also, there doesn't seem to be any information about whether anything special has to be done with respect to video codecs for creating video files (e.g. avi, mp4, or animated gif). I'd like to give it a try, but that's not doable (nor meaningful) if we can't get QImages and QPixmaps into these things.

  • Unfortunately, Qt commercial license support folks are confirming that, currently (as of Qt 5.6), there is no way to get a sequence of programmatically generated QImages (e.g. renders from an application QWidget) into the QMediaRecorder class. ("There is no API for that").

    Related -- they also could not offer any information about a Google WebM / VP8 solution. That really looks like a promising approach, though the integration is technically challenging. As far as I can tell, that really is the only virtually bullet-proof legal approach to generating synthetic videos (i.e. animations generated programmatically, saved as video files).

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.