Skip to main content

VideoCodecEncodeExt

Trait VideoCodecEncodeExt 

Source
pub trait VideoCodecEncodeExt {
    // Required methods
    fn is_lgpl_compatible(&self) -> bool;
    fn default_extension(&self) -> &'static str;
}
Expand description

Encode-specific methods for VideoCodec.

This trait adds encoding-oriented helpers to the shared VideoCodec type. Import it to call is_lgpl_compatible or default_extension on a codec value.

§Examples

use ff_encode::{VideoCodec, VideoCodecEncodeExt};

assert!(VideoCodec::Vp9.is_lgpl_compatible());
assert_eq!(VideoCodec::H264.default_extension(), "mp4");

Required Methods§

Source

fn is_lgpl_compatible(&self) -> bool

Returns true if the software encoder for this codec is LGPL-compatible (i.e. does not require a GPL or proprietary licence).

Important: This reflects the codec family’s typical software encoder licensing, not the actual encoder chosen at runtime. H.264 and H.265 return false because their software encoders (libx264/libx265) are GPL; hardware encoders (NVENC, QSV, etc.) are LGPL-compatible regardless.

Use VideoEncoder::is_lgpl_compliant to query the actual encoder selected at runtime.

Source

fn default_extension(&self) -> &'static str

Returns the default output file extension for this codec.

Implementors§