| Crates.io | nvenc |
| lib.rs | nvenc |
| version | 0.1.0 |
| created_at | 2026-01-01 22:27:54.3938+00 |
| updated_at | 2026-01-01 22:27:54.3938+00 |
| description | Wrapper for the nvidia NVENC API |
| homepage | |
| repository | https://github.com/AlsoSylv/nvenc |
| max_upload_size | |
| id | 2017633 |
| size | 1,556 |
The following example is for Linux GLX
use nvenc::{session::Session, encoder::Encoder};
fn main() {
// Setup GLX context
let session: Session<NeedsConfig> = Session::open_gl();
let (session, config): (Session<NeedsInit>, NVencPresetConfig)
= session.get_preset_config(
NV_ENC_CODEC_H264_GUID,
NV_ENC_PRESET_P3_GUID,
NVencTuningInfo::LowLatency
);
let init_params = nvenc::session::InitParams {
encode_guid: NV_ENC_H264_GUID,
preset_guid: NV_ENC_PRESET_P3_GUID,
resolution: [1920, 1080],
aspect_ratio: [16, 9],
frame_rate: [30, 1],
tuning_info: NVencTuningInfo::LowLatency,
buffer_format: NVencBufferFormat::ARGB,
encode_config: &mut config.preset_cfg,
enable_ptd: true,
};
let encoder: Encoder = session.init(init_params);
}