I want to overlay several videos on one video with a given time interval.
tried with a different solution, but it wonβt work as an aspect
I use the command below to overlay video by video
String[] cmdWorking3 = new String[]{"-i",yourRealPath,"-i",gifVideoFile1,"-i",gifVideoFile2,"-i",gifVideoFile3,
"-filter_complex",
"[0][1]overlay=100:100:enable='between(t,0,2)'[v1];" +
"[v1][2]overlay=130:130:enable='between(t,0,2)'[v2];" +
"[v2][3]overlay=150:150:enable='between(t,5,6)'[v3];",
"-map","[v3]","-map" ,"0:a",
"-preset", "ultrafast", filePath};
using the command above, the first two videos work fine, but the last one will not
Edit:
// Works perfect
String[] cmdWorking11 = new String[]
{"-i",
yourRealPath,
"-i",
gifVideoFile1,
"-i",
gifVideoFile2,
"-i",
gifVideoFile3,
"-i",
gifVideoFile4,
"-filter_complex",
"[1]setpts=PTS+3/TB[1d];" +
"[2]setpts=PTS+7/TB[2d];" +
"[3]setpts=PTS+10/TB[3d];" +
"[0][1]overlay=100:100:enable='between(t,0,2)'[v1];" +
"[v1][1d]overlay=130:130:enable='between(t,3,6)'[v2];" +
"[v2][2d]overlay=130:130:enable='between(t,7,9)'[v3];" +
"[v3][3d]overlay=150:150:enable='between(t,10,13)'[v4];" +
"[1]asetpts=PTS+3/TB[1ad];" +
"[2]asetpts=PTS+7/TB[2ad];" +
"[3]asetpts=PTS+10/TB[3ad];" +
"[0:a][1ad][2ad][3ad]amix=4[a]",
"-map", "[v4]", "-map", "[a]", "-ac", "5",
"-preset",
"ultrafast",
filePath};
The above command works great fine, but the sound from the overlay video is gone, can you help me solve this problem.
main video Time 00:15 seconds , and all video overlay about 3 seconds .
It would be great to help solve this problem, thanks in advance.