15

I'm adding an overlay image to a video, which works, but I'd like to show it only in a certain time span:

ffmpeg -i video2.mp4 -i logo.png -filter_complex \
"[0:v][1:v]overlay=10:10:enable=between(t\,0\,30)" -codec:a copy out2.mp4

This shows the error

key 'enable' not found
1
  • Next time when asking questions about ffmpeg, please include the full, uncut command line output as well.
    – slhck
    Feb 10, 2014 at 7:44

1 Answer 1

20

The syntax looks right to me. Use single quotes so you don't have to escape the expression:

ffmpeg -i input.mp4 -i watermark.png -filter_complex \
"[0:v][1:v] overlay=10:10:enable='between(t,1,2)'" output.mp4

If you don't have an enable option, make sure you use an ffmpeg version 2.0 or higher. Timeline editing is only supported there (see Changelog).

If you want multiple images overlaid, use something like this:

ffmpeg -i input.mp4 -i watermark.png -i watermark2.png -filter_complex \
"[0:v][1:v] overlay=10:10:enable='between(t,1,2)' [tmp]; [tmp][2:v] overlay=20:20:enable='between(t,2,3)'" output.mp4
22
  • Thanks for suggestion. Can you give me link for ffmpeg version 2.0 or higher.
    – Sanket990
    Feb 10, 2014 at 11:27
  • You can download any version from the ffmpeg homepage: ffmpeg.org/download.html — depends on how you use it on Android though. You might have to compile it from source.
    – slhck
    Feb 10, 2014 at 12:55
  • thank u but getting 1 error unable to find suitable format '[tmp];[tmp][2:v] overlay=20:20:enable='between(t,2,3)'" output.mp4
    – Sanket990
    Feb 19, 2014 at 9:39
  • Ah, sorry, the newline has to be removed or escaped. Please check my update.
    – slhck
    Feb 19, 2014 at 9:46
  • i m executing update command getting error - opening an output file:overlay=10:10:enable='between(t,1,2)'. No such filter ''
    – Sanket990
    Feb 19, 2014 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.