0

I need a script for ffmpeg to do this:

  1. Background color (drawbox) for all words like this:

enter image description here

0

The idea of having a box with text is to use the FFmpeg filter i.e

-vf "drawtext=fontfile=Arial.ttf: text='%{frame_num}': start_number=1: x=(w-tw)/2: y=h-(2*lh): fontcolor=black: fontsize=20: box=1: boxcolor=white: boxborderw=5"

drawtext

  • fontfile: The font file to be used for drawing text. The path must be included. This parameter is mandatory if the fontconfig support is disabled.
  • text: The text string to be drawn. The text must be a sequence of UTF-8 encoded characters. This parameter is mandatory if no file is specified with the parameter textfile.
  • x,y: The expressions which specify the offsets where text will be drawn within the video frame. They are relative to the top/left border of the output image. The default value of x and y is "0".
  • fontcolor: The color to be used for drawing fonts. For the syntax of this option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. The default value of fontcolor is "black".
  • fontsize: The font size to be used for drawing text. The default value of fontsize is 16.
  • box: Used to draw a box around text using the background color. The value must be either 1 (enable) or 0 (disable). The default value of box is 0.
  • boxcolor: The color to be used for drawing box around text. For the syntax of this option, check the (ffmpeg-utils)"Color" section in the ffmpeg-utils manual. The default value of boxcolor is "white".
  • boxborderw: Set the width of the border to be drawn around the text using bordercolor. The default value of borderw is 0
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.