Qt Multimedia : How to convert/re-encode a video file
-
I would like to be able, using Qt Multimedia, to convert a video or audio file to another container/codec format, meaning re-encode the file.
Could someone please indicate whether this can be accomplished, and if yes, how ?
A link to an example will be wonderful.As a related question, I suppose that for listing the video & audio codecs that are available for encoding, one would use the functions QMediaRecorder::supportedAudioCodecs and QMediaRecorder::supportedVideoCodecs. Is that correct ?
-
I have seen this advice before, but was hoping that something has improved since then.
Does that mean that you don't recommend using Qt Multimedia ?I would have expected Qt to incorporate GStreamer as its video interface.
Is Qt hit also by the dreaded "Not invented here" syndrome? -
I mean that QtMultimedia is not the right tool to do video conversion.
On Linux Qt uses gstreamer as backend.
But again, converting video files from different formats in different formats is currently not something you should try to do with QtMultimedia. It uses what the OS provides and depending on your target (I'm guessing Linux) you won't have all the codecs you may need/want. Using FFMPEG, you have the Swiss Army Knife of video converter. Or if you are used to gstreamer, there also the QtGStreamer module that might be of interest.
-
-
It's not an official Qt module, it's provided by the gstreamer project. So depending on your target OS, you'll to build it anyway.
-
Like I wrote before, doing video conversion is not an easy task and is currently outside of QtMultimedia's functionality and one of the best tool available for that is ffmpeg.
Note that you can very well mix other libraries like ffmpeg or gstreamer with Qt without any problem.