Im a beginner to ffmpeg. I want to set a gif animation as an overlay of input video from a x seconds to y second . I tried the following codes
var wmimage= 'public/source/watermark_file.gif';
ffmpeg('public/source/small.mp4')
.addOption(['-ignore_loop 0', '-i '+wmimage+ '','-filter_complex [0:v][1:v]overlay=10:10:shortest=1:'])
.save('public/video/output-video2.mp4');
This gives me gif animation overlay from start to end of the input video length. but i need to show the gif for a duration (eg: from :2second to: 5second). So i tried to adding
enable="between(t,2,5)"
at
.addOption(['-ignore_loop 0', '-i '+wmimage+ '','-filter_complex [0:v][1:v]overlay=10:10:shortest=1:enable="between(t,2,5)"'])
But it throws
Error: ffmpeg exited with code 1: Error initializing complex filters.
Invalid argument
I tried the enable option before overlay
and shortest
. but gives the same error.
Any help will appreciated.