nanaccel is a next-generation, high-performance video CLI tool and engine built in pure Rust, designed as a lightweight and zero-dependency competitor to FFmpeg for hardware-accelerated video decoding, rendering, and encoding on NVIDIA GPUs.
Unlike other software that wraps or spawns FFmpeg subprocesses, nanaccel is compiled into a single standalone binary that interacts directly with Windows Media Foundation (WMF), Direct3D 11, and NVIDIA NVENC APIs at the native C interface level.
- 0% CPU Decoder/Encoder Overhead: Video decoding, scaling, pixel format conversion, and encoding are kept entirely on the GPU. Zero frames are copied back to CPU memory during transcoding.
- No FFmpeg Subprocesses: Fully standalone engine with no dependency on local FFmpeg installations or external codecs.
- NVIDIA GPU Mandatory: Strict hardware checking. If a compatible NVIDIA GPU is not detected via
nvcudaornvidia-smiat startup, the program printsgpu not detectedand exits.
nanaccel/
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI workflow for builds & style checks
├── docs/ # Technical documentation
│ ├── architecture.md # Pipeline design and GPU flow diagram
│ ├── getting_started.md # Setup, requirements, and basic commands
│ └── shaders.md # HLSL Pixel Shader writing guide for video processing
├── src/
│ ├── main.rs # CLI router and live GPU telemetry reporter
│ ├── gpu_pipeline/ # Direct WMF NVDEC -> D3D11 VPP -> NVENC GPU pipelines
│ ├── commands/ # Modular subcommand parsing and handler functions
│ └── mux.rs # Native MP4 muxer for wrapping GPU stream packets
├── nanaccel-windows-x86_64/
│ ├── nanaccel.exe # Pre-built release binary
│ ├── grayscale.hlsl # Sample HLSL pixel shader
│ └── verify.py # Automated diagnostic python script
├── .gitattributes # Line-ending normalization
├── .gitignore # Dependency targets and workspace exclusions
├── Cargo.toml # Build configurations and dependency definitions
└── README.md # User manual and project description
To build the executable, ensure you have the Windows SDK and C++ Build Tools installed along with Rust and a compatible NVIDIA GPU Driver.
# Build the binary in release mode
cargo build --releaseThe compiled binary will be located at target/release/nanaccel.exe.
nanaccel exposes a wide range of GPU-accelerated video/audio subcommands:
Queries NVIDIA system telemetry for driver versions, active core utilization, VRAM metrics, power draw, and temperature:
nanaccel infoDecodes and presents video directly into a hardware-accelerated Direct3D 11 window at native frame rates:
nanaccel play path/to/video.mp4 [options]- Interactive Keyboard Controls:
Spacebar: Play / Pause the video playback.Esc/Q: Instantly close the player window and exit.
- Options:
-d, --decoder <decoder>: Specify a custom decoder.--no-audio: Disables audio rendering.--loop: Infinite loop playback.
Transcodes H.264 or HEVC inputs directly on the GPU, with optional hardware scaling and custom bitrates. Zero B-frames are used to maintain latency and prevent timing drift:
nanaccel transcode input.mp4 output.mp4 [options]- Options:
-c, --codec <codec>: Target video codec (h264,hevc). Default ish264.-p, --preset <preset>: NVENC preset configuration fromp1(fastest) top7(highest quality).-b, --bitrate <bitrate>: Target bitrate (e.g.5M,800k,3000000).--scale <width>x<height>: High-speed GPU resizing (e.g.1280x720).
Compile a custom HLSL pixel shader file dynamically and run it on the video stream entirely on the GPU:
nanaccel shader input.mp4 output.mp4 path/to/shader.hlslProcesses the video frame loop completely on the GPU: Decoder (NV12) $\rightarrow$ Video Processor (RGBA) $\rightarrow$ Shader RTV (RGBA) $\rightarrow$ Video Processor (NV12) $\rightarrow$ NVENC.
Records your primary desktop monitor directly using DXGI Desktop Duplication and NVENC ARGB encoding. The loop utilizes a self-correcting catch-up timer to capture at stable, accurate real-time speeds:
nanaccel record output_recording.mp4 [options]- Options:
--fps <fps>: Target frame rate (e.g.30,60). Default is60.-b, --bitrate <bitrate>: Target encoding bitrate (e.g.10M,4M). Default is8M.-d, --duration <seconds>: Recording duration limit in seconds. Default is5.
Decodes a specific frame on the GPU and saves it directly to a high-fidelity image file using Windows Imaging Component (WIC):
nanaccel screenshot input.mp4 output.png [options]- Options:
-t, --time <ms>: Timestamp in milliseconds (default: 0).- Supported output formats:
PNG,JPEG,BMP,TIFF,WebP,GIF,HEIF,AVIF.
Performs native digital signal processing (DSP) on audio tracks using Symphonia for decoding and writes to a WAV format output:
nanaccel audio <operation> input.mp3 output.wav [options]- Available Operations:
volume(volume-control)denoise(noise-reduction)compress(compression)limit(limiter)eq(equalizer)pitch(pitch-shift)tempo(tempo-change)reverbechobass(bass-boost)silencedetect(silence-detection)normalize(audio-normalization)
- Options:
--volume <val>: Volume multiplier or decibel adjustment (e.g.1.5or-6dB).--nr <val>: Noise reduction strength parameters.--threshold <val>: Noise gate or compressor threshold (e.g.-21dB).--ratio <val>: Compressor dynamic ratio (e.g.3:1).--limit <val>: Hard limiter threshold amplitude limit (e.g.0.1).--gain <val>: Equalizer frequency gain (dB).--freq <val>: Target equalizer frequency.--pitch <val>: Pitch shifting multiplier factor (e.g.1.2).--tempo <val>: Tempo scaling factor (e.g.0.9).--silence-db <val>: Silence detection threshold (e.g.-50dB).--silence-duration <val>: Silence duration threshold in seconds (e.g.2.0).
Combines video and audio streams together into a single ISO-MP4 container with zero transcoding overhead:
nanaccel mux --video input_video.mp4 --audio input_audio.mp3 --output output_muxed.mp4Overlays image watermarks or logos directly on the GPU canvas using Direct3D 11 compositing:
nanaccel overlay input.mp4 output.mp4 path/to/logo.png [options]- Options:
-p, --position <pos>: Target position coordinates (e.g.10:10).-t, --type <type>: Overlay configuration type (logo,watermark).
Manage container-level subtitle tracks natively:
nanaccel subtitle <operation> input.mp4 output [options]- Operations:
extract,convert,burn,sync,merge,remove. - Options:
-s, --sub-file <file>: Path to external subtitle file (.srt,.vtt).-t, --track <index>: Index of target subtitle track.--shift <ms>: Shift timing offset delay in milliseconds.
GPU-based video editing triggers:
nanaccel edit <operation> input.mp4 output.mp4 [options]- Operations:
trim,cut,split,join,concat,crop,rotate,flip,scale,stabilize,denoise,sharpen,deblock,deinterlace,reverse,loop,fade,crossfade,overlay,watermark.
High-speed GPU pixel color space conversion and grading:
nanaccel color <operation> input.mp4 output.mp4 [options]- Operations:
hdr2sdr,sdr2hdr,lut,gamma,grading,colorspace,whitebalance,adjust,tonemap. - Options:
--lut-file <file>: 3D LUT grading file path.--brightness <val>,--contrast <val>,--saturation <val>: Grade parameters.
This project is licensed under the MIT License - see the LICENSE file for details.
