I have this code that automatically makes a couple of videos using ffmpeg. The result is 2 or 3 .mp4 files that consist of an audio and a still image. I want to concatenate these files automatically by using ffmpeg concat demuxer, but when the concatenation finishes the videos do concatenate, but the images are hyperimposed on top of one another. So instead of having 12 seconds of a cat image and 10 seconds of a skyscraper, I get 22 seconds of a cat image, and when I skip forward in the video the image changes to the skyscraper and doesnt change back.
Every single tutorial I see has the same command work in the intended way, and trying it directly in the command line does not help either. Since all the images are made automatically, they have the same codec, and I also keep their aspect ratios the same.
I tried using this function on Java, which like I said, does concatenate the videos, but by “prioritizing” one of the images. The audios retain their length and are placed in order, which in my opinion makes the issue even weirder
public static void concatenateVideos(){
String[] listCommand = {
“cmd”, “/c”, “(for”, “%i”, “in”, “(C:UsersmarcoGraficas_computacionalesopenAIVideoV3srcapiDownloads*.mp4)”, “do”, “@echo”, “file”, “‘%i’)”, “>”, “C:UsersmarcoGraficas_computacionalesopenAIVideoV3srcapiDownloadslist.txt”
};
commandLine(listCommand);
String[] ffmpegCommand = {"ffmpeg", "-safe", "0", "-f", "concat", "-i", "C:\Users\marco\Graficas_computacionales\openAIVideoV3\src\apiDownloads\list.txt", "-c", "copy", "C:\Users\marco\Graficas_computacionales\openAIVideoV3\src\apiDownloads\openAIVideo.mp4"};
commandLine(ffmpegCommand);
}
Marco Antonio Manjarrez Fernan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.