Savant Explained: Software Video Encoder

When we develop Savant, we keep in mind that pipelines work in accelerated environments backed with specialized hardware. However, recently Nvidia stepped out of providing end-to-end acceleration in certain products. Specifically, Jetson Orin Nano, Nvidia Tesla A100, and Nvidia Tesla H100 don’t include hardware-accelerated video encoder devices (NVENC).

That is the reason why we also decided to implement the support of a pure CPU encoder for the resulting video. Of course, such an implementation has certain limitations from the performance perspective, but it at least makes it possible to encode streams conditionally, which is another part of the implementation.

Also, the feature benefits desktop-grade GPUs based on the GeForce family: they also have limitations related to NVENC concerning the number of simultaneously encoded streams (from 3 to 5, depending on the usage specifics).

Implementation Details

In the previous versions of Savant, we already had software encoders, but for JPEG and PNG images only. In the current development branch and the future 0.2.5 release, we introduced a configuration variable defining what sort of encoder is used for video:

output_frame:
    codec: h264
    encoder: nvenc

or

output_frame:
    codec: h264
    encoder: software

The feature only affects H264 and JPEG, enabling x264enc instead of nvv4l2h264enc and jpegenc instead of nvjpegenc accordingly.

Also, Savant uses a best-effort strategy choosing the most performant encoder among supported.

Consider visiting our GitHub, and don’t forget to subscribe to our Twitter (X) to receive updates on Savant. Also, we have Discord, where we help users to onboard.