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

FFmpeg trac at avcodec.org
Tue Jan 14 05:00:30 CET 2014


#3302: Cannot draw opaque text on transparent frame
----------------------------------+--------------------------------------
             Reporter:  Krieger   |                     Type:  defect
               Status:  new       |                 Priority:  normal
            Component:  avfilter  |                  Version:  git-master
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+--------------------------------------
 Summary of the bug:
 Below testcase may seem somewhat artifical and impractical.
 But actually with ffmpeg we can save transparent video (e.g. {{{ -vcodec
 png -pix_fmt rgba out.mov}}} )
 So let's say we want to render a video with opaque text over transparent
 background, for later overlaying. It ends out with the fact that we
 cannot: with background alpha = 0 and text alpha = 1, nothing is seen on
 image. We must increase background alpha, which not acceptable for desired
 result.

 How to reproduce:
 {{{
 ffmpeg -f lavfi -i
 "testsrc[testsrc];color=color=white at 0.0,drawtext=text=TEST:fontsize=50:fontfile=/usr/share/fonts/corefonts/verdana.ttf:fontcolor=red at 1.0[text];[testsrc][text]overlay"
 /tmp/tmp.ts
 ffmpeg version N-59815-gb79bccb Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Jan 14 2014 03:29:50 with gcc 4.6.3 (Gentoo 4.6.3 p1.13,
 pie-0.5.2)
   configuration: --enable-gpl --enable-libx264 --enable-encoder=libx264
 --disable-stripping --enable-debug --extra-cflags='-O0 -g -ggdb' --enable-
 libopus --enable-libvpx --enable-x11grab --enable-libfreetype --enable-
 filter=drawtext --enable-libzvbi
   libavutil      52. 62.100 / 52. 62.100
   libavcodec     55. 48.101 / 55. 48.101
   libavformat    55. 23.103 / 55. 23.103
   libavdevice    55.  5.102 / 55.  5.102
   libavfilter     4.  1.100 /  4.  1.100
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 17.104 /  0. 17.104
   libpostproc    52.  3.100 / 52.  3.100
 Input #0, lavfi, from
 'testsrc[testsrc];color=color=white at 0.0,drawtext=text=TEST:fontsize=50:fontfile=/usr/share/fonts/corefonts/verdana.ttf:fontcolor=red at 1.0[text];[testsrc][text]overlay':
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: rawvideo (Y4[11][8] / 0x80B3459), yuva420p,
 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
 File '/tmp/tmp.ts' already exists. Overwrite ? [y/N] y
 Output #0, mpegts, to '/tmp/tmp.ts':
   Metadata:
     encoder         : Lavf55.23.103
     Stream #0:0: Video: mpeg2video, yuv420p, 320x240 [SAR 1:1 DAR 4:3],
 q=2-31, 200 kb/s, 90k tbn, 25 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo -> mpeg2video)
 Press [q] to stop, [?] for help
 frame= 2313 fps=750 q=9.4 Lsize=    3047kB time=00:01:32.48 bitrate=
 269.9kbits/s
 video:2538kB audio:0kB subtitle:0 global headers:0kB muxing overhead
 20.054615%
 Received signal 2: terminating.
 }}}

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


More information about the FFmpeg-trac mailing list