[FFmpeg-user] ~50% performance difference overlaying static image with png series using -vf/-filter_complex

Nicolas George nicolas.george at normalesup.org
Fri Aug 23 17:20:28 CEST 2013


Le sextidi 6 fructidor, an CCXXI, Paul B Mahol a écrit :
> I didn't benchmark but I assume -loop takes most of time as it decodes
> same file over and over again.
> So instead adding looping of main input inside overlay it would be
> better to add generic solution:
> repeat filter which would repeat each frame [0-inf] times.

There are a lot of things missing in overlay to achieve subtle effects, and
this is only one of them. I will try to make a summary on the -dev
mailing-list with useful suggestions.

To implement this particular effect in the most general case, the original
solution of sandwitching the background in front of the overlay to give the
sync seems the only solution.

If the video is CFR, the following hack should eliminate most of the
overhead due to the loop effect:

-loop 1 -i bg.png -i video.mp4 lavfi '[0] fps=25 [bg] ;
[bg] [1] overlay=shortest=1'

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20130823/e7505fc7/attachment.asc>


More information about the ffmpeg-user mailing list