Record your monitors screen and save it into a video file in Windows 10.
Output file format is a mp4
of very high quality at 30 fps.
Output filename is the current date time appended with .mp4
.
Output is written at the current working directory (cwd) where the script was executed.
ffmpeg uses the gdigrab, a Win32 GDI-based screen capture device.
This script does not do anything beside calling ffmpeg
with the right parameters to record video and output it so that you don't have to learn how to use FFmpeg's interface. The full source is 100 lines long and is well written.
Install FFmpeg and then run record.js
script with Nodejs to start recording. Send CTRL+C
to the terminal to stop recording.
You may also manually press "q" followed by enter to send "quit" command to ffmpeg to stop recording.
The output uses the ffmpeg's default encoder for mp4 (very high quality).
A video in a single 4k monitor setup should yield:
- a 60 seconds video is roughly 8 MB
- a 60 minutes video is roughly 500 MB
- a 12 hours video is roughly 5 GB
- Run
node record.js
on your terminal to start this program. - The
ffmpeg
process will be started with specific parameters configured by this program. - The parameters will instruct the FFmpeg tool to record full screen and save to a local file.
- FFmpeg will tell you that your screen is being recorded and keep printing data about it (frames / duration / etc)
- When you're done recording your screen get the terminal in focus and
CTRL+C
it to stop recording ffmpeg
process will receive SIGINT and will (hopefully) close the file correctly and exit after a few seconds- If the exit fails, press
CTRL+C
4 times to forcefully stop it (might corrupt your output file)
None.
None.
Node.js must be installed in the system. FFmpeg must be installed in the system.
For windows, you can download it here: https://github.com/BtbN/FFmpeg-Builds/releases
For linux, you can download it here: https://ffmpeg.org/download.html
This is open-source, as is FFmpeg.
It takes less than 1 minute to read the code and conclude it is safe and does what you think it does.
FFmpeg is a command-line program that records, converts and creates video streams in multiple formats.
By changing the parameters sent to the process you can configure how it behaves.
Example:
- You want to record a 1920 x 1080 (FHD) region on your display starting from the origin (0,0 / top left of primary monitor)
- Search the available input parameters
- It seems that the -offset_x
, -offset_y
, and -video_size
parameters are useful.
- Change record.js
to add the parameters (line 25)
- You need to add -offset_x 0 -offset_y 0 -video_size 1920x1080
- In javascript, we have:
let child = cp.spawn("ffmpeg2", [
"-f", "gdigrab",
"-i", "desktop",
"-offset_x", "0",
"-offset_y", "0",
"--video_size", "1920x1080",
"-framerate", fps.toString(),
getFullFileName(),
]);
None.
Do what you think is fair.
I want to help the world by writing software. More specifically by decreasing the time between these two events in a person's life:
- found a software to solve my problem
- am using the software to solve the problem