title: Server-side video editing
body: <p>This is what I need to do on a server. </p>
  
  <p>Let's say that I have 3 video files:
  video1.avi 2 minutes -> 640x320
  video2.avi 1 minute -> 640x320
  video3.avi 1 minute -> 640x320</p>
  
  <p>I need to create video4.avi, that will be 2 minutes long and 1280x320, Containing the videos side by side (horizontally).I need video2 and video3 to be at the right side of video 1. Video3 should start after video video2 ends.</p>
  
  <ul>
  <li>I need to do this at the server side. </li>
  <li>Be able to compose video/audio without overlapping.</li>
  <li>Be able to add several small video clips to the right side of the longer video.</li>
  <li>This should be a command line tool.</li>
  </ul>
  
  <p>What can I use to accomplish this?</p>
  
  <p>First thing I thought was FFMPEG and Image Magick. Export the audio with FFMPEg and compose the video frames (exported by FFMPEG) into single images. I know I can generate a video file from frames and audio, but I don't know if it's possible to sync the audio files and compose them (video1's and videos2's audio should be mixed, play simultaneously).</p>
  
  <p>Any ideas?</p>