如何获得上传到Amazon S3的视频文件的长度? [英] How to get video file length uploaded to Amazon S3?

查看:686
本文介绍了如何获得上传到Amazon S3的视频文件的长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用plupload上传视频文件到Amazon S3和我玩它使用JWPlayer。之前的视频文件播放,我显示上传到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.

我阅读了PHP中使用FFmpeg的方法。有没有更好的方式来获得持续的时间?

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

问候

推荐答案

使用 ffprobe ,以获得持续的时间。一些CLI例子,你可以适应:

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

这篇关于如何获得上传到Amazon S3的视频文件的长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆