DrawText and crossfade effect

For the developers that use FFmpeg in their software.
Post Reply
geek
Posts: 1
Joined: Tue Jul 24, 2018 5:08 pm

DrawText and crossfade effect

Post by geek » Tue Jul 24, 2018 5:10 pm

Good afternoon,
I have one video with crossfade effect and i want add text on this video (drawtext).
However when i add a filter text, he remove a crossfade effect in the final video.

Command to create video with crossfade effect:

Code: Select all

ffmpeg -i first.mp4 -i second.mp4 -filter_complex 
    	"[0:v]trim=start=0:end=2,setpts=PTS-STARTPTS[0_clip_1];
    	[0:v]trim=start=2:end=3,setpts=PTS-STARTPTS[fadeoutsrc_0];
    	[fadeoutsrc_0]format=pix_fmts=yuva420p,fade=t=out:st=0:d=1:alpha=1[fadeout_0];
    	[fadeout_0]fifo[fadeoutfifo_0];[1:v]trim=start=1,setpts=PTS-STARTPTS[1_clip_2];
    	[1:v]trim=start=0:end=1,setpts=PTS-STARTPTS[fadeinsrc_1];
    	[fadeinsrc_1]format=pix_fmts=yuva420p,fade=t=in:st=0:d=1:alpha=1[fadein_1];
    	[fadein_1]fifo[fadeinfifo_1];
    	[fadeoutfifo_0][fadeinfifo_1]overlay[crossfade_1];
    	[0_clip_1][crossfade_1][1_clip_2]concat=n=3[output];[0:a][1:a] acrossfade=d=1 [audio]" 
    -map "[output]" -map "[audio]" videoWithCrossfade.mp4
Command to add filter text:

Code: Select all

ffmpeg -i videoWithCrossfade.mp4 -filter_complex 
    	"/Windows/fonts/arial.ttf':text='hello world!':fontcolor=white:fontsize=40:box=1:boxcolor=red
    	@0.5:boxborderw=10:x=500:y=500"
    	output.mp4
this is the link of video :
http://www.mediafire.com/file/kw3lvdb2r ... e.mp4/file
http://www.mediafire.com/file/iycdzozsq ... t.mp4/file

Thanks for your help !

Post Reply