<p>The method in my <a href="https://stackoverflow.com/q/38306321/">old answer</a> was a workaround due to a limitation in drawtext filter at the time of writing. It's easier now.</p>
<p>You're getting transparent text because the textcolor is used to set both the color as well as its opacity intensity, and since black represents 0, the text disappears.</p>
<p>Anyway, it's simpler after ffmpeg 3.1</p>
<p><code>ffmpeg -i input.mp4 -filter_complex &quot;color=black@0:100x100,format=yuva420p[c];[c][0]scale2ref[ct][mv];[ct]setsar=1,drawtext=fontfile='font.ttf':text='Test Text':fontsize=36:line_spacing=3:box=1:boxcolor=red@1:fontcolor=black,rotate=45:ow=rotw(45):oh=roth(45):c=black@0[txta];[mv][txta]overlay=x='min(0,-H*sin(45))+100':y='min(0,W*sin(45))+50':shortest=1&quot; output_video.mp4</code></p>

CC BY-SA 4.0
2021-01-12T06:12:01.687Z
thanks a lot for your help.
Tulshi Das
CC BY-SA 4.0
2021-01-11T10:40:25.183Z
2021-01-11T10:40:25.183Z
Gyan
<p><a href="https://i.sstatic.net/g970l.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/g970l.jpg" alt="enter image description here" /></a>I am using the command below to drawtext with rotation. This works but when set <code>fontcolor=black</code> It becomes transparent color.
I am not understanding the reason.</p>
<pre><code>ffmpeg -i input.mp4 -filter_complex &quot;color=black:100x100[c];[c][0]scale2ref[ct][mv];[ct]setsar=1,drawtext=fontfile='font.ttf':text='Test Text':fontsize=36:line_spacing=3:box=1:boxcolor=red@1:fontcolor=black,split[text][alpha];[text][alpha]alphamerge,rotate=45:ow=rotw(45):oh=roth(45):c=black@0[txta];[mv][txta]overlay=x='min(0,-H*sin(45))+100':y='min(0,W*sin(45))+50':shortest=1&quot; output_video.mp4
</code></pre>

<ffmpeg>
Black fontcolor being transparent in drawtext in ffmpeg
Tulshi Das
# Black fontcolor being transparent in drawtext in ffmpeg

(Asked by: username_0 on 2021-01-11)

I am using the command below to drawtext with rotation. This works but when set fontcolor=black It becomes transparent color.
I am not understanding the reason.
ffmpeg -i input.mp4 -filter_complex "color=black:100x100[c];[c][0]scale2ref[ct][mv];[ct]setsar=1,drawtext=fontfile='font.ttf':text='Test Text':fontsize=36:line_spacing=3:box=1:boxcolor=red@1:fontcolor=black,split[text][alpha];[text][alpha]alphamerge,rotate=45:ow=rotw(45):oh=roth(45):c=black@0[txta];[mv][txta]overlay=x='min(0,-H*sin(45))+100':y='min(0,W*sin(45))+50':shortest=1" output_video.mp4

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2021-01-11. Score: 1 | Accepted answer

The method in my [old answer](https://stackoverflow.com/q/38306321/) was a workaround due to a limitation in drawtext filter at the time of writing. It's easier now.

You're getting transparent text because the textcolor is used to set both the color as well as its opacity intensity, and since black represents 0, the text disappears.

Anyway, it's simpler after ffmpeg 3.1

`ffmpeg -i input.mp4 -filter_complex "color=black@0:100x100,format=yuva420p[c];[c][0]scale2ref[ct][mv];[ct]setsar=1,drawtext=fontfile='font.ttf':text='Test Text':fontsize=36:line_spacing=3:box=1:boxcolor=red@1:fontcolor=black,rotate=45:ow=rotw(45):oh=roth(45):c=black@0[txta];[mv][txta]overlay=x='min(0,-H*sin(45))+100':y='min(0,W*sin(45))+50':shortest=1" output_video.mp4`

> **Comments:**
> **username_0**: thanks a lot for your help.  

---

