#codec #codecs


Hardware-accelerated codecs for Linux

4 releases

0.0.4 Aug 1, 2023
0.0.3 Jul 26, 2023
0.0.2 May 1, 2023
0.0.1 Apr 28, 2023

#18 in Multimedia

Download history 835/week @ 2023-08-01 933/week @ 2023-08-08 849/week @ 2023-08-15 797/week @ 2023-08-22 730/week @ 2023-08-29 864/week @ 2023-09-05 949/week @ 2023-09-12 768/week @ 2023-09-19 639/week @ 2023-09-26 430/week @ 2023-10-03 618/week @ 2023-10-10 585/week @ 2023-10-17 522/week @ 2023-10-24 1654/week @ 2023-10-31 909/week @ 2023-11-07 861/week @ 2023-11-14

4,096 downloads per month


18K SLoC


A lightweight, simple, low-dependency, and hopefully safe crate for hardware-accelerated video decoding and encoding on Linux.

It is developed for use in ChromeOS (particularly crosvm), but has no dependency to ChromeOS and should be usable anywhere.

This crate is still under heavy development and is not recommended for use yet.

Current features

  • Simple decoder API,
  • VAAPI decoder support (using cros-libva) for H.264, VP8 and VP9.

Planned features:

  • Stateful V4L2 decoder support.
  • Stateless V4L2 decoder support.
  • Vaapi encoder support.
  • V4L2 encoder support.
  • Support for H.265 and AV1.
  • C API to be used in non-Rust projects.


  • Support for systems other than Linux.

Example programs

The ccdec example program can decode an encoded stream and write the decoded frames to a file. As such it can be used for testing purposes.

$ cargo build --examples
$ ./target/debug/examples/ccdec --help
Usage: ccdec <input> [--output <output>] --input-format <input-format> [--output-format <output-format>] [--synchronous] [--compute-md5 <compute-md5>]

Simple player using cros-codecs

Positional Arguments:
  input             input file

  --output          output file to write the decoded frames to
  --input-format    input format to decode from.
  --output-format   pixel format to decode into. Default: i420
  --synchronous     whether to decode frames synchronously
  --compute-md5     whether to display the MD5 of the decoded stream, and at
                    which granularity (stream or frame)
  --help            display usage information


Fluster can be used for testing, using the ccdec example program described above. This branch contains support for cros-codecs testing. Just make sure the ccdec binary is in your PATH, and run Fluster using one of the ccdec decoders, e.g.

$ python fluster.py run -d ccdec-H.264 -ts JVT-AVC_V1