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

#77 in Video

Download history 95/week @ 2025-01-26 25/week @ 2025-02-02 731/week @ 2025-02-09 277/week @ 2025-02-16 260/week @ 2025-02-23 526/week @ 2025-03-02 1161/week @ 2025-03-09 188/week @ 2025-03-16 1470/week @ 2025-03-23 1251/week @ 2025-03-30 1362/week @ 2025-04-06 1023/week @ 2025-04-13 953/week @ 2025-04-20 894/week @ 2025-04-27

4,468 downloads per month
Used in vvdecli

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
~64K SLoC