Today, I used some filters on a public-domain video to add several kinds of overlays. My ffmpeg command was:
ffmpeg -y -i t.png -i t.mp4 \
-filter_complex \
"color=color=FF000066:s=1280x80:d=5,
drawtext=x=20:y=(H-th)/2:fontcolor=ghostwhite:shadowcolor=black: shadowx=2:shadowy=2:text='How elections are stolen in the USA':fontsize=60:fontfile=${HOME}/.fonts/Billboard.ttf[t];
color=color=FFFFFF00:s=1280x720:d=5[f];
[f][t]overlay=x=0:y=H-h-20[o];
[o][0:v:0]overlay=x=W-w-20:y=20:repeatlast=1[of];
[1:v:0][of]overlay=x=0:y=H-h:repeatlast=1,
drawtext=x=W-tw-20:y=H-th-30:
fontfile='${HOME}/.fonts/Time-Normal.ttf':
fontsize=round(H/30):fontcolor=FFFFFF77:
text='%{eif\:mod(t/3600\,60)\:d\:2}\:%{eif\:mod(t/60\,60)\:d\:2}\:%{eif\:mod(t\,60)\:d\:2}'[v];
[1:a:0]asetpts=PTS-STARTPTS,dynaudnorm=gausssize=3[a]" \
-map '[v]' -map '[a]' \
-c:v libx264 -crf 21 -preset medium -tune film \
-c:a libfdk_aac -vbr 5 \
How-elections-are-stolen-in-the-USA.mp4 && \
xdg-open How-elections-are-stolen-in-the-USA.mp4
The filters
color— Draws a translucent red background for the width of the video (t.mp4). Its duration is 5 seconds.drawtext— Renders some text on the colour background for the same duration as above.color— Creates a transparent frame that is the same size as the video.overlay— Places the text and its red background on the frame.overlay— Places the book image (t.png) on the frame from previous step.overlay— Places the frame with overlaid text, red band and book image on the video (t.mp4).drawtext— Draw the timer.asetpts— Rewrite timestamps.dynaudnorm— Autolevel volume.

Demo video
Apart from the overlays, the low volume in the original video has been fixed in my ‘filtered’ video.

The original video
Become an FFmpeg PRO by reading my book Quick Start Guide to FFmpeg.
- MORE INFO — http://www.vsubhash.in/ffmpeg-book.html
- BUY — https://books2read.com/ffmpeg (common link for all stores)
- FREE INTERNATIONAL SHIPPING -
https://www.apress.com/9781484287002
