[FFmpeg-user] overlay AND concatenate with ffmpeg - merging to one command?

Chad Horton chorton at hotsalsainteractive.com
Tue Aug 25 18:32:35 CEST 2015


I have an android app where users record a video.  I then add an overlay
on the video and then concatenate a 4 second video to the end of the video.

I¹m currently using two executions, as provided below.  The second
(concatenate) execution TAKES FOREVER.  Well over 2 minutes.

1.) is there a much faster way to do this?
2.) is there a way to execute this in a single ffmpeg command instead of
two?

ffmpeg -y 
	-i baselinevideo.mp4
	-itsoffset 00:00:0.0000
	-i overlayvideo.mp4
	-filter_complex 
"[1:v]scale=1280:1024[ovrl];[0:v][ovrl]overlay=eof_action=pass[outv];[0:a][
1:a]amix[outa]"
	-map [outv]
	-map [outa]
	-vcodec mpeg4
	-strict experimental
	-crf
	finalvideo-temp.mp4

ffmpeg -y
	-i finalvideo-temp.mp4
	-i concatvideo.mp4
	-filter_complex "[0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v] [a]"
	-map [v]
	-map [a]
	-strict experimental
	-crf
	finalvideo.mp4



More information about the ffmpeg-user mailing list