[FFmpeg-user] Overlay Filter: eval n value

Stefano Sabatini stefasab at gmail.com
Thu Jun 27 01:08:03 CEST 2013


On date Wednesday 2013-06-26 16:57:28 -0400, Joshua Ostrom wrote:
> I'm using the overlay filter to simply show a graphic a remove it x frames later.
> 
> ffmpeg -y -i myvido.mp4 \
> -loop 1 -i mygraphic.png \
> -filter_complex overlay=x=0:y='if(gte(n\,26)\,(n-26)*600\,0)' \
> myoutput.mp4
> 
> My understanding is that with the default of 'frame' for eval 'n'
> should be the frame number (from the input stream).
> 
> The input video has a frame rate of 13, so I assumed 26 would be ~ 2
> seconds into the video (26 / 13 = 2) however the output hows the
> graphic moving away at about 6 seconds (not 2).  If I reduce the
> check to 13 the graphic moves away after about 5 seconds.
>
> Why doesn't n seem to match up with the expected frame *number* (why
> am I seeing the graphic move away after 6 seconds and not two
> seconds)?

-loglevel debug should help you to debug it.

> I've tried using t as that would be most convenient, however the
> graphic is initially offset by 600(I assume because it's getting a
> NAN value initially that's not properly handled [bug])

Show the command. Keep in mind that if the PTS is not defined, t is
set to NAN, you can check those cases with isnan(t).

Also for enabling/disabling you should use the "enable" option (check
the Timeline section in man ffmpeg-filters).
-- 
FFmpeg = Fast and Forgiving Multipurpose Patchable Egregious Gem


More information about the ffmpeg-user mailing list