IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

ScreenCapture QML Type

This type is used for capturing a screen.

This type was introduced in Qt 6.5.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

ScreenCapture QML Type

  • Import Statement: import QtMultimedia

  • Since: Qt 6.5

  • Instantiates:: QScreenCapture

  • Group: ScreenCapture is part of multimedia_qml, multimedia_video_qml

Detailed Description

ScreenCapture captures a screen. It is managed by MediaCaptureSession where the captured screen can be displayed in a video preview object or recorded to a file.

The code below shows a simple capture session with ScreenCapture playing back the captured primary screen view in VideoOutput.

 
Sélectionnez
CaptureSession {
    id: captureSession
    screenCapture: ScreenCapture {
        id: screenCapture
        active: true
    }
    videoOutput: VideoOutput {
        id: videoOutput
    }
}

Screen Capture Limitations

On Qt 6.5.2 and 6.5.3, the following limitations apply to using ScreenCapture:

  • It is only supported with the FFmpeg backend.

  • It is supported on all desktop platforms, except Linux with Wayland compositor, due to Wayland protocol restrictions and limitations.

  • It is not supported on mobile operating systems, except on Android. There, you might run into performance issues as the class is currently implemented via QScreen::grabWindow, which is not optimal for the use case.

  • On Linux, it works with X11, but it has not been tested on embedded.

  • In most cases, we set a screen capture frame rate that equals the screen refresh rate, except on Windows, where the rate might be flexible. Such a frame rate (75/120 FPS) might cause performance issues on weak CPUs if the captured screen is of 4K resolution.

See Also

Property Documentation

 

active : bool

Describes whether the capturing is currently active.

[read-only] error : enumeration

Returns a code of the last error.

[read-only] errorString : string

Returns a human readable string describing the cause of error.

screen : Screen

Describes the screen for capturing.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+