Screen Recorder is a command-line tool designed to enable precise screen recording from the terminal. It allows users to specify parameters such as framerate, monitor selection, and buffer size when starting a recording. When stopped, the tool saves screenshots to a designated folder.
Key Features:
Command-Line Control: Initiate and stop recordings directly from the terminal with customizable settings.
Parameter Customization: Adjust framerate (frames per second), select specific monitors, or define buffer sizes for optimal performance.
ETW Event Integration: Emits ETW events to correlate screenshots with system activity, aiding in debugging and analysis.
Batch Processing: Efficiently capture multiple screenshots over time and store them in a specified directory.
Audience & Benefit:
Ideal for developers, testers, and technical users requiring precise screen recording capabilities. The tool provides a reliable method to document screen changes over time, integrate with automated workflows, or debug visual issues by correlating screenshots with system events. Its command-line interface makes it easy to incorporate into scripts or CI/CD pipelines.
Install Screen Recorder via winget for seamless integration into your development workflow.
Install Python development, .NET desktop development, and Desktop development with C++ workloads
Install MSVC v143 - VS 2022 C++ ARM64/ARM64EC build tools (v14.38-17.8) component or newer to compile for ARM
Screen Recorder
Usage
The tool allows you to start and stop recording from the command line. When a recording is started, the framerate, monitor, and buffer size can be specified. When a recording is stopped, a folder must be provided in which to store the screenshots.
screenrecorder.exe -start ... Starts screen recording.
Usage: screenrecorder.exe -start [-framerate ] [-monitor ] [-framebuffer -mb <# of frames>] [-monitor ]
Ex> screenrecorder.exe -start -framerate 10
Ex> screenrecorder.exe -start -framerate 1 -monitor 0 -framebuffer -mb 100
-framerate Specifies the rate at which screenshots will be taken, in frames per second.
-monitor Specifies the monitor to record, as an index. The highest index will record all monitors.
-framebuffer Specifies the size of the circular memory buffer in which to store screenshots, in number of screenshots. Adding the -mb flag specifies the size of the buffer in megabytes.
screenrecorder.exe -stop ... Stops screen recording saves all screenshots in buffer to a folder.
Usage: screenrecorder.exe -stop
Ex> screenrecorder.exe -stop "D:\screenrecorder"
screenrecorder.exe -cancel ... Cancels the screen recording.
screenrecorder.exe -help ... Prints usage information.
Capturing ETW Events
An ETW event is emitted by the tool every time it receives a frame from DirectX. The event for each frame contains the filename to be used if the frame is saved to disk, allowing for direct correlation between each event and screenshot. The tool does not receive frames from DirectX unless there has been a change in the screen, so desired framerates may not be exact.
To capture the ETW events, you must use a ETW tracing tool like WPR and watch for events from the following provider guid: fe8fc3d0-1e6a-42f2-be28-9f8a0fcf7b04.
Example Capture
Create a WPR profile with the following provider and collectors defined:
...
...
...
Take an ETW trace using WPR while you use the tool to capture some scenario.
wpr -start profile.wprp
ScreenRecorder.exe -start
... excercise some scenario of interest ...
ScreenRecorder.exe -stop "D:\"
wpr -stop trace.etl
Now opening the trace in WPA, we can see the events produced by the tool in the Generic Events table under the ScreenRecorder provider. Each event contains the filename for the screenshot.