Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    General and Desktop
    qmediarecorder qcamera video file mp4 avi
    2
    3
    5308
    Loading More Posts
    • 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
      Phil_W last edited by

      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 Reply Quote 0
      • P
        Phil_W last edited by

        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 Reply Quote 0
        • I
          iondev last edited by iondev

          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 Reply Quote 1
          • First post
            Last post