🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

A2VConverter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

A2VConverter

crates.io
Version
0.1.1
Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 22 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts