Qt Multimedia 지스트리머 백엔드

이 페이지에서는 Qt Multimedia 의 지스트리머 백엔드의 한계에 대해 설명합니다.

제한 사항 및 알려진 문제

GStreamer는 Qt와 함께 번들로 제공되지는 않지만 일반적으로 Linux 배포판과 함께 배포됩니다.

  • 특정 버그는 사용 중인 GStreamer 버전으로 인해 발생할 수 있습니다. 사용 중인 플랫폼에서 최신 GStreamer 버그 수정 릴리스를 사용하는 것이 좋습니다.
  • 특정 버그는 Pulseaudio와 같이 GStreamer에서 사용하는 라이브러리와도 관련이 있을 수 있습니다. 특히 Pulseaudio v16에는 GStreamer 파이프라인을 중단시키는 알려진 버그가 있으며, 이 두 패치의 백포트가 필요합니다:

    이 버그는 현재 우분투 22.04, 23.10 및 24.04, 데비안 11 및 12, 페도라 39 및 40을 포함한 대부분의 주요 Linux 배포판에 영향을 미칩니다.

  • 검색, 재생 속도, 루프, 전환 싱크에 알려진 버그가 있습니다.

사용자 지정 포인트

Qt Multimedia 는 기본 GStreamer 파이프라인에 액세스할 수 있는 특정 사용자 지정 포인트를 제공합니다. 이러한 사용자 지정 포인트는 비공개 API로 간주되며 변경될 수 있습니다. 진입 지점은 class QGStreamerPlatformSpecificInterface 입니다.

원시 파이프라인 액세스

QMediaPlayerQMediaCaptureSession 의 기초가 되는 GstPipeline 에 액세스할 수 있습니다.

경고: 파이프라인은 여전히 Qt 구현에 의해 관리되므로 안전하지 않은 API입니다. 이 API를 사용할 때는 각별한 주의가 필요합니다.

#include <QtMultimedia/private/qgstreamer_platformspecificinterface_p.h>

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

싱크 및 소스로서의 사용자 지정 GStreamer 요소

GStreamer 파이프라인 디스크립션에서 GStreamer 요소를 생성하고 QCamera 또는 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);

QMediaPlayer: 커스텀 소스

QMediaPlayer 은 소스 URI로 GStreamer 파이프라인 디코딩을 받아들입니다:

QMediaPlayer player;
player.setSource(u"gstreamer-pipeline: videotestsrc name=testsrc"_s);

그러면 QMediaPlayer 에서 소스로 사용할 파이프라인 설명을 컴파일하려고 시도하고 QMediaPlayer 의 싱크에 자동으로 연결됩니다.

경고: 드래콘을 사용하지 마세요! 사용자 지정 파이프라인은 실험적인 기능으로, 특히 미디어 상태, 메타데이터 API 및 전송 상태와 같은 QMediaPlayer API에 잘 매핑되지 않습니다. 대부분의 호출은 GStreamer 파이프라인에 직접 매핑되므로 파이프라인에 따라 정의되지 않은 동작이 발생할 수 있습니다. 대부분의 경우 gstreamer-pipeline: 은 애플리케이션 코드에 적합하지 않을 수 있습니다. 임의의 동영상 소스의 경우 사용자 지정 카메라(위 참조)가 있는 QMediaCaptureSession 을 사용하는 것이 좋습니다. 임의의 복잡한 파이프라인을 Qt/QML GUI로만 그리려는 경우 GStreamer의 qml6glsink (아래 참조)가 더 강력한 선택이 될 수 있습니다.

아키텍처 고려 사항.

Qt Multimedia 는 범용 스트리밍 프레임워크가 아니며, Qt와 함께 GStreamer를 사용하기 위한 구조적으로 가장 좋은 방법도 아닙니다. GStreamer 파이프라인에 대한 고도의 제어가 필요하지만 비디오 출력 Qt만 표시하려는 개발자는 GStreamer의 qml6glsink를 사용하는 것을 고려할 수 있습니다.

© 2025 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.