问题
By asking another question here, I got working code
ffmpeg -i input.mp3 -i second.mp3 -filter_complex "[0:a]atrim=end=10,asetpts=N/SR/TB[begin];[0:a]atrim=start=10,asetpts=N/SR/TB[end];[begin][1:a][end]concat=n=3:v=0:a=1[a]" -map "[a]" output
The code inserts second.mp3 into the input.mp3 at 10 seconds.
But now I need to overlay second.mp3 into the input.mp3 starting at 10seconds. In other words I need playing input.mp3 and after 10 seconds I need start playing second.mp3 simultaneously.
The code I have been given keeps the params of input.mp3 and changes everything about second.mp3 to match input.mp3.
Could you help me altering the command I have to do the overlay...
回答1:
Use
ffmpeg -i input.mp3 -i second.mp3 -filter_complex "[1:a]adelay=10000|10000[1a];[0:a][1a]amix" output
The adelay delays the 2nd audio start by 10 seconds. The amix mixes the two audios together.
来源:https://stackoverflow.com/questions/55040846/need-help-to-change-working-ffmpeg-command-to-overlay-instead-of-concatenate-two