view raw
Michi Michi - 6 months ago 74
PHP Question

Get video duration of file hosted on Amazon S3

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?



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.

The command I'm using is

ffmpeg -i

Is there something I need to configure in order to use external URLs?


There is a sample code snippet from LongTail which uses PHP and FFMPeg

Seems to be another solution here:

You'll need FFMpeg installed on your server