Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to create a .mp4 Video from a collection of QOpenGLFramebufferObjects /QImages / Glunit textures
Forum Updated to NodeBB v4.3 + New Features

How to create a .mp4 Video from a collection of QOpenGLFramebufferObjects /QImages / Glunit textures

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
10 Posts 2 Posters 3.6k Views 1 Watching
  • 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.
  • Roby BrundleR Offline
    Roby BrundleR Offline
    Roby Brundle
    wrote on last edited by Roby Brundle
    #1

    I am developing a Qt app for iOS, Android & OSX.

    Situation:
    I have an std::vector of QOpenGLFramebufferObjects. Each QOpenGLFramebufferObject can of course provide its own QImage or a GLunit texture by doing a takeTexture. So you can also say that I have a collection of QImages or GLunit textures.

    Problem:
    I want to create a .mp4 video file out of these QImages/QOpenGLFramebufferObjects which works on iOS, Android & OSX.

    How should I do this? Any examples doing this with Qt? Which classes in Qt should I be looking into?

    I am thinking to use ffmpeg or GStreamer whatever works best in Qt. But I want to know how to pass these QImages or Glunit textures to create the video. Is there Qt support to do this without having to use a 3d party library?

    Should I use QVideoEncoderSettings to create the video?
    Are there any examples in Qt doing this?
    Which classes/components in Qt I should be looking into?

    Is there something in Qt Multimedia that I can use?
    If not then what is the best option wrt to making this work on Android & iOS?

    PS :
    I am using Qt 5.9.1 commercial version on Android & iOS

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Something is not clear from your description, do you want your application to record a video file on all three platforms ? Or do you want to generate video files that can be played on all these platforms ?

      If the former, what is the source of images ? Are you using widgets or QtQuick ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      Roby BrundleR 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Something is not clear from your description, do you want your application to record a video file on all three platforms ? Or do you want to generate video files that can be played on all these platforms ?

        If the former, what is the source of images ? Are you using widgets or QtQuick ?

        Roby BrundleR Offline
        Roby BrundleR Offline
        Roby Brundle
        wrote on last edited by Roby Brundle
        #3

        @SGaist I want to generate video files that can be played on all 3 platforms.

        The source QImages are are some are QOpenGLFramebufferObjects which are populated after some processing using OpenGL.

        I am using Qt Quick commercial version for Android & iOS. And working on Qt 5.9.1.

        Simplistically saying, I just want to create a video file from QImages or Glunit textures whichever option works with Qt.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Well, I'm sorry to say that it's still not that clear, so let me rephrase that: will your application create these video files on iOS and Android ? Or are you creating a desktop only application that should create these video files ?

          In any case, QOpenGLFramebufferObject has a toImage method that returns a QImage.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          Roby BrundleR 1 Reply Last reply
          0
          • SGaistS SGaist

            Well, I'm sorry to say that it's still not that clear, so let me rephrase that: will your application create these video files on iOS and Android ? Or are you creating a desktop only application that should create these video files ?

            In any case, QOpenGLFramebufferObject has a toImage method that returns a QImage.

            Roby BrundleR Offline
            Roby BrundleR Offline
            Roby Brundle
            wrote on last edited by Roby Brundle
            #5

            @SGaist Yes. My application will create these video files on iOS and Android. It is not a desktop only application. It is primarily for iOS & Android. But the application runs on MacOS as well which is my development environment.

            Yes. QOpenGLFramebufferObject has toImage method to return a QImage. I already know that. But my question starts after this.

            Rephrasing my question here again:
            Consider you have 15 QOpenGLFramebufferObjects in memory. Each one of course can return a QImage. I wan to create a video (.mp4) out of these 15 QImages. How do I do this with Qt.

            And of course, as I said I am running commercial paid version of Qt based Qt latest 5.9.1 released recently. It is a Qt quick based application.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              QMediaRecorder would be the starting point.

              Note that there's no system encoder for h264, it's a non free-format.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              Roby BrundleR 1 Reply Last reply
              0
              • SGaistS SGaist

                QMediaRecorder would be the starting point.

                Note that there's no system encoder for h264, it's a non free-format.

                Roby BrundleR Offline
                Roby BrundleR Offline
                Roby Brundle
                wrote on last edited by Roby Brundle
                #7

                @SGaist How can I pass QImages into QMediaRecorder & create a video out of it?
                Is there a example or some code snippet you could point to?

                Note that I don't need audio. I just want to programmatically create a video out of multiple QImages. And, this is has nothing to do with the camera . I am not trying to get images from camera.

                Trying to see the examples of QMediaRecorder, all of them hooking on to the camera which I don't need to do with my program . Simply, I have some QImages in memory. Want to create a video from say 10 QImages.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  You need to create a QMediaObject that will provide the images to QMediaRecorder.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  Roby BrundleR 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    You need to create a QMediaObject that will provide the images to QMediaRecorder.

                    Roby BrundleR Offline
                    Roby BrundleR Offline
                    Roby Brundle
                    wrote on last edited by
                    #9

                    @SGaist said in How to create a .mp4 Video from a collection of QOpenGLFramebufferObjects /QImages / Glunit textures:

                    QMediaObject

                    Is there an example doing something similar? would be really helpful if you could point to an example doing something close

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      AFAIK, no. You will have to take some inspiration from the Qt Multimedia sources.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0

                      • Login

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