Home

Awesome

Capturinha

A tool for real time screen and audio recording on Windows, using NVIDIA's NVENC and with an emphasis on performance, correctness (eg. frame rate stability) and configurability. Mostly made for demoscene productions but you can use it with everything that's on your screen.

This is not a .kkapture successor. At least not yet. Mainly it's there to make the lives of demo party organizers - and other people who need a good video of their screen - easier.

Why

Yes, there are a lot of screen capture tools around, built into Windows and GPU drivers even, but during testing I found them all lacking. There are either commercial solutions where the "Free" tier is so bad it's pretty much unusable and doesn't inspire you to shell out money for the real product, and the solutions built into Windows or the graphics driver lack configuration options such as choosing a constant quality encoding mode or even what codec to use (let alone HDR support) - and all of them dropped frames like hot potatoes. So, having had some experience with graphics programming in general and with using NVENC and the FFmpeg libraries for encoding and muxing video and audio in particular, I thought "how hard can it be?"

Building

Prerequisites
Build

Usage

To run Capturinha you'll need at least Windows 10 (64 bit) version 1903 or later, and an NVIDIA graphics card. Your screen must be connected to that GPU, so sadly at the moment most laptops are out 😞

You'll be greeted by a configuration dialog. Select the screen you want to capture at the top, set up encoding and audio options in the middle, and choose an output directory, name and container format at the bottom.

Now press "Start" (or press Win-F9). Recording will begin immediately, or as soon as a program goes into fullscreen (and will pause when that program leaves fullscreen again). If the screen mode changes, the currently recording file will be closed and a new one will be opened.

Press "Stop" when you're done. That's basically it.

The current configuration gets stored in a file called config.json in the program directory.

About the settings

The codecs currently supported by NVENC are h.264 and HEVC (also known as h.265). If your graphics card isn't too old (older than let's say the GTX 900 series), HEVC is usually better in quality (per bitrate) as well as encoder performance, so if you haven't got a good reason to use h.264 (for example you want to encode for a device that only supports that), choose HEVC.

The 4:4:4 and Main10 profiles are choices for high quality encoding - 4:4:4 means no chroma subsampling and will result in a less washed out image when there's a lot of colorful high resolution detail, and the Main10 profiles will encode in 10 bits per color channel instead of 8. This even helps for 8 bit screens, as there is some slight loss of precision when converting from the screen's RGB into the YCbCr color space that the encoded video is stored in, so choosing 10 bits will reduce some banding artifacts. But beware that if you capture for uploading to a video streaming site, as far as I know none of them support these high quality settings, and the added fidelity will be lost (the files will upload and play just fine though) - so encoding in the "normal" profiles is good enough for that. Also you'll need at least a GTX 1060 to unlock these modes for HEVC.

Note that in order to capture a HDR screen, you need to use one of the two Main10 profiles.

The "Const QP" rate control mode encodes in constant quality while wildly varying the bitrate according to how much is happening on screen. The values go from 1 (best) to 52 (worst), and a value of 24 for h.264 and 28 for HEVC is already really good. Use this mode when you don't want to put a file directly onto the internet or play on limited/mobile devices - for presentation from a sufficiently powered machine, editing, archival, and uploading to video streaming sites (that transcode all incoming files anyway) Const QP is vastly preferred.

The frame layout option should be kept at "I+P" unless you want to radically edit the resulting file - "I", aka "I frames only", forgoes any "let's predict what the next frame could look like" magic and stores each frame as complete image. Perfect for editing but absolutely devastating for bitrate or file size. The GOP length determines how many P frames (as in "predicted") go between two I frames, aka how many frames go by until the decoder resets to a known state. Increasing this value helps with bitrate a lot but it makes it harder to edit or even seek in the files, and you might experience that the image drifts/washes away and then "comes back" every so and so seconds. When in doubt, leave at the default.

(No, B frames are currently not supported, simply because they don't help too much with the use cases Capturinha has, and can make playback worse)

The "Oldschool upscale" feature will scale up the captured screen in integer increments and without filtering until a target number of lines is reached or surpassed - eg. capturing a 640x480 screen with the option set to 2160 lines will result in a 3200x2400 sized video. That way you can upload your oldschool or low res productions or your freshly captured emulator run in a way that unlocks the good resolutions and bitrates on the video platform of your choice.

Tips

TODO:

(This is the point where I state that I'd really like people to contribute :) )

(also, not listed by priority)