ScreenCapture QML Type
이 유형은 화면 캡처에 사용됩니다. 더 보기...
Import Statement: | import QtMultimedia |
Since: | Qt 6.5 |
In C++: | QScreenCapture |
속성
- active : bool
- error : enumeration
- errorString : string
- screen : Screen
자세한 설명
ScreenCapture는 화면을 캡처합니다. 캡처한 화면을 비디오 미리보기 객체에 표시하거나 파일에 녹화할 수 있는 MediaCaptureSession에서 관리합니다.
아래 코드는 VideoOutput 에서 캡처한 기본 화면 보기를 재생하는 ScreenCapture를 사용한 간단한 캡처 세션을 보여줍니다.
CaptureSession { id: captureSession screenCapture: ScreenCapture { id: screenCapture active: true } videoOutput: VideoOutput { id: videoOutput } }
화면 캡처 제한
Qt 6.5.2 이상에서는 ScreenCapture 사용 시 다음과 같은 제한 사항이 적용됩니다:
- FFmpeg 백엔드에서만 지원됩니다.
- Wayland 컴포저를 사용하는 Linux 시스템에서 화면 캡처 구현은 실험적이며 다음과 같은 제한 사항이 있습니다. Wayland 프로토콜의 제한으로 인해
QScreenCapture
클래스의 API를 통해 대상 화면을 설정하고 가져오는 것은 불가능합니다. 대신 OS에서QScreenCapture::setActive(true)
을 호출하면 화면 선택 마법사가 표시됩니다. 화면 캡처 기능을 사용하려면 XDG 데스크톱 포털과 {https://pipewire.org/}{PipeWire}(0.3)를 통해 지원되는 ScreenCast 서비스를 설치해야 합니다. 이러한 제한 사항은 향후 변경될 수 있습니다. - Android를 제외한 모바일 운영 체제에서는 지원되지 않습니다. Android에서 화면 캡처를 사용하려면
AndroidManifest.xml
파일에 추가 Android 포그라운드 서비스 권한을 추가해야 합니다:<manifest ...> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" /> <application ...> <service android:name="org.qtproject.qt.android.multimedia.QtScreenCaptureService" android:foregroundServiceType="mediaProjection" android:exported="false"/> </service> </application> </manifest>
- EGLFS가 포함된 임베디드에서는 기능이 제한됩니다. Qt Quick 애플리케이션의 경우 현재 QQuickWindow::grabWindow 을 통해 클래스가 구현되어 성능 문제가 발생할 수 있습니다.
- 대부분의 경우 화면 캡처 프레임 속도는 화면 새로 고침 빈도와 동일하게 설정하지만, 프레임 속도가 유연할 수 있는 Windows에서는 예외입니다. 캡처한 화면이 4K 해상도인 경우 이러한 프레임 속도(75/120 FPS)는 저사양 CPU에서 성능 문제를 일으킬 수 있습니다. EGLFS에서는 캡처 프레임 속도가 현재 30 FPS로 고정되어 있습니다.
WindowCapture 및 CaptureSession 을참조하세요 .
속성 문서
active : bool |
캡처가 현재 활성화되어 있는지 여부를 설명합니다.
error : enumeration |
마지막 오류 코드를 반환합니다.
errorString : string |
오류의 원인을 설명하는 사람이 읽을 수 있는 문자열을 반환합니다.
screen : Screen |
캡처할 화면을 설명합니다.
© 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.