Opened 12 years ago

Closed 12 years ago

#1196 closed defect (invalid)

drawtext parameter keys "n" and "t" not working

Reported by: ad Owned by:
Priority: important Component: avfilter
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

I tried using drawtext's "n" and "t" parameter keys using the example below:

ffmpeg -vsync 0 -t 10 -i in)video.mp4 -vf drawtext="fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf:text='Text at 5 Looks good':fontsize=20:fontcolor=red:x=100:y=100:n=688" out.mp4

[drawtext @ 0xa64ca40] Key 'n' not found.
[drawtext @ 0xa64e6c0] Error parsing options string: 'fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf:text=Text at 5 Looks good:fontsize=20:fontcolor=red:x=100:y=100:n=688'
Error initializing filter 'drawtext' with args 'fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf:text=Text at 5 Looks good:fontsize=20:fontcolor=red:x=100:y=100:n=688'

I get same error with "t" parameter.

If anyone knows if these parameters work, please give a usage example.

Otherwise, do you have any advice on how to achieve objective "1--" and "2--" below?

1-- Overlay text 10 seconds into the video.
2-- Overlay text over video at 1 second intervals into the video.

The text last for 1 second or specified duration.

I am trying to use drawtext filter to overlay text 10 seconds into the video. I couldn't find any solution using drawtext filter. i.e.
How to overlay text at specified seconds/frame into the video?

Change History (1)

in reply to:  description comment:1 by Stefano Sabatini, 12 years ago

Analyzed by developer: set
Reproduced by developer: set
Resolution: invalid
Status: newclosed

Replying to ad:

I tried using drawtext's "n" and "t" parameter keys using the example below:

ffmpeg -vsync 0 -t 10 -i in)video.mp4 -vf drawtext="fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf:text='Text at 5 Looks good':fontsize=20:fontcolor=red:x=100:y=100:n=688" out.mp4

[drawtext @ 0xa64ca40] Key 'n' not found.

[...]

I get same error with "t" parameter.

"n" and "t" are not drawtext options, but parameters to be employed in the x/y expressions, check the manual.

If anyone knows if these parameters work, please give a usage example.

There are two examples employing the "t" parameter in the manual.

Otherwise, do you have any advice on how to achieve objective "1--" and "2--" below?

1-- Overlay text 10 seconds into the video.

There are several ways to achieve this:

  • use the draw expression (undocumented)
  • specify an expression for y, so that the text is rendered *outside* the visible area according to a given expression
  • reconfigure the filter through an event (badly undocumented, check the ffmpeg-user archive)

2-- Overlay text over video at 1 second intervals into the video.

The text last for 1 second or specified duration.

Same tricks as above, with a possibly more complicated expression.

[...]

Note: See TracTickets for help on using tickets.