78 QCameraDevice cameraDevice(camera);
81 const QScreen *screen = QGuiApplication::primaryScreen();
82 const int screenAngle = screen->angleBetween(screen->nativeOrientation(), screen->orientation());
85 if (cameraDevice.position() == QCameraDevice::BackFace) {
86 rotation = (cameraDevice.orientation() - screenAngle) % 360;
89 rotation = (360 - cameraDevice.orientation() + screenAngle) % 360;
93 videoFrame = videoFrame.transformed(QTransform().rotate(rotation));
116 QMediaCaptureSession captureSession;
117 camera =
new QCamera;
118 captureSession.setCamera(camera);
119 recorder =
new QMediaRecorder(camera);
120 captureSession.setRecorder(
recorder);
125 QMediaFormat format(QMediaFormat::MPEG4);
126 format.setVideoCodec(QMediaRecorder::VideoCodec::H264);
127 format.setAudioCodec(QMediaRecorder::AudioCodec::MP3);
128 recorder->setMediaFormat(settings);