8000 Example for mix audio and video? · Issue #166 · meh/rust-ffmpeg · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Example for mix audio and video? #166
Open
@niuhuan

Description

@niuhuan

I want the same effect as this command line, but I don't know how to make it

ffmpeg -i 1.video -i 1.audio -vcodec copy -acodec copy output.mp4
    let video_file = "1.video".to_owned();
    let audio_file = "1.audio".to_owned();
    let mix_file = "1.mp4".to_owned();
    let mut video_input = ffmpeg::format::input(&video_file).unwrap();
    let mut audio_input = ffmpeg::format::input(&audio_file).unwrap();
    let mut mix_output = ffmpeg::format::output(&mix_file).unwrap();
    video_input
        .streams()
        .best(ffmpeg::media::Type::Video)
        .map(|stream| {
            // ????
        });
    let best_audio_stream_index = audio_input
        .streams()
        .best(ffmpeg::media::Type::Audio)
        .map(|stream| stream.index());
    

mix_output.set_metadata()
mix_output.........

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0