init

Function init 

Source
pub fn init() -> Result<(), Error>
Expand description

Initializes the FFmpeg library.

This function must be called before using any other FFmpeg functionality. It initializes all subsystems including error handling, formats, devices, and filters.

§Note

  • In FFmpeg 5.0+, most subsystems auto-register, but this call is still required for error handling and device initialization.
  • This function is thread-safe and can be called multiple times (subsequent calls are no-ops).
  • The ffmpeg4/ffmpeg41/ffmpeg42/ffmpeg43 feature flags are deprecated as version detection is now automatic.

§Errors

Currently always returns Ok(()), but the return type is kept for future compatibility.

§Example

use playa_ffmpeg as ffmpeg;

fn main() -> Result<(), ffmpeg::Error> {
    ffmpeg::init()?;

    // Now safe to use FFmpeg functionality
    let input = ffmpeg::format::input(&"video.mp4")?;
    Ok(())
}