Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Getting QImages into QMediaRecoder to create video files (e.g. avi, mp4, or animated gif)?
Forum Update on Monday, May 27th 2025

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmediarecorderqcameravideo filemp4avi
3 Posts 2 Posters 6.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Phil_W
    wrote on last edited by
    #1

    Relative to this topic, "Video file generation from Qt application, other than FFmpeg" (thread: https://forum.qt.io/topic/63105/video-file-generation-from-qt-application-other-than-ffmpeg) 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") ...

    http://doc.qt.io/qt-5/videooverview.html#recording-video
    http://doc.qt.io/qt-5/cameraoverview.html#movies 
    

    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.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Phil_W
      wrote on last edited by
      #2

      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). http://www.webmproject.org/about/

      1 Reply Last reply
      0
      • I Offline
        I Offline
        iondev
        wrote on last edited by iondev
        #3

        You might want to check the libqtavi library: https://iondev.ro/qtavi/

        It enables Qt based applications to easily save video files in the AVI container format and is available under two licenses: open-source (GPL v. 3.0) and commercial.

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved