Reputation: 76
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
Reputation: 133873
Use ffprobe
to get the duration. Some cli examples you can adapt:
$ ffprobe -v error -show_entries format=duration -of default=nw=1:nk=1 input.mp4
108.501000
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