I'd like some help for a project I'm working for using FFmpeg (not an expert in video editing at all!!).
BASIC IDEA I have a lot of videos in a folder and I would like to compress them + to add a short video disclaimer before each video + to add a logo as an overlay during all the video (but not during the disclaimer, which is about 12 seconds). Presently I'm using this:
ffmpeg -i intro.mpg -i video.avi -i logo.png -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[vid1];[vid1][2:v]overlay=W-w-5:H-h-5:enable='between(t,12,300)'[vid2]" -map "[vid2]" -strict -2 -c:v libx265 -x265-params crf=28 -preset ultrafast -movflags faststart output.mp4
It works, however, I have to use the same command for a lot of videos and I don't know the duration of them (my plan is to use something as for i in *.avi; do ffmpeg -i "$i" "${i%.*}.mp4"; done
).
Any way to set the filter enable='between(t,12,X)'
setting X duration such as 'until the end of the video'?
Many thanks!
ADVANCED
A solution to the previous issue is good enough, however, I was wondering... Could it be possible to have the logo.png overlay shifting position after a certain amount of time, until the end of the movie? For instance, 10 minutes as overlay=W-w-5:H-h-5
, then 10 minutes overlay=5:H-h-5
, then 10' in overlay=5:5
, finally overlay=W-w-5:5
and again a new loop starting from bottom-right...
Maybe starting from something like this? enable=lt(mod(t\,3)\,1)
(no idea where to find friendly documentation about filters...)
Thank you again!
Daniele