ffmpeg -i 2.jpg -vf pad=500:500:40:40:violet pad1.jpg ffmpeg -i 2.jpg -vf pad=width=500:height=500:x=40:y=40:color=violet pad2.jpg ffmpeg -i test.mp4 -vf pad=width=iw+80:height=ih+60:x=40:y=30:color=blue output_pad.mp4
ffmpeg-overlay
#ffmpeg -i test.mp4 -vf “movie=filename=plum.jpg,scale=width=120:height=120[watermark];[in] [watermark]overlay=x=0:y=0” ff_movie=mp4 #ffmpeg -f lavfi -i color=ffffff:size=700×300 -frames:v 1 -vf “drawtext=fontfile=/usr/share/fonts/songhei.ttf:fontcolor=ff0000:fontsize=40:x=10:y=5:text=’规则变化表’”,”drawtext=fontfile=/usr/share/fonts/songhei.ttf:fontcolor=ff0000:fontsize=30:x=10:y=50:text=’great greater greatest | fine finer finest’”,”drawtext=fontfile=/usr/share/fonts/songhei.ttf:fontcolor=ff0000:fontsize=30:x=10:y=80:text=’angry angrier angriest | big bigger biggest’”,”drawtext=fontfile=/usr/share/fonts/songhei.ttf:fontcolor=ff0000:fontsize=30:x=10:y=110:text=’important more important most important’”,”drawtext=fontfile=/usr/share/fonts/songhei.ttf:fontcolor=ff0000:fontsize=30:x=10:y=140:text=’clever cleverer cleverest’”,”drawtext=fontfile=/usr/share/fonts/songhei.ttf:fontcolor=ff0000:fontsize=30:x=130:y=170:text=’more clever most clever’” -f image2 规则变化表.jpg #ffmpeg -f lavfi -i color=ffffff:size=700×400 -frames:v 1 -vf “drawtext=fontfile=/usr/share/fonts/songhei.ttf:fontcolor=ff0000:fontsize=40:x=10:y=5:text=’不规则变化表’”,”drawtext=fontfile=/usr/share/fonts/songhei.ttf:fontcolor=ff0000:fontsize=30:x=10:y=50:text=’good/well better best | bad worse worst’”,”drawtext=fontfile=/usr/share/fonts/songhei.ttf:fontcolor=ff0000:fontsize=30:x=10:y=80:text=’many/much… Continue reading ffmpeg-overlay
ffmpeg-negate
ffmpeg -i ../fuzhous.mp4 -vf negate ff_negate.mp4
ffmpeg-lavfi
#直接画圆角矩形画不出来,只能先画一个方形,然后在方形里面画置入一个圆角矩形。 #ffmpeg -f lavfi -i color=00ffff:size=620×480 -f lavfi -i color=ffffff:size=605×465 -frames:v 1 -filter_complex “[1]format=yuva420p,geq=lum=’p(X,Y)’:a=’if(gt(abs(W/2-X),W/2-15)*gt(abs(H/2-Y),H/2-15),if(lte(hypot(15-(W/2-abs(W/2-X)),15-(H/2-abs(H/2-Y))),15),255,0),255)'[rounded];[0][rounded]overlay=x=(W-w)/2:y=(H-h)/2” two-round.jpg #画一个圆 #ffmpeg -f lavfi -i color=00ffff:size=1000×600 -f lavfi -i color=f1f1f1:size=800×400 -frames:v 1 -filter_complex “[1]format=yuva420p,geq=lum=’p(X,Y)’:a=’if(gt(abs(W/2-X),W/2-500)*gt(abs(H/2-Y),H/2-500),if(lte(hypot(200-(W/2-abs(W/2-X)),200-(H/2-abs(H/2-Y))),200),255,0),255)'[rounded];[0][rounded]overlay=x=(W-w)/2:y=(H-h)/2” -f image2 input.jpg #画一个均匀的四角 #ffmpeg -f lavfi -i color=00ffff:size=400×400 -f lavfi -i color=ffffff:size=380×380 -frames:v 1 -filter_complex “[1]format=yuva420p,geq=lum=’p(X,Y)’:a=’if(gt(abs(W/2-X),W/2-100)*gt(abs(H/2-Y),H/2-100),if(lte(hypot(200-(W/2-abs(W/2-X)),200-(H/2-abs(H/2-Y))),200),255,0),255)'[rounded];[0][rounded]overlay=x=(W-w)/2:y=(H-h)/2” sround.jpg #画一个交叉的直角 #ffmpeg -f lavfi -i color=00ffff:size=400×400 -f lavfi… Continue reading ffmpeg-lavfi
ffmpeg-jpg-text
#ffmpeg -f lavfi -i color=00ff00:size=620×480 -vf “drawtext=fontfile=/usr/share/fonts/hanchanzhengkaiti.ttf:fontcolor=000000:fontsize=20:shadowy=0:x=(w-tw)/2-2:y=(main_h-line_h-100):text=”综合素质考试”,drawtext=fontfile=/usr/share/fonts/hanchanzhengkaiti.ttf:fontcolor=000000:fontsize=20:shadowy=0:x=(w-tw)/2-6:y=(main_h-line_h-70):text=”教学知识能力”,drawtext=fontfile=/usr/share/fonts/hanchanzhengkaiti.ttf:fontcolor=000000:fontsize=20:shadowy=0:x=(w-tw)/2-10:y=(main_h-line_h-40):text=”英语学科知识与教学能力”,drawtext=fontfile=/usr/share/fonts/hanchanzhengkaiti.ttf:fontcolor=000000:fontsize=35:shadowy=0:x=(w-tw)/2-15:y=(main_h-line_h-10):text=’齐齐哈尔市一中’” bg1.png #ffmpeg -f lavfi -i color=ffffff:size=620×480 -vf “drawtext=fontfile=/usr/share/fonts/msyh.ttf:fontcolor=000000:fontsize=30:x=10:y=10:text=简述学习动机的激发”,”drawtext=fontfile=/usr/share/fonts/msyh.ttf:fontcolor=000000:fontsize=30:x=10:y=50:text=1.创设问题的情境,实施启发式教学”,”drawtext=fontfile=/usr/share/fonts/msyh.ttf:fontcolor=000000:fontsize=30:x=10:y=80:text=2.根据作业难度,恰当控制动机水平”,”drawtext=fontfile=/usr/share/fonts/msyh.ttf:fontcolor=000000:fontsize=30:x=10:y=110:text=3.充分利用反馈信息,妥善进行奖惩”,”drawtext=fontfile=/usr/share/fonts/msyh.ttf:fontcolor=000000:fontsize=30:x=10:y=140:text=4.正确指导结果归因,促使学生继续努力”,”drawtext=fontfile=/usr/share/fonts/msyh.ttf:fontcolor=000000:fontsize=30:x=10:y=170:text=5.设置合适目标,培养自我效能感”,”drawtext=fontfile=/usr/share/fonts/msyh.ttf:fontcolor=000000:fontsize=30:x=10:y=200:text=6.对学生进行合作和竞争教育,”,”drawtext=fontfile=/usr/share/fonts/msyh.ttf:fontcolor=000000:fontsize=30:x=40:y=230:text=开展合作与竞争学习” -f image2 简述学习动机的激发.jpg #ffmpeg -f lavfi -i color=ffffff:size=620×480 -frames:v 1 -vf “drawtext=fontfile=/usr/share/fonts/songhei.ttf:fontcolor=000000:fontsize=30:x=10:y=10:text=’weixin’”,”drawtext=fontfile=/usr/share/fonts/songhei.ttf:fontcolor=000000:fontsize=30:x=10:y=60:text=’username\:qqwmd1984′”,”drawtext=fontfile=/usr/share/fonts/msyh.ttf:fontcolor=00ff00:fontsize=30:x=10:y=110:text=’password\:qqwmd1984,.’” -f image2 weixin.jpg #ffmpeg -f lavfi -i color=ffffff:size=700×120 -frames:v 1 -vf “drawtext=fontfile=msyh.ttf:fontcolor=000000:fontsize=30:x=40:y=5:text=’ The results of the competition came out’,drawtext=fontfile=msyh.ttf:fontcolor=000000:fontsize=30:x=10:y=35:text=’earlier than the students expected.’,drawtext=fontfile=/usr/share/fonts/msyh.ttf:fontcolor=000000:fontsize=30:x=10:y=75:text=’比赛出来的结果比学生们预期的要早。’” -f image2 temp0.jpg #ffmpeg -f… Continue reading ffmpeg-jpg-text