GStreamerVideoSource QML Type | Qt Multimedia | Qt 6.12.0
Description: A video source backed by a custom GStreamer bin.
Keywords: qmltype

- Qt 6.12
- Qt Multimedia
- QML Types
- GStreamerVideoSource
- Qt 6.12.0 Reference Documentation

# GStreamerVideoSource QML Type

A video source backed by a custom GStreamer bin. More...

Import Statement: | `import QtMultimedia`
In C++: | QGStreamerVideoSource

- List of all members, including inherited members

## Properties

- active : bool
- gstBinDescription : string

## Methods

- void start()
- void stop()

## Detailed Description

Construct the video source from a GStreamer bin description and attach it to CaptureSession using its nativeVideoSource property.

For any standard case, we recommend using Camera instead of this type, unless you need GStreamer-specific configuration to handle any custom video source.

By default, the type is available only in meta-qt6 builds. In custom builds with GStreamer support, the `gstreamer_qt_api` feature can enable it.

QtMultimedia must be run with the `gstreamer` media backend for this class to work.

     Item {
         CaptureSession {
             nativeVideoSource: GStreamerVideoSource {
                 gstElementDescription: "videotestsrc name=testsrc"
                 active: true
             }
             videoOutput: preview
         }

         VideoOutput {
             id: preview
         }
     }

See also CaptureSession and Camera.

## Property Documentation

### active : bool

Describes whether the video source is currently active.

If the video source has been connected to a CaptureSession, this property indicates whether the underlying `GstElement` is attached to the `GstPipeline` within the media capture session.

### gstBinDescription : string `[read-only]`

Describes the GStreamer bin description associated with the video source.

In QML, this property is required.

The GStreamer backend interprets the description and creates a bin, that can act as a video source for a capture session.

See GStreamer documentation for the syntax of the description string.

If the specified description is invalid, preventing a bin from being created, the constructed `GStreamerVideoSource` is non-functional, and the property returns an empty string.

Note: GStreamerVideoSource doesn't perform any additional validation of the provided bin description, so if the created `GstBin` doesn't represent a video input for `GstPipeline`, GStreamerVideoSource and the associated CaptureSession may misbehave.

## Method Documentation

### void start()

Starts the video source.

Same as setting the active property to `true`.

### void stop()

Stops the video source.

Same as setting the active property to `false`.