如何使用ffmpeg将其他音频添加到音频的静音部分? [英] How do I add some other audio to the muted section of an audio using ffmpeg?

查看:544
本文介绍了如何使用ffmpeg将其他音频添加到音频的静音部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在静音音频文件的一部分,如下所示.如何使用ffmpeg将其他一些音频添加到音频的静音部分?

I am muting a section of the audio file as below. How can I add some other audio to the muted section of the audio using ffmpeg?

FFmpeg ffmpeg = new FFmpeg("ffmpeg");
FFprobe ffprobe = new FFprobe("ffprobe");
FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe);
FFmpegProbeResult in = ffprobe.probe("Input.wav");
FFmpegBuilder builder = new **FFmpegBuilder().setInput(in).addOutput("Output.wav").setAudioFilter("volume=enable='between(t,94,123)':volume=0").done();**
executor.createJob(builder).run();

推荐答案

执行此操作的便捷方法是使用新音频修剪源和concat.

The convenient way to do this is to trim the source and concat with the new audio.

ffmpeg -i in.wav -i insert.wav -filter_complex "[0]atrim=0:94[pre];[0]atrim=124,asetpts=PTS-STARTPTS[post];[1]atrim=0:30[mid];[pre][mid][post]concat=n=3:v=0:a=1" out.wav

这篇关于如何使用ffmpeg将其他音频添加到音频的静音部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆