[FFmpeg-user] concat one video file and multiple audio files

DopeLabs dopelabs at dubstep.fm
Fri Jan 12 12:18:59 EET 2018


you can use concat like this

ffmpeg -f concat -i 'textfile.txt' -i video1.mp4 -c copy videoout.mp4

the text file contains the list of audio files you want to concat.


file 'f1.mp3'
file 'n1.mp3'
file 'f2.mp3'
file 'm1.mp3'
file 'f3.mp3'
file 'v1.mp3'

as long as all your audio files are encoded at the same bitrate, samplerate, etc, you shouldnt have any problems.

this also doesnt require a re-encode, you can stream copy which will be much much faster. anything you send through a filter complex usually will need to be re-encoded.


hope this helps =]



> On Jan 11, 2018, at 9:43 50PM, ropiafoldetnezi <ropiafoldetnezi at gmail.com> wrote:
> 
> Thank you!
> 
> Is it possible to do the concat and the map in one step (one command)?
> 
> 
> On Jan 11, 2018 11:11 PM, "Moritz Barsnick" <barsnick at gmx.net> wrote:
> 
> On Thu, Jan 11, 2018 at 22:57:11 +0100, ropiafoldetnezi wrote:
>> multiple sources:
>> 1 video file (.mp4)
>> 6 separate audio files (.mps)
> [...]
>> the command i tried (on windows 10):
>> ffmpeg -i video1.mp4 -i f1.mp3 -i n1.mp3 -i f2.mp3 -i m1.mp3 -i f3.mp3 -i
>> v1.mp3 -filter_complex
>> "[0:v:0][1:a:0][2:a:0][3:a:0][4:a:0][5:a:0][6:a:0]concat=n=
> 7:v=1:a=1[outv][outa]"
>> -map "[outv]" -map "[outa]" output/v1_n1_m1_v1_t_02.mp4
> 
> You should be concat'ing the audio separately from the video, and then
> mapping video and "[outa]" separately.
> 
> You can't concat an audio stream to a video.
> 
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list