-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to achieve transcoding, such as converting H264 video streams to FLVs #76
Comments
So is there any question or your question is in the title? |
In any case, FLV is just a container (similar to MP4), so there would be no transcoding. The FLV container would still contain h264 video stream (unless you wanted to transcode your video into h265 for example). There are usage examples where you can see how to use this library: https://github.com/angelcam/rust-ac-ffmpeg/tree/master/ac-ffmpeg/examples |
thankyou,My statements are indeed incorrect. How can I convert the Opus of the audio to Acc |
You'll need to decode the Opus audio and encode it as AAC. Check the examples. There are sample apps for decoding and encoding. You can find inspiration there. |
fn convert(input:rw::ClosureReader, mut output: rw::ClosureWriter<fn(&[u8]) ->std::io::Result>) -> Result<(), Error> { |
This is completely wrong: match VideoEncoder::builder("flv") {
Ok(video_encoder_build) => {
match video_encoder_build
.set_option("tune", "zerolatency")
.set_option("preset", "ultrafast")
.set_option("crf", "28")
.set_option("c:a", "acc")
.set_option("c:v","libx264")
.set_option("f","flv")
.height(480).width(640)
.bit_rate(2500000)
.pixel_format(PixelFormat::from_str("yuv420p").unwrap())
.build()
{
...
}
}
...
} You cannot use the You were able to build the video encoder mostly by accident because I strongly suggest making yourself familiar with the concept of media codecs, containers and the difference between them. You should be also familiar with the FFmpeg API documentation because this crate is only a wrapper around the FFmpeg libraries. And, please, go through the code examples in this repository carefully. Once you've done that, you'll understand that:
|
After reading your answer, I noticed my mistake. I know what you mean is that FLV is not an encoding format. I need to decode and transcode the video and audio streams separately. However, how can I merge the two streams into the FLV container afterwards? Thank you for your answer |
When running the code VideoEncoder:: builder ("libx264"), an unknown codec error was reported |
mod rw; use std::fs::File; /// Open a given input file. /// Open a given output file.
} /// Convert a given input file into a given output file.
} #[tokio::main]
} |
No description provided.
The text was updated successfully, but these errors were encountered: