| Crates.io | avmux |
| lib.rs | avmux |
| version | 0.2.1 |
| created_at | 2025-06-22 10:32:30.652945+00 |
| updated_at | 2025-09-19 06:10:20.773061+00 |
| description | A crate to merge video and audio based on rsmpeg (dynamic link with ffmpeg lib). |
| homepage | |
| repository | https://github.com/kingwingfly/avmux |
| max_upload_size | |
| id | 1721547 |
| size | 42,688 |
A crate to merge video and audio based on rsmpeg (dynamic link with ffmpeg lib)
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
This crate provides a simple way to merge video and audio files into a single output file. It uses the rsmpeg library, which is a Rust binding for FFmpeg, to handle the underlying media processing.
See an example GitHub workflow.
To use this crate in your Rust project, add the following to your Cargo.toml:
[dependencies]
# if you want to mux audio and video and re-encode, try version 0.2
avmux = { version = "0.2" }
# if you just want to mux audio and video without re-encode, try version 0.1
avmux = { version = "0.1" }
NOTICE: version 0.2 hard-coded nvenc hwaccel as the encoder, which is non-free in FFmpeg's LICENSE.
(You cannot distribute the FFmpeg binary or library with nvenc enabled for commertial usage. If you need, feel free to fork and modify this crate.)
use avmux::*;
let video_file = VFile::new("input_video.mp4");
let audio_file = AFile::new("https://music.com/input_audio.mp3");
let output_file = VFile::new("output1.mp4");
(video_file, audio_file).mux(output_file, CodecConfig::default()).unwrap();
let file1 = AFile::new("testa.mp3");
let file2 = VFile::new("testv.mp4");
let output = VFile::new("output2.mp4");
(file1, file2)
.mux(
output,
CodecConfig::builder()
.vconf(VConf::builder().format(VFormat::H264).build())
.aconf(AConf::builder().format(AFormat::AAC).build())
.build(),
)
.unwrap();
For more examples, please refer to the Documentation
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)Distributed under the MIT License. See LICENSE.txt for more information.
Louis - 836250617@qq.com
Project Link: https://github.com/kingwingfly/avmux