I'm using the drawtext and drawbox avfilters on FFmpeg, two of the most poorly documented functions known to man.
I'm struggling to work out if and how I can use them on only a single frame, i.e., drawtext on frame 22.
Current command:
ffmpeg -i test.wmv -y -b 800k -f flv -vcodec libx264 -vpre default -s 768x432 \
-g 250 -vf drawtext="fontfile=/home/Cyberbit.ttf:fontsize=24:text=testical:\
fontcolor=green:x=100:y=200" -qscale 8 -acodec libfaac -sn -vstats out.flv
Two elements mentioned in the documentation are n and t. However, I only seem to be able to use them in x and y. Not in text or even as other parameters.
Any help or FFmpeg guidance would be gratefully received.
In a great example of FFmpeg always keeping you on your toes, this is trivial to do with
drawtext
and extremely painful withdrawbox
.The key is that
drawtext
includes thedraw
parameter:So to only show text on frame 22:
drawbox
has nodraw
parameter, and there's no general way to emulate it, so you're left doing something like extracting the portion of video that you want to put the box on and then overlaying it with an offset:(though this will leave the last frame of
boxed.flv
visible forever) or breaking up the video into multiple pieces, drawing on the proper pieces, and then recombining.