Qt Multimedia GStreamer backend

This page covers the limitations of the GStreamer backend of Qt Multimedia.

Limitations and Known Issues

GStreamer is not bundled with Qt, but it is typically deployed with the Linux distribution.

Customization points

Qt Multimedia provides certain customization points to allow access to the underlying GStreamer pipeline. These customization points are considered private APIs and may be subject to change. The entry point is class QGStreamerPlatformSpecificInterface.

Raw pipeline access

The GstPipeline underlying the QMediaPlayer and QMediaCaptureSession can be accessed.

Warning: This is an unsafe API, as the pipeline is still managed by the Qt implementation. Great care is required when using this API.

#include <QtMultimedia/private/qgstreamer_platformspecificinterface_p.h>

[...]
QMediaMediaPlayer player;
GstPipeline *pipeline = QGStreamerPlatformSpecificInterface::instance()->gstPipeline(&player);
[...]
QMediaCaptureSession session;
GstPipeline *pipeline = QGSreamerPlatformSpecificInterface::instance()->gstPipeline(&session);

Custom GStreamer elements as sinks and sources

It is possible to create GStreamer elements from a GStreamer pipeline decription and wrap them inside a QCamera or QAudioDevice:

#include <QtMultimedia/private/qgstreamer_platformspecificinterface_p.h>

[...]
QByteArray pipelineString = "videotestsrc is-live=true ! gamma gamma=2.0";

QMediaCaptureSession session;
session.setVideoSink(wid.videoSink());

QCamera *cam = QGStreamerPlatformSpecificInterface::instance()->makeCustomGStreamerCamera(
         pipelineString, &session);
session.setCamera(cam);

Architectural Considerations.

Qt Multimedia is not a general purpose streaming framework and not necessarily the architecturally best way to use GStreamer with Qt. Developers, who need a high degree of control over the GStreamer pipeline, but only want to show the video output Qt, may want to consider using GStreamer's qml6glsink.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.