[FFmpeg-user] overlay not connected to source error - drawtext

Nicolas George nicolas.george at normalesup.org
Sat Apr 28 09:52:39 CEST 2012


Le nonidi 9 floréal, an CCXX, Damon Edwards a écrit :
> [root at localhost test]# ffmpeg -i table.mp4 -vf
> "drawtext=textfile=txtoverlay:fontfile=/usr/share/fonts/default/ghostscript/bchb.pfa:x=(w-text_w)/2:y=(h-text_h-line_h)/2:fontsize=21:fontcolor=white:shadowy=2,fade=in:0:10:alpha=1,fade=out:30:10:alpha=1
> [over]; [in][over] overlay [out]"

drawtext is a filter: it reads frames, writes the text on top of them and
sends them to the next filter. As such, you did not provide an input, so it
takes the current one, which is the filtergraph input, which is therefore no
longer available for overlay.

> -r 29

That is a very strange choice.

> However, something like this works
> ffmpeg -i table.mp4 -vf
> "color=red at 0.2:270x50,fade=in:0:10:alpha=1,fade=out:30:10:alpha=1
> [over]; [in][over] overlay [out]" -r 29 -vcodec libx264 -acodec libfaac -ab
> "96k" -ac 2 -y overlaid.mp4

Yes: drawtext is writing its text on the red image. Unfortunately, there is
currently no way to get drawtext to write on a transparent image and produce
non-transparent text. The best you can do is probably to duplicate your
input (using split) to use it as input for drawtext.

Note that there is an off-by-one bug in overlay with the split filter. A
patch fixing it has been sent to the mailing-list but not yet reviewed.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20120428/dc509894/attachment.asc>


More information about the ffmpeg-user mailing list