Ffmpeg when use overlay output have delay

ffmpeg

I Use Ffmpeg For Overlay Png on short video : For Example 5 seconds video I Use This Command :

-i C:\\part1.mp4 -i C:\\txt1.png -filter_complex \"overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2\" -c:v libx264  -pix_fmt yuv420p -codec:a copy C:\\outputtext1.mp4

this out put video above command : mediafire.com/file/befhqnebki9owti/outputtext2.mp4/file
1 seconds in start play have delay

Best Answer

Hello I Use These Commands And My Problem is Solved :

-threads 2  -i C:\\start.mp4  -i C:\\outputtext1.mp4 -i C:\\part1after.mp4 -i C:\\outputtext2.mp4 -i C:\\part2after.mp4 -i C:\\outputtext3.mp4 -i C:\\end.mp4  -filter_complex \"[0:v]setpts=PTS-STARTPTS[v0]; [0:a]asetpts=PTS-STARTPTS[a0]; [1:v]setpts=PTS-STARTPTS[v1]; [1:a]asetpts=PTS-STARTPTS[a1]; [2:v]setpts=PTS-STARTPTS[v2]; [2:a]asetpts=PTS-STARTPTS[a2];[3:v]setpts=PTS-STARTPTS[v3]; [3:a]asetpts=PTS-STARTPTS[a3];[4:v]setpts=PTS-STARTPTS[v4]; [4:a]asetpts=PTS-STARTPTS[a4];[5:v]setpts=PTS-STARTPTS[v5]; [5:a]asetpts=PTS-STARTPTS[a5];[6:v]setpts=PTS-STARTPTS[v6]; [6:a]asetpts=PTS-STARTPTS[a6]; [v0][a0][v1][a1][v2][a2][v3][a3][v4][a4][v5][a5][v6][a6]concat=n=7:v=1:a=1[v][a]\" -map \"[v]\" -map \"[a]\" -c:v libx264 -preset veryfast -crf 25 -maxrate 2025k -bufsize 2025k -c:a aac C:\\testok.mp4"

setpts and asetpts solve my problem thx

Related Question