vidr

App New

GPU video library on numr and boostr: NVDEC, NVENC and Vulkan Video for H.264, HEVC, AV1 and VP9, CPU decoders, MP4 and MKV through containr, frames as GPU tensors, and vidr-remaster for restoration and upscaling, run on real clips.

Checked · Sources

Downloads
30
Dependents
Not applicable
Stars
0
Forks
0
Contributors
1
Commits
52
Latest release
0.1.1 ·

About

From the project README ·

Video in Rust. A library first, with GPU and CPU paths.

Decode, run models, and encode video in one process. On a hardware path, frames stay in GPU memory. Every codec, container, and model is a Cargo feature, so an application links only what it uses. Model weights load at run time from a directory, and no weights are compiled in.

Status · Build · Run · Crates · vidr-remaster · CPU codecs · Scope · Contributing

vidr is a video library for Rust: decode, encode, colour handling, and neural-network frame processing, built on numr tensors and boostr models. A frame is a numr tensor. A codec and a neural network both read and write that buffer. It needs no Python.

voxr is the audio counterpart. Together they target the work an application hands to the ffmpeg command line and an inference engine. Scope lists what is still planned.

decode (hardware or CPU) → models → encode → mux

The library is the main product. vidr-remaster, a command that restores and upscales a whole video, is its first use case.

Read the full README
Where the work happens
  • Hardware codecs: NVDEC and NVENC on NVIDIA, and Vulkan Video, through numr's CUDA and WebGPU backends.
  • Native libraries: CPU H.264 wraps OpenH264, and CPU AV1 decode wraps libdav1d. Both are C or C++ code that Rust calls.
  • Rust: CPU HEVC decode, CPU VP9 decode, and CPU AV1 encode (through rav1r) run in Rust.
  • Containers: MP4, MOV, Matroska, and WebM go through containr.
Not supported yet
  • VA-API, and any AMD or Intel GPU run of Vulkan Video.
  • H.264 on the CPU above Baseline, and any CPU HEVC encode.
  • VP9 encode, on any path.
  • Vulkan Video AV1 encode. It is written and has never run on a GPU.
  • Fragmented MP4 input, HDR, interlaced video, and a filter graph.

Scope and Refusals hold the full lists.

Install
cargo add vidr --features dav1d,mp4

dav1d needs libdav1d 1.3.0 or newer, found through pkg-config. For a runnable library example, see crates/vidr/examples/hevc_decode.rs. Run it with cargo run --release -p vidr --features cpu-hevc --example hevc_decode -- FILE.h265.

Status

In development. See Build.

Decode

All paths are 4:2:0.

CodecNVIDIA (nvdec)Vulkan Video (vulkan-video)CPU
H.2648 or 10 bits8 bits. Baseline, Main, High8 bits, Baseline only (openh264, openh264-cisco)
HEVC8 or 10 bits8 or 10 bits. Main, Main 10, Main Still Picture8 or 10 bits. Main, Main 10 (cpu-hevc)
VP98 or 10 bits8 or 10 bits. Profiles 0 and 28 or 10 bits. Profiles 0 and 2 (cpu-vp9)
AV18 or 10 bits8 or 10 bits. Main8 or 10 bits (dav1d)
Encode

All paths are 4:2:0.

CodecNVIDIA (nvenc)Vulkan Video (vulkan-video)CPU
H.2648 bits. 10 bits on a GPU that lists it8 bits, High8 bits, Constrained Baseline (openh264, openh264-cisco)
HEVC8 bits. 10 bits on a GPU that lists itMain. Main 10 where the driver lists itNone, by decision
VP9NoneNoneNone
AV18 bits. 10 bits on a GPU that lists itNever run. Refused by name with no VK_KHR_video_encode_av18 or 10 bits (cpu-av1, cpu-av1-asm)

Vulkan Video encode uses one previous frame as the reference, and an IDR picture at gop_length. It refuses B-frames by name.

What has run

All of this ran on one NVIDIA GPU with NVIDIA's driver. No AMD or Intel GPU has run any of it.

PathChecked with
NVDEC, NVENCA real clip with all three models. No test covers NVENC AV1
Vulkan Video decodeA real clip, plus the HEVC_v1, libvpx VP9, and libaom AV1 test vectors, with no decode error
Vulkan Video encodeA real clip, H.264 and HEVC
dav1dThe libaom AV1 test vectors
cpu-vp9The libvpx VP9 test vectors
cpu-hevcThe HEVC_v1 test vectors
cpu-av1, openh264Tests in this repository, with no conformance set

Limits of the Vulkan Video runs:

  • Streams past a driver limit, and AV1 monochrome, are refused by name.
  • Only one driver mode has run: reference and output pictures sharing one image.
  • No validation layer has run.
ModelCUDA, per 1080p frameWebGPU, per 1080p frame
fastAbout 0.22 sAbout 4 s, with no host copy
realesrganRan, not timed hereHas not run
purevisionRan, not timed hereHas not run

Times are wall-clock. --from-upscaled also ran on WebGPU, with Vulkan decode and a CPU encoder.

Also working
CapabilityFeature
Frame timing model and output checksNone
Bitstream filtersh264, hevc, av1
Conversion between NV12 or P010 planes and float RGBframe
SDR colour policydecode
MP4, MOV, Matroska, and WebM inputmp4, mkv
One-pass MP4 and MKV output, with other streams copied and checkedmp4, mkv
Threaded decode, transform, and encode pumppipeline
The vidr-remaster commandSee Build

AGENTS.md holds the full implemented-vs-roadmap table.

Crates

CrateWhat it holds
vidrVideo codecs, hardware decode and encode, frame timing, and colour management
vidr-remasterThe vidr-remaster command: restoration, upscaling, scaling, and encoding of a whole video in one pass

vidr-remaster

vidr-remaster runs a restoration model over a whole video, resizes it, and encodes it. One command writes one output.

Build

Cargo fetches numr, boostr, containr, and rav1r from crates.io.

Pick one row, then run cargo build --release -p vidr-remaster --features <features>.

Machine<features>Also needsReads
NVIDIA GPUcuda,mp4,mkv,model-srvgg,model-rrdbnvcc at build time, and driver support for NVENC API 13.1H.264, HEVC, VP9, AV1
GPU with Vulkan Videovulkan-video,mp4,mkv,model-srvgg,model-rrdbA driver that lists the video extensions. Tested on NVIDIA onlyH.264, HEVC, VP9, AV1
No GPUmp4,dav1d,cpu-av1,model-srvgglibdav1d 1.3.0 or newer, through pkg-configAV1 only
  • CPU codecs. A CPU build holds only the codecs its features name. Add cpu-hevc, cpu-vp9, or openh264 to read other sources. See CPU codecs.
  • Mixed builds. Add a CPU codec to a hardware build to cover what the hardware leaves out.
  • Incomplete builds. A build with no container, decoder, or encoder reports which features it lacks.
Run

Put the model directories under one root, named as in Models. Pass the root with --models-dir, or set VIDR_MODELS_DIR.

# NVIDIA or Vulkan Video build
target/release/vidr-remaster clip.mp4 --model fast --models-dir ~/models

# No-GPU build: no CPU HEVC encoder exists, so pass --codec av1
target/release/vidr-remaster clip.mp4 --model fast --models-dir ~/models --codec av1

The default --model is purevision, and its licence forbids commercial use. See Models.

The output is clip.fast.restored.mp4 beside the source. It keeps the source's frame count, frame timing, last-frame duration, rotation, and aspect ratio. Audio, text subtitles, chapters, and metadata copy with no transcode. A mismatch in the output check is an error, and no output publishes.

Flags
FlagValueDefault
INPUTThe source videoRequired
--modelfast, realesrgan, purevisionpurevision
-o, --outputThe output path, .mp4 or .mkv<stem>.<model>.restored.mp4
--models-dirThe model root$VIDR_MODELS_DIR
--qualityEncoder quality, 1 to 51, lower is better24
--codechevc, h264, av1hevc
--runtimeauto, cuda, wgpu, cpuauto
--decoderauto, nvdec, vulkan, cpuauto
--encoderauto, nvenc, vulkan, cpuauto
--openh264-libraryCisco's OpenH264 binary, with openh264-ciscoNone
--resolutionauto, original, 2x, 480, 720, 1080, 1440, 2160, 4320auto
--overwriteReplaces an existing outputOff
--from-upscaledResizes this enhanced video, with no model passNone
--force-aiRuns the model even when a matching 2x output existsOff
--noticesPrints the licence notices of this buildOff

--resolution sets the shorter edge. auto takes the largest standard edge at or below the source's. The shorter edge never falls below 480.

Reusing an earlier output

Without --force-ai or --from-upscaled, a run looks beside the source for <stem>.<model>.2x and <stem>.<model>.restored, .mp4 or .mkv.

CandidateResult
Exactly twice the source's size, with a matching .upscale.json sidecarReplaces the model pass
Missing or mismatched sidecarStops the run. The error names both flags
Sidecar names another encoderStops the run. The error names both flags
Execution
RuntimeDecodersEncoders
cudaNVDEC, CPUNVENC, CPU
wgpuVulkan Video for H.264, HEVC, VP9, and AV1, CPUVulkan Video for H.264, HEVC, and AV1, CPU
cpuCPUCPU

How auto chooses:

  • Order. CUDA, then WebGPU, then the CPU. A hardware codec comes before a CPU codec.
  • Missing library or device. auto falls through, with the reason in the report.
  • Hardware refusal. auto falls through. This covers H.264 slice groups, data partitioning, a frame_num gap, field coding, and bit depth.
  • Stalled GPU queue. The run ends. The error names the stall.

Other choices:

  • Explicit hardware codec. --decoder nvdec, --decoder vulkan, --encoder nvenc, or --encoder vulkan never falls through. The error names what is missing.
  • Pair outside the table. The run is refused. The error names both sides and the pair that works.

The output check decodes the output, in this order:

  1. The run's decoder, when it reads the output codec.
  2. The runtime's hardware decoder.
  3. The CPU decoder of that codec.

With no such decoder, the run stops before any work.

RuntimeFrame copiesModel precision
cudaNo host copy on NVDEC or NVENCF16
wgpuOne device-to-device copy per plane on Vulkan Video, with no host copyF32
cpuOne host copy per frameF32

A CPU codec on any runtime copies each frame through host memory. A run states its copies on one line of stdout.

report.json holds frame_path:

  • the runtime
  • each codec and route
  • the output check's decoder
  • the host copies of the encode pass and of the scans
  • why each part was chosen
Models

Each directory under the model root holds one .pth file.

--modelDirectoryNetworkLicence of the weightsCargo feature
fastrealesr-general-x4v3SRVGGNetCompactBSD-3-Clausemodel-srvgg
realesrganRealESRGAN_x2plusRRDBNetBSD-3-Clausemodel-rrdb
purevision2x_PureVisionRRDBNetCC-BY-NC-SA-4.0model-rrdb

The purevision licence forbids commercial use and requires share-alike. The default model is purevision, so pass --model for commercial work. A run's report states this notice. A missing model's error names the expected path and the download URL. The command downloads nothing.

Refusals

Each refusal ends the run with exit code 1 and leaves no output.

The source

RefusedWhyNext action
HDR, in the bitstream or the container tagsThe colour policy covers SDR onlyUse an SDR source, or tone-map it first
Interlaced or MBAFF-coded framesThe frame transform needs progressive framesDeinterlace the source first
Fragmented MP4containr does not read itRun ffmpeg -i <input> -c copy <output.mp4>
A size, pixel format, or colour change inside the videoA run holds one conversion and one encoder sessionSplit the source at the change
Nonincreasing pts, or a frame count unlike the packetsThe output check needs one frame per packet, in orderRepair or remux the source
A Matroska crop or ContentEncodingNVDEC applies neitherRemux or re-encode the source
More than one MP4 sample descriptionA decoder takes one config recordSplit or transcode the source
An H.264 source that is not Baseline, on OpenH264OpenH264's B-slice output differs from the referenceUse NVDEC or Vulkan Video, or re-encode as Baseline

The output

RefusedWhyNext action
A 10-bit source with --codec h264OpenH264 and Vulkan Video encode H.264 at 8 bits. NVENC refuses it when the GPU lists no 10-bit supportPass --codec hevc, or --codec av1 on the CPU
HEVC with a CPU encoderNo CPU HEVC encoder exists here, by decisionPass --codec av1
Attachments or ASS subtitles into .mp4MP4 has no form for themWrite .mkv
An existing outputA run replaces a file only on requestPass --overwrite, or choose another path
A candidate from another encoderThe sidecar names another encoderPass --from-upscaled or --force-ai
A codec, a runtime, or --openh264-library not in the buildThe feature is offRebuild with the feature the error names

Vulkan Video encode

RefusedWhyNext action
--runtime cuda, or a pairing with NVDEC or NVENCIts frames live on WebGPU tensorsPass --runtime wgpu, with Vulkan Video or a CPU codec on each side
B-framesOne previous frame is the referencePick another encoder
An odd size4:2:0 needs even sidesScale the frames, or pick another encoder
A size outside the driver's rangeThe driver sets the rangeScale the frames, or pick another encoder
AV1, on a driver with no VK_KHR_video_encode_av1The driver lists no such queue operationPass --encoder cpu with cpu-av1, or --codec hevc

Vulkan Video decode

Use another decoder for every row. A further option appears where one exists.

RefusedWhyFurther option
--runtime cuda, or a pairing with NVDEC or NVENCIts frames live on WebGPU tensorsPass --runtime wgpu
H.264 slice groups or data partitioningVulkan Video has no form for themRe-encode
An H.264 frame_num gapvidr does not infer missing framesRe-encode
An H.264 IDR picture with no_output_of_prior_pics_flag 1, or a new size or max_dec_frame_bufferingITU-T H.264 C.4.4 removes waiting frames, so frames no longer match packetsRe-encode
An HEVC picture that binds a reference the DPB lacksVulkan Video activates a DPB slot only through a decodeStart at an earlier IRAP picture
A VP9 frame that grows past its session and keeps referencesA new session holds none of the referencesCall VulkanDecoder::with_max_coded_size in library code
An AV1 frame under the driver's smallest coded sizeEach frame checks against what the driver listsNone
AV1 film grain with no filmGrainSupport profileEach frame checks against what the driver listsNone
An AV1 frame that reads a reference its ref_order_hint states as lostNo slot can stand in for the lost frameStart at a key frame
AV1 in Annex B framingvidr reads the low-overhead formatRun ffmpeg -i INPUT -c copy -f obu OUTPUT
AV1 large-scale tile codingvidr has no tile list decodeNone
Results
Exit codeMeaning
0The output and its sidecar are in place. A report that does not write gives a warning
1A refusal, an error, or a final output whose sidecar did not land. The error names both paths
130A signal stopped the run. The temporary output is gone

The first Ctrl-C, SIGTERM, or SIGHUP asks the run to stop at the next frame. A second one removes the temporary output and ends the process.

report.json goes under $XDG_STATE_HOME/vidr-remaster/upscale-<run id>/, else ~/.local/state. Every run past validation writes one.

CPU codecs

A CPU codec works in host memory, so each frame takes one copy through it. The run report states the copy. In library code, FrameRoute on the decoder or encoder declares it.

Every feature here is off by default. vidr-remaster has a feature of the same name for each codec. Select the codec with --decoder cpu, --encoder cpu, or auto.

CodecFeatureDirectionBit depth, chromaCrateLicence
AV1dav1dDecode8, 10, 4:2:0libdav1d through dav1dBSD-2-Clause
AV1cpu-av1, cpu-av1-asmEncode8, 10, 4:2:0rav1rBSD-2-Clause
VP9cpu-vp9Decode8, 10, 4:2:0rusty_vp9Apache-2.0
HEVCcpu-hevcDecode8, 10, 4:2:0This crateApache-2.0
H.264openh264, openh264-ciscoDecode, encode8, 4:2:0OpenH264 through openh264BSD-2-Clause

cpu-av1-asm needs NASM 2.15 or newer on x86_64, or a C compiler on aarch64.

Shipping a binary

These notes state what a binary distribution needs. They are not legal advice.

FeatureCondition
cpu-av1Reproduce the Alliance for Open Media Patent License 1.0 and the BSD licence text in documentation, legal notices, or other written materials
dav1dAV1 has patent terms. Get legal review
cpu-vp9VP9 has a patent pool. Get legal review
cpu-hevcHEVC has patent pools. Get legal review
openh264A source build gets no Cisco patent cover
openh264-ciscoCisco's cover applies only to its own binary. This feature loads it from a path the caller supplies
  • rav1r. rav1r is a fork of rav1e, under the BSD-2-Clause licence and the Alliance for Open Media Patent License 1.0. rav1r's PATENTS file holds the patent licence. Section 1.3 ends it for a licensee that sues over an Implementation, with two stated exceptions.
  • Notices. vidr-remaster --notices prints the text of each codec in the build. crates/vidr-remaster/notices/ holds each text unchanged, and the crate package includes that directory.
  • rusty_vp9. It stays pinned to one release. CONTRIBUTING.md holds the libvpx conformance run.

Scope

These are planned, and none of them works yet.

AreaPlanned
Hardware codecsVA-API
Software codecsH.264 above Baseline
ContainersFragmented MP4 input, through containr
ColourBT.2020 matrices, HDR10 and HLG, tone mapping
FiltersA filter graph: scaling, cropping, deinterlacing, frame-rate conversion, denoising, and deblocking
ModelsTemporal restoration, frame interpolation, and any vision model boostr runs
DistributionMulti-GPU processing over nexar

Minimum Rust version

1.95.

Contributing

Contributions are welcome. See CONTRIBUTING.md for conventions and checks.

Questions and design discussion happen on Discord.

License

Licensed under Apache-2.0. See LICENSE.

Runs on
CUDA, WebGPU, Vulkan
What shows it
  • CUDA: vidr feature nvdec (dependency cudarc), vidr-remaster feature cuda
  • WebGPU: vidr feature vulkan-video (dependency wgpu), vidr-remaster feature wgpu
  • Vulkan: vidr feature vulkan-video (dependency ash)
Native code
Optional
  • Binds native code: dav1d-sys (feature dav1d)
Python bindings
No Python binding crate found
License
Apache-2.0

Compare with similar projects

Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days.

vidr beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
vidr This page App New

GPU video library on numr and boostr: NVDEC, NVENC and Vulkan Video for H.264, HEVC, AV1 and VP9, CPU decoders, MP4 and MKV through containr, frames as GPU tensors, and vidr-remaster for restoration and upscaling, run on real clips.

30 downloads over 30 days Not applicable 0 0.1.1 CUDA, WebGPU, Vulkan Binds native code: dav1d-sys (feature dav1d) Apache-2.0

Media containers for vidr and voxr: reads and writes MP4, MOV, Matroska and WebM, with integer timestamps and raw edit lists.

206 downloads over 30 days 2 0 0.1.1 GPU support unknown No native code found Apache-2.0
rav1r New

AV1 encoder derived from rav1e, used by vidr. Its output stays bit-exact with upstream.

56 downloads over 30 days 1 0 0.1.1 GPU support unknown Binds native code: aom-sys (feature decode_test), libdav1d-sys (feature decode_test_dav1d). Build uses a native toolchain: cc (feature asm) BSD-2-Clause
Why NewIts first release on 5 Nov 2026 is under 180 days old.

The check tests the Featured gates once the first release passes this age limit.

What else the check found

  • The last activity is on 6 Nov 2026, 3 days ago. The rules expect an update within 365 days. Dormancy rule

Exact rules: New. The check on applied thresholds version 9.

Every rule outcome, as the check records it
  • expected-interval: app: E = 365 days
  • dormancy: last activity 2026-11-06, 3 days ago, E = 365: active
  • new: new: first release 2026-11-05 is under 180 days old
Crates2 crates

Measurements and sources

Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.

Sources6 sources
Adoption0 binary downloads per release4 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependentsNot measuredYes
New dependents (365 days)Not measuredYes
Peak active dependentsNot measuredYes
Active dependents as a share of the peakNot measuredYes
Binary downloads per release0GitHub releasesYes
MaintenanceLatest human commit: 3 days ago4 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-11-06GitHub repositoryYes
Latest release2026-11-06GitHub releasesYes
First release2026-11-05GitHub releasesYes
Latest version0.1.1crates.io database dumpNo
Days the oldest outside issue waits for a reply0GitHub repositoryYes
Maintainer replies over 365 days0GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageNo
Published docsNot measuredYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityNot measured
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windowNot measuredYes
RustSec unmaintained advisoryNot measuredYes
Deprecation noticeNot measuredYes
Deprecated requirementNot measuredYes
Distribution2 releases, 30 downloads over 30 days6 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases2crates.io database dumpNo
Downloads over 30 days30crates.io database dumpNo
Binary downloads over the last 3 releases0GitHub releasesYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedNot measuredYes
Crate deleted from crates.ioNot measuredYes
Repository0 stars, 0 forks, 1 contributors, 52 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars0GitHub repositoryYes — one part of the repository route
GitHub forks0GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account1GitHub contributorsYes — one part of the repository route
Commits on the default branch52GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseApache-2.0crates.io database dumpNo
Runs on, from listed crates and their direct dependenciesCUDA, WebGPU, Vulkancrates.io database dumpNo
What shows each backendCUDA: vidr feature nvdec (dependency cudarc), vidr-remaster feature cuda; WebGPU: vidr feature vulkan-video (dependency wgpu), vidr-remaster feature wgpu; Vulkan: vidr feature vulkan-video (dependency ash)crates.io database dumpNo
Native code, from listed crates and their dependenciesBinds native code: dav1d-sys (feature dav1d)crates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directlyNot measuredNo

Corrections and review history

Report a correction

No correction applies to this entry.

Judgments

A judgment enters only through an approved issue and a merged pull request.

No judgment applies to this entry.