[FFmpeg-user] Extract sound from multiple input files

Michael Koch astroelectronic at t-online.de
Mon Apr 29 12:48:18 EEST 2024


Am 29.04.2024 um 11:28 schrieb turgut kalfaoğlu:
> Hi. I have an interesting case. I need to extract sound from multiple 
> input files,  combine those video files into one, and then re-insert 
> the audio into the combined video file.
>
> Unfortunately I need to do them in this order. Extract sounds, then 
> combine the input videos, then add sound back to the resulting video.
>
> Can someone help me the first step?
>
> I tried this:
>
> $ ffmpeg -i resized/360_0233.MP4   -i resized/360_0234.MP4   -i 
> resized/360_0235.MP4 -vn -map 0:a   tmpsound.mp3
>

Not tested, but I think it should work with the concat filter:

ffmpeg -i resized/360_0233.MP4 -i resized/360_0234.MP4 -i 
resized/360_0235.MP4 -lavfi [0][1][2]concat=n=3:v=0:a=1 -y tmpsound.mp3

Michael



More information about the ffmpeg-user mailing list