我从.mp4文件中提取视频剪辑持续时间,作为"hh:mm:ss“格式的字符串:
$duration = $shellfolder.GetDetailsOf($shellfile, 27)我想要获取文件夹中所有视频剪辑的总时长。如何在每次不提取秒、分钟的情况下对这些持续时间进行求和?
发布于 2015-10-09 00:04:04
将持续时间转换为[TimeSpan],然后将其与其他值相加:
$totalDuration = New-TimeSpan
# making up a loop since you didn't provide one
foreach ($shellfile in $Files) {
$duration = $shellfolder.GetDetailsOf($shellfile, 27)
$totalDuration += ([TimeSpan]$duration)
}https://stackoverflow.com/questions/33020628
复制相似问题