-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.1
-
None
When we try to record a screen that has its orientation changed to Portrait, the recording thread crashes. Here is a minimal example to reproduce the bug:
#include <QApplication> #include <QMediaCaptureSession> #include <QScreenCapture> #include <QMediaRecorder> #include <QMediaFormat> #include <QUrl> #include <QTimer> int main(int argc, char *argv[]) { QApplication a(argc, argv); QMediaCaptureSession session; QScreenCapture screen; session.setScreenCapture(&screen); screen.setScreen(a.screens().at(1)); // <-- Change to the index of a rotated screen !! screen.start(); QMediaRecorder recorder; session.setRecorder(&recorder); recorder.setOutputLocation(QUrl::fromLocalFile(a.applicationDirPath() + "/x.mp4")); QTimer timer; int count = 0; QObject::connect(&timer, &QTimer::timeout, &a, [&] { qDebug() << ++count; if (count == 5) { recorder.stop(); } if (count == 10) { a.quit(); } }); timer.start(1000); return a.exec(); }
Sometimes it's possible to get a very short recording, but the result is like this:
- relates to
-
QTBUG-129708 Wrong aspect ratio with rotated screen using QScreenCapture and QMediaRecorder
-
- Closed
-