title: Fastest way to extract a specific frame from a video (PHP/ffmpeg/anything)
body: <p>I have a web page, which (among other things) needs to extract a specific frame from a user-uploaded video.  The user seeks to a particular part of a .mp4 in the player, then clicks a button, and an ajax call gets fired off to a php script which takes the .mp4, and the exact time from the video, and uses that to extract a "thumbnail" frame.</p>
  
  <p>My current solution is using the php <code>exec</code> command:</p>
  
  <p><code>exec("ffmpeg -i $videoPath -ss $timeOffset -vframes 1 $jpgOutputPath");</code></p>
  
  <p>...which works just great, except it's as slow as molasses.  My guess is that ffmpeg is a little too much for the job, and I might be able to do better by utilizing the underlying libraries or something... however I have zero idea how to do that.</p>
  
  <p>Ideally I don't want to have to install anything that requires a real "installation process"... i.e., dropping an executable into the folder with my web app is fine, but I'd rather not have to actually run an installer.  Also, the solution should be able to run on mac, linux and windows (though linux is the top priority).</p>
  
  <p>What can I do to speed this process up?</p>
  
  <p>Thanks.</p>