Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114177

On Windows, Unable to record a single window video instead of entire screen

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.6
    • dev
    • Multimedia
    • None
    • Windows

    Description

      I using Windows 10 and Qt 6.6 (dev branch).

      I want to record a single window video.
      However, the entire screen is recorded instead of a single window.

      My MainWindow has the following members:

      QScreenCapture m_screenCapture;
      QMediaCaptureSession m_mediaCaptureSession;
      QMediaRecorder m_mediaRecorder;

      On the start button pressed:

      m_screenCapture.setWindow(windowHandle());
      m_mediaCaptureSession.setScreenCapture(&m_screenCapture);
      m_mediaCaptureSession.setRecorder(&m_mediaRecorder);
      m_screenCapture.setActive(true);
      m_mediaRecorder.setOutputLocation(QUrl::fromLocalFile("a.mp4"));
      m_mediaRecorder.record();

      Even though I specify a window handle, the entire screen is recorded instead of that window.

      What I have investigated is that the recording function in Windows uses QFFmpegScreenCaptureDxgi, not QFFmpegScreenCapture.

      In QFFmpegMediaIntegration::createScreenCapture(),
      I found that QFFmpegScreenCaptureDxgi is used when Q_OS_WINDOWS is defined.
      Then I modified it to force it to use QFFmpegScreenCapture and was able to record a single window.

      Questions:

      • Is it possible to record a single window with the implementation using QFFmpegScreenCaptureDxgi?
      • Is it possible to use QFFmpegScreenCapture in Windows environment?
      • Is it possible to switch between them?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            artemiy Artem Dyomin
            shinichi_fuchita shinichi_fuchita
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes