0

I am using Qt 5.9 based app which runs on embedded linux & android. The application processes real time data using OpenGL ES 3.0 & displays OpenGL textures at real time. I am displaying at the rate of 30+ frames per second which makes it pretty much real time & appears like a video.

I need to save an mp4 from a 30 to 40 frames that are displayed using OpenGL textures. As I understand, I can leverage Qt Multimedia to do this. But I lack the knowledge of how to do this. I am trying read & understand the how part from links like here & here.

One the mp4 is saved, playback can be done using QMediaPlayer as explained here. That looks darn simple. But I am struggling to figure how get my OpenGL textures saved into a .mp4 when I need them to.

So, How do I save a .mp4 video out of the OpenGL textures that are displayed on a QML item?

Pointing out to any basic example that exists would also help.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159

1 Answers1

1

I don't think Qt will do you any favors when it comes to content creation, Qt's multimedia facilities are purely for content consumption purposes. You can play MM, not make MM.

You will have you explicitly use one of the many available MM libraries out there - vlc, ffmpeg, gstreamer, libav to name a few.

dtech
  • 47,916
  • 17
  • 112
  • 190
  • Ok. so, my expectation of Qt Multimedia helping was wrong. Is there an example of how to do this using `ffmpeg` or `vlc` ? – TheWaterProgrammer Aug 03 '17 at 14:37
  • [this link](http://blog.qt.io/blog/2017/02/21/making-movies-qml/) also seems to be using `ffmpeg` to save a video out of the images displayed. I am leaning towards using `ffmpeg` to create my video – TheWaterProgrammer Aug 03 '17 at 15:17
  • 1
    ffmpeg will do, it is sorta middle ground, between gstreamer - the most capable, and libav - the easiest, although I haven't toyed with libvnc, so I can't speak of its position in the spectrum – dtech Aug 03 '17 at 15:20
  • also [this link](reading through [this link](http://blog.qt.io/blog/2017/02/21/making-movies-qml/) I mentioned earlier in my comment. The movie renderer) I mentioned in my question & comment. The solution mentioned there seems to be saving images into a folder using `MovieRenderer`. Then it requires to run a `ffmpeg` command on the images to create movie. I've all the images in an std::vector in my app in a certain raw format. I run the each of them through gl processing & create the movie on the fly if Qt supports. Is it possible to do it using gstreamer or any of the options you mentioned? – TheWaterProgrammer Aug 03 '17 at 15:28
  • 1
    Yeah but that's just lame. What do you do to your clients - ask them to install extra stuff? Also it can be very space wasting, having to store all the images prior to encoding them rather than encoding them on the fly. And that guy with the "movie rendered" would have used Qt if it actually provided that functionality. But in many ways Qt is always "too little too late" – dtech Aug 03 '17 at 15:31
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/150980/discussion-between-programist-and-dtech). – TheWaterProgrammer Aug 03 '17 at 15:33