10

I have been trying to add image overlay on video, so that overlay image gets displayed for particular timeframe only.

By following the instructions from following link I am able to do overlay video with image such overlaid image is displayed for entire video running length. http://ffmpeg.gusari.org/viewtopic.php?f=8&t=1181

FFMPEG Command Used:

/data/data/com.example.test/lib/libffmpeg.so -i /storage/sdcard0/e.mp4 -i /storage/sdcard0/a.png -filter_complex [0:v][1:v]overlay=10:10 -codec:a copy /storage/sdcard0/testFFmpeg/cle3far.3gp 

However I need to overlay image for particular time interval of video. So I tried following command but it didn’t work.

FFMPEG Command that didn’t work:

/data/data/com.example.test/lib/libffmpeg.so -i /storage/sdcard0/e.mp4 -i /storage/sdcard0/a.png -filter_complex [0:v][1:v]overlay=10:10:enable=between(t\,0\,30) -codec:a copy /storage/sdcard0/testFFmpeg/cle3far.3gp 

Error Message:

Key ‘enable’ not found. ShelloutError initializing filter 'overlay' with args '10:10:enable=between(t,0,30)' ShelloutError configuring filters.

By googling, I was able to find that I need FFMPEG 2.0, so I tried creating new ffmpeg library by following http://vec.io/posts/how-to-build-ffmpeg-with-android-ndk, but it didn’t work either.

It would be great if someone can get me anything from following:

  1. an Android precompiled library for FFMPEG 2.0+ (libffmpeg.so)
  2. or a way to do image overlay without FFMPEG
trooper
  • 4,444
  • 5
  • 32
  • 32
Sanket990
  • 665
  • 1
  • 10
  • 22

1 Answers1

0

As of two years ago, it looks like this was not possible, so it may be that this hasn't changed. You can find a specific referennce here: http://ffmpeg.org/pipermail/ffmpeg-user/2012-January/004062.html

I can't seem to find anything about it more recently. There seems to be a way to start the overlay at a certain point in the video, but not to stop it later on (see this post for that information: Overlay video after set time offset with FFmpeg).

The suggestion from the first link is to apply it to the segment of the video that you want to display the overlay on, so that may be the only way unfortunately as of now (at least using partially using FFMPEG).

Community
  • 1
  • 1
GEMISIS
  • 434
  • 3
  • 11