A2VConverter

Crates.ioA2VConverter
lib.rsA2VConverter
version0.1.1
sourcesrc
created_at2024-02-22 12:02:12.696044
updated_at2024-02-22 12:08:07.613998
descriptionAudioVideoConverter is a Rust library that provides functionality to convert between audio and video files using the FFmpeg library.
homepage
repository
max_upload_size
id1149266
size4,623
Jenin Sutradhar (JeninSutradhar)

documentation

README

AudioVideoConverter

AudioVideoConverter is a Rust library that provides functionality to convert between audio and video files using the FFmpeg library.

Features

  • Convert Audio to Video: Convert an audio file to a video file by combining with a background image.
  • Convert Video to Audio: Extract audio from a video file and save it as a separate audio file.

Installation

Run the following Cargo command in your project directory:

cargo add A2VConverter

Add this to your Cargo.toml:

[dependencies]
A2VConverter = "0.1.1"

Usage

fn main() {
    // Convert audio file to video
    AudioVideoConverter::convert_audio_to_video("input_audio.mp3", "output_video.mp4")
        .unwrap();
    println!("Audio converted to video successfully!");

    // Convert video file to audio
    AudioVideoConverter::convert_video_to_audio("input_video.mp4", "output_audio.mp3")
        .unwrap();
    println!("Video converted to audio successfully!");
}

Error

  • The functions return Result<(), io::Error>. Errors can occur due to issues with the conversion process or I/O operations. Handle errors appropriately in your code.

Dependencies

  • This crate depends on FFmpeg. Make sure FFmpeg is installed on your system and available in your PATH.
Commit count: 0

cargo fmt