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

编程入门 行业动态 更新时间:2024-10-06 06:50:24
如何使用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.0

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

更多推荐

本文发布于:2023-07-19 15:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1182585.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:或其他   如何使用   视频文件   持续时间   格式

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!