Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chromeos/cros-codecs
https://github.com/chromeos/cros-codecs
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/chromeos/cros-codecs
- Owner: chromeos
- License: bsd-3-clause
- Created: 2023-01-18T04:21:13.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-17T06:55:33.000Z (28 days ago)
- Last Synced: 2024-10-19T09:28:09.264Z (26 days ago)
- Language: Rust
- Size: 3.5 MB
- Stars: 31
- Watchers: 8
- Forks: 9
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Cros-codecs
[](https://crates.io/crates/cros-codecs)
[](https://docs.rs/cros-codecs/latest/cros_codecs/)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](https://github.com/google/crosvm)), but has no dependency to ChromeOS
and should be usable anywhere.## Current features
- Simple decoder API,
- VAAPI decoder support (using
[cros-libva](https://github.com/chromeos/cros-libva)) for H.264, H.265, VP8,
VP9 and AV1,
- VAAPI encoder support for H.264, VP9 and AV1,
- Stateful V4L2 encoder support.## Planned features
- Stateful V4L2 decoder support,
- Stateless V4L2 decoder support,
- Support for more encoder codecs,
- C API to be used in non-Rust projects.## Non-goals
- 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.```shell
$ cargo build --examples
$ ./target/debug/examples/ccdec --help
Usage: ccdec [--output ] --input-format [--output-format ] [--synchronous] [--compute-md5 ]Simple player using cros-codecs
Positional Arguments:
input input fileOptions:
--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
```## Testing
[Fluster](https://github.com/fluendo/fluster) can be used for testing, using the
`ccdec` example program described above. Just make sure the `ccdec` binary is in
your `PATH`, and run Fluster using one of the `ccdec` decoders, e.g.```shell
python fluster.py run -d ccdec-H.264 -ts JVT-AVC_V1
```## Credits
The majority of the code in the initial commit has been written by Daniel
Almeida as a VAAPI backend for crosvm, before being split into this crate.