ByteScout Screen Capturing SDK - C++ (unmanaged) - Capture Webm Video From Entire Screen in QT - ByteScout

ByteScout Screen Capturing SDK – C++ (unmanaged) – Capture Webm Video From Entire Screen in QT

  • Home
  • /
  • Articles
  • /
  • ByteScout Screen Capturing SDK – C++ (unmanaged) – Capture Webm Video From Entire Screen in QT

How to capture webm video from entire screen in QT in C++ (unmanaged) using ByteScout Screen Capturing SDK

This tutorial will show how to capture webm video from entire screen in QT in C++ (unmanaged)

These sample source codes on this page below are demonstrating how to capture webm video from entire screen in QT in C++ (unmanaged). ByteScout Screen Capturing SDK: the screen video recording SDK helps in quick implementation of screen video recording. WMV, AVI, WebM output options are available with adjustable quality, video size, framerate and video and audio codec. Includes special features like live multiple blacking out of selected areas, recording from web cam as main source and as overlay, optional watermarks for output video. It can capture webm video from entire screen in QT in C++ (unmanaged).

You will save a lot of time on writing and testing code as you may just take the C++ (unmanaged) code from ByteScout Screen Capturing SDK for capture webm video from entire screen in QT below and use it in your application. This C++ (unmanaged) sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Code testing will allow the function to be tested and work properly with your data.

Download free trial version of ByteScout Screen Capturing SDK from our website with this and other source code samples for C++ (unmanaged).

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

main.cpp
      
#include "widget.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; // w.show(); Decomment if you need custom the GUI return a.exec(); }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Screen Capturing SDK Home Page

Explore ByteScout Screen Capturing SDK Documentation

Explore Samples

Sign Up for ByteScout Screen Capturing SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

widget.cpp
      
#include "widget.h" #include "ui_widget.h" #include <QDebug> #include <windows.h> #include <iostream> using namespace std; Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); //Decomment if you need to use QAxWidget //com = new QAxWidget; //Comment if you need QAxWidget com = new QAxObject; com->setControl("BytescoutScreenCapturing.Capturer"); QString error = com->property("LastError").toString(); if (error.compare("No errors.")!=0) // or empty string { cout <<"Screen Capturer is not installed properly. " << error.toStdString() << endl; exit(1); } com->setProperty("RegistrationName","demo"); com->setProperty("RegistrationKey","demo"); com->setProperty("CapturingType",3);//catScreen: Capture all screen /************************************************************************************ * The code you sent me used the webcam too. * Decomment if you need show webcam streaming ************************************************************************************* *************************************************************************************/ //com->setProperty("CurrentWebCam",0); //com->setProperty("CaptureTransparentControls",true); // Set rectangle to show overlaying video from webcam into the rectangle 160x120 (starting with left point at 10, 10) //com->dynamicCall("SetWebCamVideoRectangle(int,int,int,int)",10, 10, 160, 120); // Enable webcam overlaying capture device //com->setProperty("AddWebCamVideo",true); //com->setProperty("OutputWidth",640); //com->setProperty("OutputHeight",480); /************************************************************************************** //End webcam property /*************************************************************************************** */ // Set output file name com->setProperty("OutputFileName", "Output.webm"); com->dynamicCall("Run()"); //' IMPORTANT: if you want to check for some code if need to stop the recording then make sure you are //' using Thread.Sleep(1) inside the checking loop, so you have the loop like //' Do //' Thread.Sleep(1) //' While StopButtonNotClicked error = com->property("LastError").toString(); if (error.compare("No errors.")!=0) { cout <<"Capture failed. " << error.toStdString() << endl; exit(1); } //Testing purposes: //Register for 10 seconds and after stop the process //You can stop the registration as you prefer: Input, keyboard and so on.. Sleep(10000); //Usefull for testing purposes: Register for 10 seconds com->dynamicCall("Stop()"); //End registration qDebug()<<"End Registration"; } Widget::~Widget() { delete ui; }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Screen Capturing SDK Home Page

Explore ByteScout Screen Capturing SDK Documentation

Explore Samples

Sign Up for ByteScout Screen Capturing SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

widget.h
      
#ifndef WIDGET_H #define WIDGET_H #include <QWidget> #include <QKeyEvent> #include <QAxWidget> #include <QAxObject> #include <QEvent> namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT public: explicit Widget(QWidget *parent = 0); ~Widget(); private: Ui::Widget *ui; //You can switch to QAxWidget //QAxWidget * com; QAxObject * com; }; #endif // WIDGET_H

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Screen Capturing SDK Home Page

Explore ByteScout Screen Capturing SDK Documentation

Explore Samples

Sign Up for ByteScout Screen Capturing SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Screen Capturing SDK Home Page

Explore ByteScout Screen Capturing SDK Documentation

Explore Samples

Sign Up for ByteScout Screen Capturing SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next