oddity-ai / video-rs

Video readers, writers, muxers, encoders and decoders for Rust based on ffmpeg libraries.
Apache License 2.0
234 stars 28 forks source link

Audio support #44

Open snowway opened 1 month ago

snowway commented 1 month ago

This project is great and the API is very user friendly, but when I converted the original video, I found that the audio information was lost. can anyone help me?

kaixoo commented 1 month ago

hi, luckily i am having a similar use case. you have to use ffmpeg4-sys to decode the audio separately. in the midterm, it would be wise to contribute to video-rs to have this functionality. check this blog post: https://subvisual.com/blog/posts/real-time-video-processing-with-rust-ffmpeg-opencv/

unrelated but do you have an idea on how to cut video using this library? would it be possible to preview video in real time? there lacks examples or i lack knowledge.

kaixoo commented 1 month ago

Hi @snowway would you like to collaborate on an audio encoder? I have an 8 day deadline.

gerwin3 commented 1 month ago

Unfortunately, audio is not supported right now. Any contributions would be greatly appreciated though.

kaixoo commented 1 month ago

Could easily contribute if I get indication on where the change should be made, etc. at least for basic formats like mp3. Do you have Discord or matrix?

gerwin3 commented 1 month ago

Probably the easiest way would be to add an AudioDecoder interface next to the existing decoder.