title: FFMpeg Merge audio and video files
body: <p>I need to Merge an audio (.mp3) and video (.mov) file and output an mp4 file using FFMpeg PHP library.</p>
  
  <p>The following works:</p>
  
  <pre><code>$ffmpeg = \FFMpeg\FFMpeg::create([
      'ffmpeg.binaries'  =&gt; 'C:/ffmpeg/bin/ffmpeg.exe',
      'ffprobe.binaries' =&gt; 'C:/ffmpeg/bin/ffprobe.exe'
  ]);
  
  /* Open video file */
  $video = $ffmpeg-&gt;open('sample.mov');
  
  /* Resize video */
  $video
      -&gt;filters()
      -&gt;resize(new \FFMpeg\Coordinate\Dimension(320, 240))
      -&gt;synchronize();
  
  /* Take screenshot from video */
  $video-&gt;frame(\FFMpeg\Coordinate\TimeCode::fromSeconds(10))
      -&gt;save('screen.jpg');
  </code></pre>
  
  <p>However it's not quite what I need.
  The following command line code is exactly what I'm looking for but I can't figure out how to convert it into the same format as the above ($ffmpeg version).</p>
  
  <pre><code>exec("ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac output.mp4");
  </code></pre>
  
  <p>Question: 
  Anyone know how to convert the exec into PHP above?</p>
  
  <p>Thanks guys.</p>