Created
July 16, 2019 16:44
-
-
Save langheran/473bd0b42e18a1d4fc5983e9c353db15 to your computer and use it in GitHub Desktop.
Get total MP4 duration inside current folder (in hours).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
totalDuration:=0 | |
Wmp := ComObjCreate("WMPlayer.OCX") | |
Loop, Files, %A_ScriptDir%\*.mp4 | |
{ | |
file:=A_LoopFileFullPath | |
Wmp.Url := file | |
duration:=0 | |
while(!duration) | |
duration:=Wmp.currentMedia.duration | |
totalDuration:=totalDuration+duration | |
} | |
Clipboard:=totalDuration/3600 | |
msgbox, % totalDuration/3600 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment