0

I have two video files intro.mp4 and video.mp4, and I want it so that intro.mp4 is attached to video.mp4

I tried using the solution given here by doing this ffmpeg -i intro.mp4 -i new.mp4 -filter_complex "[0:v] [0:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" outputt.mp4 but I got this error

[Parsed_concat_0 @ 0x555ded10a180] Input link in0:v0 parameters (size 1920x1080, SAR 1:1) do not match the corresponding output link in0:v0 parameters (567x400, SAR 1:1)
[Parsed_concat_0 @ 0x555ded10a180] Failed to configure output pad on Parsed_concat_0
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #1:0
Blank
  • 1
  • 3

1 Answers1

0

For CMD:

ffmpeg -i "concat:intro.mp4|video.mp4" -codec copy output.mp4

For batch (You need to put your input files inside "inputs" folder, in the same directory as your FFmpeg. Your output files would be inside "outputs" folder.):

@echo off
mkdir inputs
mkdir outputs

:Begin

echo.
set /P iformat=Insert the format of the input files: 

echo.
set /P input1=Insert the name of the first input: 

echo.
set /P input2=Insert the name of the second input: 

echo.
set /P output=Insert the name and format of the output (e.g. output.mp4): 

for %%i in (inputs/*%iformat%) do (
  echo file 'inputs/%input1%.%iformat%' > concatlist.txt
  echo file 'inputs/%input2%.%iformat%' >> concatlist.txt
 ffmpeg -y -f concat -i concatlist.txt -c copy outputs\%output%
)

del concatlist.txt