#2769 closed enhancement (worksforme)
drawtext: draw expression on a range on frames
Reported by: | Charlie | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avfilter |
Version: | unspecified | Keywords: | drawtext |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
Hi, drawtext option has a 'draw' expression that specifies if the text should be drawn.
http://www.ffmpeg.org/ffmpeg-filters.html#drawtext-1
I figured out we could use the following expressions to write on, before, or after a specific frame: :draw='eq(n,42)', :draw='lt(n,42)', :draw='gt(n,42)'
Do you know how to combine two expressions to write text, for instance, on every frame between frames 10 and 42 ?
I couldn't find doc or examples for combining expressions, and the following don't work:
:draw='gt(n,10)&<(n,42)' -> crash
:draw='gt(n,10);lt(n,42)' -> only applies second expression
:draw='gt(n,10)':draw='lt(n,42)' -> only applies second expression
Thanks in advance
How to reproduce:
% ffmpeg -i test.mov -vf "[in]drawtext=fontsize=40:fontcolor=White:fontfile='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf':draw='gt(n,10)':draw='lt(n,42)':text='test':x=50:y=35" -vframes 60 -qscale 0 -preset medium -vcodec libx264 -pix_fmt yuv420p -strict experimental -y test.mp4 ffmpeg version 0.8.6-4:0.8.6-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers built on Apr 2 2013 17:02:36 with gcc 4.6.3
Change History (6)
comment:1 by , 12 years ago
Component: | FFmpeg → avfilter |
---|---|
Keywords: | fraw expression range frame removed |
Version: | 0.8.14 → unspecified |
comment:2 by , 12 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Replying to Charlie:
Do you know how to combine two expressions to write text, for instance, on every frame between frames 10 and 42 ?
The following works fine here:
draw='if(gt(n,10),lt(n,42))'
See http://ffmpeg.org/ffmpeg-all.html#Expression-Evaluation and please understand that this is a bug tracker, post usage questions on the ffmpeg-user mailing list.
comment:3 by , 12 years ago
Hi cehoyos,
I'm sorry if I posted my question on the wrong website.
I already read this article but I couldn't find an answer both on ffmpeg & libav documentations.
However, I've just found the answer in an ffmpeg forum: http://ffmpeg.gusari.org/viewtopic.php?f=16&t=769&p=1351&hilit=drawtext#p1351
:draw='gt(n,10)*lt(n,42)'
Thanks
comment:4 by , 12 years ago
RE: just saw your answer. Thank you very much.
If I have another doc question, I'll use the mailing list.
comment:5 by , 12 years ago
You are using ffmpeg from Libav and reporting their bug on FFmpeg but tracker.
Please read http://blog.pkh.me/p/13-the-ffmpeg-libav-situation.html