TSP
TSP

Reputation: 76

How to get video file length uploaded to 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

Upvotes: 0

Views: 2066

Answers (1)

llogan
llogan

Reputation: 133873

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

Upvotes: 2

Related Questions