Input

Null input

-f lavfi -re -i nullsrc=s=1280x720

Overlay

https://ffmpeg.org/ffmpeg-filters.html#overlay-1

Add watermark

-f video.mp4 -i logo.png -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2"
  • TOP LEFT: overlay=5:5
  • TOP RIGHT: overlay=main_w-overlay_w-5:5 or overlay=W-w-5:5
  • BOTTOM LEFT: overlay=5:main_h-overlay_h or overlay=5:H-h-5
  • BOTTOM RIGHT: overlay=main_w-overlay_w-5:main_h-overlay_h-5 or overlay=W-w-5:H-h-5
  • TOP RIGHT(Scale): [1:v]scale=32:48 [ovrl],[0:v][ovrl]overlay=W-w-15:15

  • RGB Colorspace: overlay=5:H-h-5:format=rgb,format=yuv420p

Add timestamp

-vf "drawtext=text='%{localtime\:%Y/%m/%d %T}': fontsize=48: x=(w-tw)/2: y=h-(2*lh):"
ffmpeg -f lavfi -re -i nullsrc=s=1280x720 -vf "drawtext=text='%{localtime\:%Y/%m/%d %T}': fontsize=48: x=(w-tw)/2: y=h-(2*lh):" -c:v libx264 -preset veryfast -pix_fmt yuv420p -g 50 -f flv rtmp://127.0.0.1/live/test