如何使用mediainfo以秒或其他格式查找视频文件的持续时间?(How to find duration of a video file using mediainfo in seconds or other formats?)
如何以毫秒为单位查找视频文件的持续时间,即以确定性方式查找整数。 我已经使用ffprobe来获得持续时间,但它不给所有文件格式的持续时间。
How can I find duration of a video file in miliseconds i.e. in integer in deterministic way. I have used ffprobe to get the duration but it doesn't give duration for all file formats.
最满意答案
使用以下命令:
i)获得视频流的持续时间:
$ mediainfo --Inform="Video;%Duration%" [inputfile]ii)获取媒体文件的持续时间:
$ mediainfo --Inform="General;%Duration%" [inputfile]iii)仅获取音频流的持续时间:
$ mediainfo --Inform="Audio;%Duration%" [inputfile]iv)获取多个参数的值:
$ mediainfo --Inform="Video;%Width%,%Height%,%BitRate%,%FrameRate%" [inputfile]输出将是这样的:
1280,720,3000000,30.0Use the following commands:
i) To get the duration of video stream:
$ mediainfo --Inform="Video;%Duration%" [inputfile]ii) To get the duration of the media file:
$ mediainfo --Inform="General;%Duration%" [inputfile]iii) To get the duration of audio stream only:
$ mediainfo --Inform="Audio;%Duration%" [inputfile]iv) To get values of more than one parameter:
$ mediainfo --Inform="Video;%Width%,%Height%,%BitRate%,%FrameRate%" [inputfile]Output would be something like this:
1280,720,3000000,30.0更多推荐
发布评论