


The anullsrc filter is used to provide silent dummy audio if one of your inputs does not contain audio.

With watermark ffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -i logo.png -filter_complex \Ĭoncat=n=3:v=1:a=1 overlay=W-w-5:H-h-5" \įor more info see overlay filter documentation and How to add and position watermark with ffmpeg? Adding silent dummy audio for an input that does not have audio ffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -filter_complex \Īformat=sample_rates=48000:channel_layouts=stereo Same as above but also processes audio to be stereo with 48000 sample rateĪdded the aformat (sample rate and channel layout) filter. map "" -map "" -c:v libx264 -c:a aac -movflags +faststart output.mp4 ffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -filter_complex \

Using scale (width x height / resolution), setsar (aspect ratio), fps (frame rate), format (chroma subsampling), and concat (concatenation/joining) filters. Since I'm assuming your inputs are going to be arbitrary I recommend using the concat filter instead of the concat demuxer because you're going to need to perform filtering anyway to conform everything into a common set of parameters and you can do everything in one command. This may result in incorrect timestamps in the output file. The error message: Non-monotonous DTS in output stream 0:0 previous: 8052684, current: 4127401 changing to 8052685. ffmpeg -i input1.mp4 -y -i audio1.mp3 -c:v copy -c:a aac -shortest output1.mp4įfmpeg -i input2.mp4 -y -i audio2.mp3 -c:v copy -c:a aac -shortest output2.mp4įfmpeg -y -safe 0 -f concat -i list.txt -c copy output.mp4 I tried to make them all equal with the same dimensions, frame rate, sample rate and also by adding an audio track when there's none. I'm trying to merge some videos but I'm getting timestamp errors.
