Given you already have File1.opus
, File2.opus
and File3.opus
you can use this ffmpeg
command to achieve this task. To merge the three Opus audio files with the specified gaps, you'll need to use the filter function to insert silence and the concat demuxer to concatenate the audio files. Here's the command you can use:
ffmpeg -i File1.opus -f lavfi -t 1 -i anullsrc=r=48000:cl=stereo -i File2.opus -f lavfi -t 0.5 -i anullsrc=r=48000:cl=stereo -i File3.opus -f lavfi -t 0.5 -i anullsrc=r=48000:cl=stereo -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]concat=n=6:v=0:a=1[a]" -map "[a]" output.opus
-f lavfi -t 1 -i anullsrc=r=48000:cl=stereo
– generates a 1-second silent audio segment
-filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]concat=n=6:v=0:a=1[a]"
– complex filter chain to concatenate the audio streams while taking care of the specified gaps
-map "[a]"
– maps the concatenated audio stream to the output
output.opus
– output filename