-1

I am trying to overlay two video+audio and make single video but I only get the first video voice only not getting second video voice. Here is my code:

String[] complexCommandv = {"ffmpeg", "-y", "-i", "/sdcard/videokit/in.mp4", "-i", "/sdcard/videokit/tttt.mp4", "-strict", "experimental", "-filter_complex", "[0:v:0]pad=iw*2:ih[bg];" + "[bg][1:v:1]overlay=w", "-s", "320x240", "-r", "30", "-b", "15496k", "-vcodec", "mpeg4", "-ab", "48000", "-ac", "2", "-ar", "22050", "/sdcard/videokit/partik.mp4"};
peterh
  • 11,875
  • 18
  • 85
  • 108
parik dhakan
  • 787
  • 4
  • 19
  • Crossposting the [same question](http://superuser.com/questions/1097909/ffmpeg-overlay-two-video-with-audio-in-single-video) to multiple Stack Exchange sites is not recommended and wastes time. I started writing an answer to this until I noticed it was also on [su]. – llogan Jul 07 '16 at 16:23
  • Next to LordNeckbeard I suggest to you, if you ask a question, then ask it as a question. The title of your question looks more like a tag cloud. – peterh Jul 09 '16 at 14:31

2 Answers2

0

You should use a command like this:

ffmpeg -i "videostream.mp4" -i "audiostream.aac" -acodec copy -vcodec copy "output.mp4"

Shalev Moyal
  • 644
  • 5
  • 12
0

Yeah!!! I made it myself with customized code.

        String[] complexCommand = {"ffmpeg", "-y", "-i", "/sdcard/videokit/g1.mp4",
                                    "-i", "/sdcard/videokit/t4.mp4",
                                    "-strict", "experimental", "-filter_complex",
                                    "[0:v:0]pad=iw*2:ih[bg];" + "[bg][1:v:1]overlay=w,scale=320x240; [0:1]pan=stereo|c0=2*c0|c1=3*c0[a0];[1:a]pan=stereo|c0=1*c0|c1=4*c0[a1];[a0][a1]amix=inputs=2:duration=first:dropout_transition=2",
                                    "-r", "30", "-b", "15496k", "-vcodec", "mpeg4", "-ab", "48000", "-ac", "2", "-ar", "22050", "-shortest", "/sdcard/videokit/parik.mp4"};
parik dhakan
  • 787
  • 4
  • 19