0

I am using this command to overlay the image into the video.

ffmpeg",i", inputVideoPath,"-i", imageToOverlay,"
-filter_complex",overlay=10:10","-strict", "-2","-b:a" ,"32k",
"-r","15","-preset", "ultrafast",outputVideoPath

Can we set the dynamic values into the "overlay=x:y" also "imageToOverlay" which is image path?

Ahmad Arslan
  • 4,498
  • 8
  • 38
  • 59

1 Answers1

3

try this command

 //  test with watermark.png 128x128, add it to /sdcard/videokit/
String[] complexCommand = {"ffmpeg","-y" ,"-i", "/sdcard/videokit/in.mp4","-strict","experimental", "-vf", "movie=/sdcard/videokit/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]","-s", "320x240","-r", "30", "-b", "15496k", "-vcodec", "mpeg4","-ab", "48000", "-ac", "2", "-ar", "22050", "/sdcard/videokit/out.mp4"};

for more information check this link

check this link as well

Mustanser Iqbal
  • 5,017
  • 4
  • 18
  • 36
  • please check this http://stackoverflow.com/questions/10918907/how-to-add-transparent-watermark-in-center-of-a-video-with-ffmpeg – Mustanser Iqbal Jun 07 '16 at 12:08
  • 1
    i have only used this library for images in php.. but i found a link related to android and i saved it.. and i just share it with you.but i hope above commented link will help you – Mustanser Iqbal Jun 07 '16 at 12:09
  • yes its working but only for the specific position of watermark, I just need to put watermark on my dynamic x and y positions of array. – Ahmad Arslan Jun 08 '16 at 04:32
  • can you sahre the screenshot where it is adding watermark – Mustanser Iqbal Jun 08 '16 at 10:07