A highly customizable, Node.js screen & audio recorder.
- Record & capture your whole desktop
- Save recordings in various formats (MP4, MOV, MKV etc.)
- Adjustable frame rate, resolution, bitrate and much more
- Audio recording from microphone and/or system sound
npm install vidclip
yarn add vidclip
pnpm add vidclip
bun add vidclip
Here's a quick example on how to use the basic features of this package. Read the Vidclip Documentation for a full guide.
Make sure you have installed the package first.
const { Recorder } = require('vidclip');
// or if you use ESM:
import { Recorder } from 'vidclip';
Here's a simple usage of the start()
function:
const recorder = new Recorder({
resolution: '1920x1080', // {width}x{height}
frameRate: 30, // one of 24, 30, 60 and 120
fileFormat: 'mp4', // one of mp4, mov, wmv, avi and mkv
audioSource: 'Stereo Mix (Realtek(R) Audio)', // one of your enabled audio devices
outputFile: 'recordings/recording.mp4', // any directory you want to store the video (inside the current directory)
replaceExisting: true, // replace an existing file?
verbose: false, // output necessary logs into the console?
rateControl: { mode: 'crf', value: 18 }, // one of crf, cq, bitrate, and qp
codec: 'libx264', // one of libx264, libx265, libvpx-vp9, h264_nvenc, hevc_nvenc, h264_qsv, hevc_qsv, and hev264_amf
preset: 'fast', // one of placebo, veryslow, slower, slow, medium, fast, faster, veryfast, superfast, and ultrafast
pixelFormat: 'yuv420p', // one of yuv420p, yuv422p, yuv444p, rgb24, gray, and nv12 (yuv420p highly recommended)
});
recorder.start({
stopAfter: 5, // how long for the recording to run (in seconds)
});
/* an alternative:
*
* setTimeout(() => {
* recorder.stop(); // forcefully stop by using SIGKILL
* }, 5000);
*/
To contribute, first read the CONTRIBUTING.md file. Then, fork the repository, apply your changes, and create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.