Dissecting the module

The multimedia module is a really large module that consists of many different parts, that provide very different features and functionality. The main categories are as follows:

  • Audio
  • Video
  • Camera
  • Radio

Do note that classes that handle image formats, such as QImage, QPixmap, and so on, are not a part of the multimedia module but rather the GUI module. This is because they are an important part of the GUI that cannot be separated. Despite this, we will still cover the QImage class within this chapter.

Under each category are subcategories that look something like the following:

  • Audio:
    • Audio output
    • Audio recorder
  • Video:
    • Video recorder
    • Video player
    • Video playlist
  • Camera:
    • Camera viewfinder
    • Camera image capture
    • Camera video recorder
  • Radio:
    • Radio tuner (for devices that support analog radio)

Each of the classes is designed to fulfill a different purpose. For example, the QSoundEffect is used for playing low latency audio files (such as WAV files). QAudioOutput, on the other hand, outputs raw audio data to a specific audio device, which gives you low-level control over your audio output. Finally, the QMediaPlayer is a high-level audio (and video) player that supports many different high-latency audio formats. You must understand the differences between all the classes before choosing the right one for your project.

The multimedia module in Qt is such a huge beast that often confuses newcomers, but can be advantageous if you know which to choose from. Another issue with the multimedia module is that it may or may not work on your target platform. This is because underneath all these classes are native implementations for specific platforms. If a particular platform does not support a feature, or there is not yet an implementation for it, then you won't be able to use those functionalities.

For more information regarding the different classes provided by Qt's multimedia module, please visit the following link:
https://doc.qt.io/qt-5.10/qtmultimedia-index.html