0

I using ffmpeg through Android-NDK. I've 2 pieces of the videos , The first one is my main video and the second one is my effect video.

Now I wanna mix this 2 videos together, Is it possible ?

Note : Both videos decoding through MP4 format.

blahdiblah
  • 33,069
  • 21
  • 98
  • 152
iSun
  • 1,714
  • 6
  • 28
  • 57

1 Answers1

3

I don't know how to translate this into the API offhand, but the command-line version of what you're trying to do is something like:

ffmpeg -i main.mp4 -vf 'movie=effect.mp4 [f];[in][f] overlay=0:0 [out]' out.mp4

See the docs on movie and overlay for more information.

blahdiblah
  • 33,069
  • 21
  • 98
  • 152
  • Hi blahdiblah, Finally I find a way that we can run ffmpeg commands through execute on android, but I confuse on the word that in the beginning of the command line, I mean "ffmeg ..." in Android it should be "/data/package/ffmpeg" What should I put in ffmpeg folder, the original ffmpeg or something else? – iSun Mar 15 '12 at 16:35
  • Can't help you I'm afraid, I don't know where it usually gets installed. – blahdiblah Mar 15 '12 at 20:45
  • Okay , I tried to use this command on windows but I got an error from "-vf" word. – iSun Mar 15 '12 at 21:18
  • Maybe you're using an old version of ffmpeg? Video filters have been around for a while now. – blahdiblah Mar 15 '12 at 21:22
  • Yes, I use an old version of ffmpeg and test it in the new version and it worked. Is it possible to write this command line to c code? – iSun Mar 15 '12 at 21:28
  • Probably, but unfortunately I haven't worked much with the API so I can't. – blahdiblah Mar 15 '12 at 21:29
  • Okay, Where can I find the API that I need to write this command line in c code? – iSun Mar 15 '12 at 21:33
  • 1
    The link to the docs that I included in the answer is an excellent starting point. – blahdiblah Mar 15 '12 at 21:36