[FFmpeg-user] drawtext with dynamic fontcolor

Michael Koch astroelectronic at t-online.de
Thu Sep 24 18:49:33 CEST 2015


Hello all,

I'm new to this list and have a question about drawtext with dynamic 
fontcolor.

The first example doesn't contain dynamic fontcolor and is working as 
expected.
It superimposes some text over the video with black color and 25% 
transparency:

ffmpeg -i temp.mp4 ^
-vf 
drawtext='fontfile=arial.ttf:text="TEST":fontcolor_expr=0x000000 at 0x40:fontsize=200' 
^
-codec:v mpeg4 out.mp4

Now I replace
   fontcolor_expr=0x000000 at 0x40
by
   fontcolor_expr=0x000000 at 0x%%{e:40}

Please note that the "%" character is escaped because I'm starting 
ffmpeg from a windows batch file.
Of course the constant doesn't make much sense -- I will replace it 
later by a more complicated expression.
But the constant 40 is a valid expression, isn't it?
The problem is that obviously the syntax isn't accepted by ffmpeg. 
What's wrong with it?
Can you please give me an example for dynamic fontcolor with correct syntax?

Thanks,
Michael



More information about the ffmpeg-user mailing list