[FFmpeg-trac] #3302(avfilter:open): Cannot draw opaque text on transparent frame

FFmpeg trac at avcodec.org
Fri Sep 25 21:23:27 CEST 2015


#3302: Cannot draw opaque text on transparent frame
------------------------------------+------------------------------------
             Reporter:  Krieger     |                    Owner:
                 Type:  defect      |                   Status:  open
             Priority:  normal      |                Component:  avfilter
              Version:  git-master  |               Resolution:
             Keywords:  drawtext    |               Blocked By:
             Blocking:              |  Reproduced by developer:  1
Analyzed by developer:  0           |
------------------------------------+------------------------------------

Comment (by blutorange):

 For everybody coming across this issue as well as I did now, here is a
 workaround for now.

 {{{
 ffmpeg -f lavfi -i color=color=0x000000 at 1.0,format=yuva444p -vf
 "drawtext=shadowx=10:shadowy=20:shadowcolor=white:x=100:y=100:borderw=3:bordercolor=white:fontsize=40:text=Hello:fontcolor=0xFFFFFF at 1.0,colorchannelmixer=rr=0:rg=0:rb=0:ra=0:gr=0:gg=0:gb=0:ga=0:br=0:bg=0:bb=0:ba=0:ar=2.0:ag=2.0:ab=2.0:aa=0,drawtext=text=Hello:fontcolor=yellow:fontsize=40:x=100:y=100:borderw=3:bordercolor=black:shadowx=10:shadowy=20:shadowcolor=green"
 -vframes 1 -f image2 /tmp/out.png
 }}}

 This produces a transparent image with a yellow text, a black border and a
 green shadow and saves it to /tmp/out.png

 Draws the text once in white on a black background, uses the
 colorchannelmixer filter to extract an alpha mask, and then draws the text
 again.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3302#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list