如何使用mediainfo以秒或其他格式查找视频文件的持续时间? [英] How to find duration of a video file using mediainfo in seconds or other formats?

查看:404
本文介绍了如何使用mediainfo以秒或其他格式查找视频文件的持续时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以确定的方式以毫秒为单位查找视频文件的持续时间,即整数。
我已经使用ffprobe来获取持续时间,但没有给出所有文件格式的持续时间。

解决方案

使用以下命令:



i)获取视频流的持续时间:

  $ mediainfo --Inform =Video;%Duration%[inputfile] 

ii)要获取媒体文件的持续时间:

  $ mediainfo --Inform =General;%Duration%[inputfile] 

iii)仅获取音频流的持续时间:

  $ mediainfo --Inform =Audio;%Duration%[inputfile] 

iv)获取多个参数的值:

  $ mediainfo --Inform =视频;%宽度%,%高度%,%BitRate%,%FrameRate%[inputfile] 

输出将是这样的:

  1280,720,3000000,30.0 
/ pre>

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.

解决方案

Use 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

这篇关于如何使用mediainfo以秒或其他格式查找视频文件的持续时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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