[FFmpeg-user] Overlay Filter: eval n value

Joshua Ostrom josh at optionmarketmentor.com
Wed Jun 26 22:57:28 CEST 2013


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)?

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])

-filter_complex overlay=x=0:y='if(gte(n\,4)\,(n-4)*600\,0)' 

Any thoughts?

Thank
Josh




More information about the ffmpeg-user mailing list