[FFmpeg-user] Drawtext and crossfade effect
local host
local.host.portable at gmail.com
Sat Jul 28 02:34:41 EEST 2018
Hello,
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:
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:
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/kw3lvdb2rp1bs6u/videoWithCrossfade.mp4/file
http://www.mediafire.com/file/iycdzozsqzosq87/output.mp4/file
Thanks for your help !
More information about the ffmpeg-user
mailing list