Iura  Gaitur
Iura Gaitur

Reputation: 53

Convert video using ffmpeg for watermark creation with multiple text

I want to convert a video using FFMPEG and place a watermark with multiple texts on it. Combining the commands for placing a text and a watermark is :

ffmpeg -i input_1.mp4 -i watermark_small.png -filter_complex "[0]overlay=10:10; [1]drawtext=enable='between(t,0,12)':fontfile=font.ttf:text='Some text' : fontcolor=black: fontsize=18: box=1: [email protected]:boxborderw=5: x=(w-text_w)/1.15:y=30, drawtext=enable='between(t,14,22)':fontfile=font.ttf:text='Next text' : fontcolor=black: fontsize=18: box=1: [email protected]:boxborderw=5: x=(w-text_w)/1.15:y=30" -codec:v libx264 -preset ultrafast output1.mp4

Unfortunately this command puts the watermark and the first text but not the next text. I assume the problem is on -filter_complex setting. Unfortunately I don't know how to set it in the right way in order to work. Could someone help me and say what needs to be changed in this command in order to convert it in the right way?

Upvotes: 0

Views: 384

Answers (1)

llogan
llogan

Reputation: 133833

Change:

[0]overlay=10:10; [1]drawtext

To:

[0:v][1:v]overlay=10:10,drawtext
  • Manually define input labels for filters instead of relying on defaults.
  • Use , to linearly join filters that accept a single input and/or output. This creates a filterchain. Use ; when you want to join filterchains. See FFmpeg Filters Documentation for more info.

Upvotes: 2

Related Questions