如何将视频文件长度上传到Amazon S3?

I am using plupload to upload video files to Amazon S3 and am playing it using JWPlayer. Before video file is played, I display list of video files uploaded to S3. In this list I would like to display the duration of the video.

I have read the ffmpeg approach used with PHP. Is there a better approach to get the duration?

Regards

Use ffprobe to get the duration. Some cli examples you can adapt:

show duration in seconds

$ ffprobe -v error -show_entries format=duration -of default=nw=1:nk=1 input.mp4
108.501000

show duration in sexagesimal format (HH:MM:SS.MICROSECONDS)

$ ffprobe -v error -show_entries format=duration -sexagesimal -of default=nw=1:nk=1 input.mp4
0:01:48.501000