2

What I am trying to achieve: Programmatically (using some kind of script) combine two different videos to one video where the videos are shown side by side and sound from both videos is played simultaneously.

I found at least two ways I could display two videos side by side but in each one I have a different problem that makes it difficult to complete the process:

  1. Avisyth and Avs2Avi:
    Avisyth really makes the process easy. With a simple Avisyth script like this you should be able to play two videos side by side:

    video1=AVISource("d:\file1.avi")
    video2=AVISource("d:\file2.avi")
    StackHorizontal(video1,video2)


    The creation of a new output file can be done with avs2avi.
    The problem here is that i am not able to play even one avi file with avisyth because I get "AviSource couldn't locate a decompressor for fourcc xvid" message. I googled for the solutions to that problem but nothing helped. GSpot says that i have all the codecs needed and it seems I can not do anything. Because I can not get to running real videos, I dont know if the final video plays sounds from both videos. Avisyth installed correctly and I am able to run the following script StackHorizontal(version ,version).

  2. ffmpeg
    Works like a charm with two videos and the final file BUT i do not get the sounds from both videos but only the first one. I found out that the solution to add sound from the second video will be by using the libfaac in the command line, like that:

ffmpeg.exe -i video1.mp4 -vf "[in] scale=iw/2:ih/2, pad=2*iw:ih [left]; movie=video2.mp4, scale=iw/3:ih/3 [right]; [left][right] overlay=main_w/2:0 [out]" -c:a libfaac -b:v 768k Output.mp4

but i always get an error that the encoder libfaac can not be found. I downloaded the libfaac.dll but still no result.

Is there a solution to any of these problems? Is there another way to programmatically make one video from two videos that are played side by side? Thanks in advance.

MikeL
  • 5,385
  • 42
  • 41
  • 1
    libfaac requires ffmpeg to be compiled with `--enable-nonfree`, which results in it being non-redistributable: this is why Zeranoe and others who provide compiled builds can not include libfaac support. Instead you can use the native FFmpeg AAC encoder (but quality isn't great at low-to-mid bitrates): `-c:a libfaac -strict experimental -b:a 192k`. Although I'm not sure your command will also include the audio from the second input. – llogan Mar 21 '13 at 18:47

1 Answers1

0

Since using Avisynth seems to be no problem for you, you could just use another source filter. FFMS2 should fit the bill very nicely - it's fully standalone and doesn't depend on any system decoders like AviSource does.

Daiz
  • 328
  • 2
  • 6