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

#88 in Video

Download history 1300/week @ 2025-09-27 858/week @ 2025-10-04 1163/week @ 2025-10-11 701/week @ 2025-10-18 1589/week @ 2025-10-25 1390/week @ 2025-11-01 1145/week @ 2025-11-08 1727/week @ 2025-11-15 1431/week @ 2025-11-22 1541/week @ 2025-11-29 1410/week @ 2025-12-06 1573/week @ 2025-12-13 1181/week @ 2025-12-20 1044/week @ 2025-12-27 976/week @ 2026-01-03 795/week @ 2026-01-10

4,423 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