title: Adding subtitle in video using php-mpeg
body: <p>I am using <a href="https://github.com/PHP-FFMpeg/PHP-FFMpeg" rel="nofollow noreferrer">PHP-FFMpeg</a> (a php wrapper for FFMpeg exacutable library) for making a very basic video editor. 
  I am facing two issues right now. Below are description of those issues:</p>
  
  <p>1.) Currently, I am adding subtitles to the video by using code below:</p>
  
  <pre><code>shell_exec('ffmpeg\bin\ffmpeg.exe -i uploads\abc.mp4 -i uploads\abc.srt -scodec mov_text -metadata:s:s:0 language=eng uploads\converted\exportx1.mp4');
  </code></pre>
  
  <p>Now, Its kinda my own custom code for adding subtitles in the video. I want to find a way (as I am working with Laravel Framework) to implement this functionality through package mentioned above (if anyone have enough experience with this package).  </p>
  
  <p>There is an option in the package that provides us with the facility of adding custom filters. 
  I am trying with this code using that package: </p>
  
  <pre><code>$ffmpeg = FFMpeg\FFMpeg::create(array(
          'ffmpeg.binaries'  =&gt; 'ffmpeg\bin\ffmpeg.exe',
          'ffprobe.binaries' =&gt; 'ffmpeg\bin\ffprobe.exe',
          'timeout'          =&gt; 3600,
          'ffmpeg.threads'   =&gt; 2,
      ));
      $video = $ffmpeg-&gt;open('uploads\abc.mp4');
  
      $video
          -&gt;filters()
          -&gt;custom('-i uploads\abc.srt -scodec mov_text -metadata:s:s:0 language=eng')
  
  $video
          -&gt;save(new FFMpeg\Format\Video\WebM(), 'uploads\converted\exportx1.webm')
  </code></pre>
  
  <p>But its giving me <a href="http://www.screencast.com/t/RhbxW8IPM8" rel="nofollow noreferrer">this</a> error.</p>
  
  <p>2.) My second issue is that the shell_exec code (the first one) is adding the subtitles but I have to select them manually. I want them to be selected by default so that I don't have to perform another operation. </p>
  
  <p>Any kind of help would be appreciated. </p>