powershell - 如何从 Mediainfo 中获取特定信息

我发现 mediainfo 是从视频文件中获取元数据的非常好的工具。但有时它对我来说太过分了。首先我应该提到我正在使用 Windows Powershell,在 Windows Powershell 中我使用 Mediainfo 作为命令行工具。工作非常简洁,但是当我使用普通的 XML 输出时,就像您可以在 Mediainfo 的 GUI 版本中看到的那样,我没有从我的视频文件中获得足够的信息。使用 --Full 命令时,我可以更好地了解元数据。不幸的是,我只需要第五个“持续时间”信息:

时长:00:04:42.520

但每次我尝试使用 --Inform="Video;%Duration%" 询问持续时间时,我总是得到第一个“持续时间”信息:

时长:282520

现在这是我的问题:是否可以以仅获取时间码持续时间的方式使用 Mediainfo 命令?因为我不知道哪个命令最适合解决这个问题。

C:\Mediainfo>mediainfo.exe C:\Users\Administrator\Desktop\input_luebeck\TheFascist.mov 
General
Count                                    : 292
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of video streams                   : 1
Count of audio streams                   : 1
OtherCount                               : 1
Video_Format_List                        : ProRes
Video_Format_WithHint_List               : ProRes
Codecs Video                             : apch
Video_Language_List                      : English
Audio_Format_List                        : PCM
Audio_Format_WithHint_List               : PCM
Audio codecs                             : PCM
Audio_Language_List                      : English
Other_Format_List                        : QuickTime TC
Other_Format_WithHint_List               : QuickTime TC
Other_Language_List                      : English
Complete name                            : C:\Users\Administrator\Desktop\input_luebeck\TheFascist.mov
Folder name                              : C:\Users\Administrator\Desktop\input_luebeck
File name                                : TheFascist
File extension                           : mov
Format                                   : MPEG-4
Format                                   : MPEG-4
Format/Extensions usually used           : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
Commercial name                          : MPEG-4
Format profile                           : QuickTime
Internet media type                      : video/mp4
Codec ID                                 : qt
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
Codec                                    : MPEG-4
Codec                                    : MPEG-4
Codec/Extensions usually used            : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
File size                                : 5983768576
File size                                : 5.57 GiB
File size                                : 6 GiB
File size                                : 5.6 GiB
File size                                : 5.57 GiB
File size                                : 5.573 GiB
Duration                                 : 282520
Duration                                 : 4mn 42s
Duration                                 : 4mn 42s 520ms
Duration                                 : 4mn 42s
Duration                                 : 00:04:42.520
Overall bit rate mode                    : VBR
Overall bit rate mode                    : Variable
Overall bit rate                         : 169439858
Overall bit rate                         : 169 Mbps
Stream size                              : 1062720
Stream size                              : 1.01 MiB (0%)
Stream size                              : 1 MiB
Stream size                              : 1.0 MiB
Stream size                              : 1.01 MiB
Stream size                              : 1.013 MiB
Stream size                              : 1.01 MiB (0%)
Proportion of this stream                : 0.00018
HeaderSize                               : 32
DataSize                                 : 5983559488
FooterSize                               : 209056
IsStreamable                             : No
Encoded date                             : UTC 2013-10-21 09:01:39
Tagged date                              : UTC 2013-10-21 09:15:35
File creation date                       : UTC 2014-09-29 14:30:28.168
File creation date (local)               : 2014-09-29 16:30:28.168
File last modification date              : UTC 2014-09-29 14:37:20.793
File last modification date (local)      : 2014-09-29 16:37:20.793
Writing library                          : Apple QuickTime
Writing library                          : Apple QuickTime
Writing library/Name                     : Apple QuickTime
Media/UUID                               : EF3223FC-064A-45E6-9F5D-E59BD682C489
Media/History/UUID                       : 2783B850-08F4-43DE-AEA5-3D8E7DD78570

最佳答案

隐藏功能;-)
使用

MediaInfo --Language=raw --Full  

然后您将看到用于模板的字段名称

这里:

MediaInfo --Language=raw --Full --Inform="Video;%Duration/String4%"

PS:如果您在 MediaInfo 论坛上发布问题,我(MediaInfo 的主要开发人员)会更快地看到问题。

https://stackoverflow.com/questions/26488857/

相关文章:

asp.net-mvc - 带有 Ckeditor 的 MVC2 应用程序“具有潜在危险的 Requ

r - 使用 `colnames` 的数值使用 `dplyr` 的 `mutate_at` 或替代方

visual-studio-2015 - IApplicationBuilder 不包含 UseWe

selenium-webdriver - 在 Heroku 上使用 webdrivers selen

extjs - 在绑定(bind) View 中应用条件

scala - 如何使用 Scala 在 lagom 中为 NoHostAvailableExcep

extjs - 商店的监听器功能在网格更新时触发两次

macos - Docker Mac 替代 --net=host

azure - 使用 Azure SQL 的 ASP.Net Core 2.1 Serilog SQ

macos - undefined symbol : "boost::system::generic