24 releases

0.7.1 Feb 12, 2025
0.6.11 Apr 22, 2025
0.6.10 Mar 6, 2025
0.5.1 Nov 9, 2023
0.1.0 Jul 16, 2023

#79 in Video

Download history 1333/week @ 2025-09-14 1062/week @ 2025-09-21 1247/week @ 2025-09-28 874/week @ 2025-10-05 1243/week @ 2025-10-12 819/week @ 2025-10-19 1471/week @ 2025-10-26 1277/week @ 2025-11-02 1250/week @ 2025-11-09 1663/week @ 2025-11-16 1408/week @ 2025-11-23 1601/week @ 2025-11-30 1421/week @ 2025-12-07

6,242 downloads per month
Used in 2 crates

BSD-3-Clause-Clear

2MB
40K SLoC

C++ 39K SLoC // 0.2% comments Rust 623 SLoC // 0.0% comments JavaScript 244 SLoC // 0.0% comments Python 57 SLoC // 0.1% comments

Rust bindings for VVdeC

This crate provides Safe Rust bindings for VVdeC.

A simple VVC decoder application can be implemented using the snippet below as a starting point:

use vvdec::{Decoder, Error, Frame, PlaneComponent};

fn main() -> Result<(), Error> {
    // You can also use Decoder::builder() if customizations are needed.
    let mut decoder = Decoder::new()?;

    // Process incoming VVC input bitsteram
    while let Some(data) = get_input_data() {
        decoder.decode(data)?.map(process_frame);
    }

    // Flush at the end
    while let Some(frame) = decoder.flush()? {
        process_frame(frame);
    }

    Ok(())
}

fn get_input_data() -> Option<&'static [u8]> {
    return Some(&[0; 64]); // Replace this with real VVC bitstream data.
}

fn process_frame(frame: Frame) {
    // Use decoded frame
    let y_plane = frame.plane(PlaneComponent::Y).unwrap();
    let y_plane_data: &[u8] = y_plane.as_ref();
    // ...
}

Vendored build

If VVdeC is not installed in the system, a vendored copy will be built, which requires CMake.


VVdeC-rs

Rust bindings for VVdeC.

Sub-projects:

  • vvdec-sys: unsafe bindings generated by bindgen
  • vvdec: the safe bindings on top of vvdec-sys
  • vvdecli: CLI application using the safe bindings to decode VVC Annex-B files into YUV4MPEG (Y4M).

Installing the CLI

In order to build, either VVdeC >= 3.0 needs to be installed and be found via pkg-config, or a VVdeC will be compiled while building vvdec-sys, which requires CMake.

Then, the CLI app can be installed with cargo install vvdecli.

If you have FFmpeg installed, you can then test vvdecli and play VVC with

vvdecli -i ./tests/short.vvc | ffplay -

License

This crate is license under the BSD-3-Clause-Clear license, to maintain compatibility with VVdeC's license.

Dependencies

~0.2–3MB
~63K SLoC