Expand description
This crate provides a Rusty interface to Google’s libvpx library for handling VP8 and VP9 video streams. The low-level bindings to libvpx are provided by the env-libvpx-sys crate, which this crate then wraps in Rust types, hopefully making the experience a bit neater and less error-prone.
While an effort was made to hopefully cover most usecases of libvpx, this crate doesn’t cover all of libvpx’s API, as some of it is rather esoteric and difficult to make feel natural and safe to use in Rust. If you find a particular set of features of libvpx’s API is missing, please contact the crate’s author.
§Usage Examples
Refer to the Encoder and Decoder structs for examples on
how to use the library to encode and decode video frames.
The library supports a variety of YUV image formats. Have a look at
ImageFormat for more information on the exact list, as well as
tips on how to convert between YUV and non-YUV formats.
Re-exports§
pub use crate::common::StreamInfo;pub use crate::dec::DecodedImage;pub use crate::dec::DecodedImageData;pub use crate::dec::Decoder;pub use crate::dec::DecoderConfig;pub use crate::enc::CompressedFrame;pub use crate::enc::Encoder;pub use crate::enc::EncoderConfig;pub use crate::enc::EncoderFlags;pub use crate::enc::EncoderFrameFlags;pub use crate::enc::EncodingDeadline;pub use crate::enc::Packet;pub use crate::enc::RateControl;pub use crate::enc::Timebase;pub use crate::image::ImageFormat;pub use crate::image::YUVImageData;pub use crate::image::YUVImageDataOwned;pub use vpx_sys;
Modules§
- common
- Common types and structs shared between the encoder, decoder and image processing portions of the crate.
- dec
- Contains the decoding portion of the library. See
Decoderfor a simple example on how to decode images. - enc
- Contains the encoding portion of the library. See
Encoderfor a simple example on how to encode images. - image
- Contains definitions for the various YUV image formats supported by
the crate. You should take a look at
YUVImageDataespecially, since it is what theEncoderexpects as its input. The list of supported formats is detailed inImageFormat.
Enums§
- Error
- Error enums returned by this crate. Many variants include a
vpx_codec_err_t- this encodes the underlyinglibvpxlibrary error code. You can use this to fine-tune error reporting if you so desire. The included string is a human-readable representation of the error code as returned from libvpx.
Type Aliases§
- Result
- Result type for this crate.