title: Get video duration of file hosted on Amazon S3
body: <p>I'm starting a portal which distributes videos. The idea is to upload the videos to Amazon S3 and gather the necessary data using PHP from my server. So far everything works fine... the only thing I could not manage to get is the duration of the video :-( Could anybody give me a hint on how to accomplish it?</p>
  
  <p>Thanks,
  Miguel</p>
  
  <p>UPDATE:</p>
  
  <p>I finally opted to do it using FFmpeg. I have already installed FFmpeg on the server and I'm now trying to execute the command in the shell prior to execute it with PHP. I'm passing it the URL from Amazon (I tried both the cloudfront URL and the S3 URL) but it says that there is not such a directory or file. I've seen examples on the web using external files so I expected it to work.</p>
  
  <p>The command I'm using is</p>
  
  <pre><code>ffmpeg -i https://s3-eu-west-1.amazonaws.com/path/to/file.m4v
  </code></pre>
  
  <p>Is there something I need to configure in order to use external URLs?</p>