Re: [問題] 如何列出資料夾下所有影片長度
把以下內容存成 *.ps1 ,放到影片旁邊
對著ps1檔按右鍵 → 用PowerShell執行
win8測過可以,希望 win7也可以
===================================================
$Shell = New-Object -Com "Shell.Application"
dir *.wmv | % {
$File = $Shell.NameSpace($_.DirectoryName).ParseName($_.Name)
$Duration = $File.ExtendedProperty("Duration")
if ($Duration -ne $null ) {
$T = New-TimeSpan -Seconds ($Duration / (1000*1000*10) )
$Time = $T.tostring()
} else {$Time = ""}
"$Time " + $_.name
# 多加的,如果有人需要的話
# $Width = $File.ExtendedProperty("System.Video.FrameWidth")
# $Height = $File.ExtendedProperty("System.Video.FrameHeight")
# WMV之外的影片,系統可能需要裝Codec (不確定…)
# 如果副檔名給錯的話,可能會顯示不出來
# 例如,容器是mp4,副檔名卻用avi
} > 影片時間.txt
ii 影片時間.txt
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.230.108.251
※ 文章網址: http://www.ptt.cc/bbs/Windows/M.1406021007.A.052.html
※ 編輯: ddd321 (61.230.108.251), 07/22/2014 17:27:10
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):