I have a bunch of videos that are MP4s with different FPS, resolution, aspect ratio, basically everything. I'm trying to see if its possible to use FFMPEG to combine them into a single 1080/720 video using a single command, or at least make them all similar format so that combining is easy. Speed and less CPU power would be preferred but I'm in no rush and
I found this command on another stack overflow question:
ffmpeg -i 1.mp4 -i 2.mp4 -i 3.mp4 -filter_complex \
"[0:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:-1:-1,setsar=1,fps=30,format=yuv420p[v0];
[1:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:-1:-1,setsar=1,fps=30,format=yuv420p[v1];
[2:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:-1:-1,setsar=1,fps=30,format=yuv420p[v2];
[v0][0:a][v1][1:a][v2][2:a]concat=n=3:v=1:a=1[v][a]" \
-map "[v]" -map "[a]" -c:v libx264 -c:a aac -movflags +faststart output.mp4
The problem is that I have more that 3 videos to combine and I don't know how to work this command with more, I have an entire list of videos in a list.txt file structured as such:
file './videos/video1.mp4'
file './videos/video2.mp4'
file './videos/video3.mp4'
The code that somewhat worked for me was this
ffmpeg -safe 0 -f concat -i list.txt -c copy output.mp4
It combines the video well and fairly fast but I get weird glitches with the audio and the resolution is weird (I'm hoping for 1920x1080). I suspect this is due to the varying attributes of each video but I'm not sure. I'm familiar with Python but I have found no Python script that can do what I ask. If there any way to combine my list into one video (using FFMPEG or not) reliably?