#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\icons\bad_movie\movie_error_2_win.ico #AutoIt3Wrapper_Outfile=Test_Movie_Integrity_1.21_x86.exe #AutoIt3Wrapper_Outfile_x64=Test_Movie_Integrity_1.21_x64.exe #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- Test Movie Integrity version: v1.11 AutoIt Version: 3.3.14.5 Author: Dani Rosen Script Function: Tests the validity of movies in a folder. Runs these tests: 1. Missing audio 2. Black frames 3. Incorrect length (compares to a master movie) 4. Improbable file size (compares to a master movie, +/- defined size threshold) 5. Outputs single frame at a defined time (i.e. - to see if a ball is in the same place at the same time) v1.10 - implemented selection of root folder to run several subfolders under it instead of just one folder. - fixed support for output image folder that contains spaces v1.11 - implemented test of write permissions - removed _ArrayDisplay extra entries #ce ---------------------------------------------------------------------------- FileInstall("c:\Utils\ffmpeg\ffmpeg.exe", @TempDir & "\ffmpeg.exe") FileInstall("c:\Utils\ffmpeg\ffprobe.exe", @TempDir & "\ffprobe.exe") #include #include ; for $ES_NUMBER #include #include "GUICtrlHyperLink.au3" #include #include #include #include #Include #include #include #include #include ; for $SS_CENTER #include #include ; for index of combobox _GUICtrlComboBox_GetCurSel #include ; for $BS_PUSHLIKE of button #include "GUIExtender.au3" ; for the collapsing Bad Frames settings Local $helpmenu, $infoitem, $exititem, $msg, $mainWin_Pos, $TestFileList Global $mainWin, $aboutWin, $infoWin, $Root_Folder, $Master_Folder, $MovieFormat, $FirstFile = "", $MasterFileList, $XS_n, $NumFilesTested, $NumFilesMaster Global $cutNameFrom, $cutNameTo, $currentProgressAll2, $currentProgressAll, $FirstFileFolderNoExt, $cutFileFolder, $OutImage_Folder = "" Global $LevelFolderList = [] $TestSingleFolderSelection = true ;Local $FFProbe = "c:\Utils\ffmpeg\ffprobe.exe" Local $FFProbe = @TempDir & "\ffprobe.exe" Local $FFProbeFileExists = FileExists($FFProbe) If $FFProbeFileExists Then ;MsgBox($MB_SYSTEMMODAL, "", "The file exists." & @CRLF & "FileExist returned: " & $FFProbeFileExists) Else MsgBox($MB_SYSTEMMODAL, "", '"ffprobe.exe" could not be found.' & @CRLF & "Please report to developer") EndIf ;Local $FFMpeg = "c:\Utils\ffmpeg\ffmpeg.exe" Local $FFMpeg = @TempDir & "\ffmpeg.exe" Local $FFMpegFileExists = FileExists($FFMpeg) If $FFMpegFileExists Then ;MsgBox($MB_SYSTEMMODAL, "", "The file exists." & @CRLF & "FileExist returned: " & $FFMpegFileExists) Else MsgBox($MB_SYSTEMMODAL, "", '"ffmpeg.exe" could not be found.' & @CRLF & "Please report to developer") EndIf ; ################# GUI SETUP ; XPStyle function below is meant for changing progressbar colors XPStyleToggle(1) #region GUI $mainWin = GUICreate("Test Movie Integrity v1.21", 340, 875) $mainWin_Pos = WinGetPos($mainWin, "") Local $filemenu = GUICtrlCreateMenu("&File") GUICtrlSetState(-1, $GUI_DEFBUTTON) GUICtrlCreateMenuItem("", $filemenu, 2) ; create a separator line $exititem = GUICtrlCreateMenuItem("Exit", $filemenu) $helpmenu = GUICtrlCreateMenu("Help") $infoitem = GUICtrlCreateMenuItem("Info", $helpmenu) $aboutitem = GUICtrlCreateMenuItem("About", $helpmenu) _GUIExtender_Init($mainWin, 0, 0, True) ; adding the ",0 ,0, True" (true really) - enables the spinners to show in the hidden section $checkBoxes_Section = _GUIExtender_Section_Create($mainWin, 0, 80) GUIStartGroup() $String_Title = "PERFORM THE FOLLOWING TESTS:" $Label_Title = GUICtrlCreateLabel($String_Title, 85, 10, 200, 15) ;GUICtrlSetFont($Label_Title, Default, 600) GUICtrlSetFont ($Label_Title, 8.5, 800, 0, "Tahoma") $Test_Audio = GUICtrlCreateCheckbox("Missing Audio", 50, 40, 100, 20) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlSetTip($Test_Audio, "Tests if the movie is missing a sound track", "Missing Audio", 1, 1) $Test_Black = GUICtrlCreateCheckbox("Bad Frames", 50, 65, 100, 20) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlSetTip($Test_Black, "Tests if the movie has black frames (missing frames), artefact, and other bad frames", "Bad Frames", 1, 1) $Test_Missing = GUICtrlCreateCheckbox("Missing Files", 50, 90, 100, 20) GUICtrlSetState(-1, $GUI_UNCHECKED) GUICtrlSetTip($Test_Missing, "Checks for missing clips (or wrong names)", "Missing Files", 1, 1) $Test_Length = GUICtrlCreateCheckbox("Incorrect Movie Length", 170, 40, 150, 20) GUICtrlSetState(-1, $GUI_UNCHECKED) GUICtrlSetTip($Test_Length, "Compares movie length with the length of a master movie", "Incorrect Movie Length", 1, 1) $Test_Resolution = GUICtrlCreateCheckbox("Incorrect Movie Resolution", 170, 65, 150, 20) GUICtrlSetState(-1, $GUI_UNCHECKED) GUICtrlSetTip($Test_Resolution, "Compares movie resolution with that of a master movie", "Incorrect Movie Resolution", 1, 1) $Test_Size = GUICtrlCreateCheckbox("Improbable File Size", 170, 90, 150, 20) GUICtrlSetState(-1, $GUI_UNCHECKED) GUICtrlSetTip($Test_Size, "Compares movie size with a master movie, +/- a defined threshold", "Improbable File Size", 1, 1) $BadFrames_Section = _GUIExtender_Section_Create($mainWin, 80, 80) GUICtrlCreateLabel("Bad Frames Settings...", 70, 115, 150, 15) _GUIExtender_Section_Activate($mainWin, $BadFrames_Section + 1, "", "", 48, 115, 15, 15) ; Note easy way to denote next section $BadFramesSettings_Section = _GUIExtender_Section_Create($mainWin, -1, 20) ; Save the section ID as a variable to use later $Label_Threshold = GUICtrlCreateLabel("Threshold of:", 10, 134, 100, 15) $Label_BadFrames = GUICtrlCreateLabel("BadFrames:", 60, 143, 80, 15) Global $iInitialValue = 0.6 Global $iIncrement = .1 $BadFramesThreshold = GUICtrlCreateInput($iInitialValue, 115, 140, 30, 20, $ES_NUMBER) $cDummyInput = GUICtrlCreateInput("", 160, 140, 1, 20) $BadFramesThresholdSpinner = GUICtrlCreateUpdown($cDummyInput, $UDS_ARROWKEYS) GUICtrlSetFont ($Label_Threshold, 7, 500, 0, "Tahoma") GUICtrlSetFont ($Label_BadFrames, 7, 500, 0, "Tahoma") GUICtrlSetFont ($BadFramesThreshold, 7, 500, 0, "Tahoma") $Label_Artefacts = GUICtrlCreateLabel("Artefacts:", 165, 143, 60, 15) $ArtefactsThreshold = GUICtrlCreateInput("205", 210, 140, 45, 20, $ES_NUMBER) $ArtefactsThresholdSpinner = GUICtrlCreateUpdown($ArtefactsThreshold, 0x0080) ; 0x0080 prevents the thousand separator that would read the number incorrectly GUICtrlSetLimit(-1, 1000, 0) GUICtrlSetFont ($Label_Artefacts, 7, 500, 0, "Tahoma") GUICtrlSetFont ($ArtefactsThreshold, 7, 500, 0, "Tahoma") $Label_Flicker = GUICtrlCreateLabel("Flicker:", 258, 143, 40, 15) $FlickerThreshold = GUICtrlCreateInput("30", 290, 140, 40, 20, $ES_NUMBER) $FlickerThresholdSpinner = GUICtrlCreateUpdown($FlickerThreshold, 0x0080) ; 0x0080 prevents the thousand separator that would read the number incorrectly GUICtrlSetLimit(-1, 100, 0) GUICtrlSetFont ($Label_Flicker, 7, 500, 0, "Tahoma") GUICtrlSetFont ($FlickerThreshold, 7, 500, 0, "Tahoma") $Movie_Section = _GUIExtender_Section_Create($mainWin, 180, 132) $String_MovieFormat = "Movie Format:" $Label_MovieFormat = GUICtrlCreateLabel($String_MovieFormat, 50, 183, 80, 15) $MovieFormat_Combo = GUICtrlCreateCombo("MP4", 120, 180, 50, 20) GUICtrlSetData($MovieFormat_Combo, "MOV|AVI", "MP4") GUICtrlSetTip($MovieFormat_Combo, "Make sure the right movie format is set here", "Movie Format", 1, 1) $String_SizeThreshold = "Size Threshold:" $Label_SizeThreshold = GUICtrlCreateLabel($String_SizeThreshold, 212, 163, 80, 15) GUICtrlSetState(-1, $GUI_DISABLE) $SizeThreshold = GUICtrlCreateInput("5000", 50, 10, 50, 30, $ES_NUMBER) GUICtrlSetState(-1, $GUI_DISABLE) $SizeThresholdSpinner = GUICtrlCreateUpdown($SizeThreshold, 0x0080) ; 0x0080 prevents the thousand separator that would read the number incorrectly GUICtrlSetLimit(-1, 10000, 0) GUICtrlSetPos($SizeThreshold, 212, 182, 50, 20) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetTip($SizeThreshold, "Set the size threshold here when comparing clips sizes." & @LF & "Will check for differences below and above this threshold", "Size Threshold", 1, 1) $SizeFormat_Combo = GUICtrlCreateCombo("", 265, 182, 50, 20) GUICtrlSetData($SizeFormat_Combo, "Bytes|Kb|Mb|Gb", "Kb") GUICtrlSetTip($SizeFormat_Combo, "Choose Size Units", "Size Units", 1, 1) GUICtrlSetState(-1, $GUI_DISABLE) $Folder_Section = _GUIExtender_Section_Create($mainWin, 208, 400) $TestMethodSingle = GUICtrlCreateRadio("Test Single Folder", 70, 210, 110, 15) GUICtrlSetTip($TestMethodSingle, "Tests a single game folder", "Test Single Folder", 1, 1) $TestMethodRoot = GUICtrlCreateRadio("Use Root Folder", 190, 210, 110, 15) GUICtrlSetTip($TestMethodRoot, "Test all folders under a Root Folder", "Use a Root Folder", 1, 1) GUICtrlSetState($TestMethodSingle, $GUI_CHECKED) $Hide_Reports = GUICtrlCreateCheckbox("Hide Report Notifications", 70, 226, 210, 20) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetFont ($Hide_Reports, 7, 500, 0, "Tahoma") GUICtrlSetTip($Hide_Reports, "Prevent Reports Popup Notifications that would pause the process", "Hide Report Notifications", 1, 1) $String_DirLevel = "Directory Levels:" $Label_DirLevel = GUICtrlCreateLabel($String_DirLevel, 210, 230, 80, 15) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetFont ($Label_DirLevel, 7, 500, 0, "Tahoma") $DirLevel = GUICtrlCreateInput("2", 10, 10, 10, 30, $ES_NUMBER) GUICtrlSetState(-1, $GUI_DISABLE) $DirLevelSpinner = GUICtrlCreateUpdown($DirLevel) GUICtrlSetLimit(-1, 9, 1) GUICtrlSetPos($DirLevel, 285, 227, 35, 20) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetTip($DirLevel, "Number of subfolders to go down the hierarchy" & @LF & "where movies are located", "Directory Levels", 1, 1) GUICtrlCreateGroup("Test Movie Folder", 20, 250, 300, 90) ; Movie Folder Button $Control_MovieFolderButton = GUICtrlCreateButton("Select Test Movie Folder", 60, 270, 220, 25) GUICtrlSetTip($Control_MovieFolderButton, "Select the folder where the movies to be tested are located" & @LF & _ "If using 'Root Folder' then this will be the main folder of all game folders", "Test Movie Folder", 1, 1) $String_MovieFolder = "not set" $Label_MovieFolder = GUICtrlCreateLabel($String_MovieFolder, 30, 300, 280, 15, $SS_CENTER) $String_FoundFiles = "" $Label_FoundFiles = GUICtrlCreateLabel($String_FoundFiles, 30, 320, 280, 15, $SS_CENTER) GUICtrlCreateGroup("Master Movie Folder", 20, 355, 300, 190) ; Master Movie Folder Button $Control_MasterMovieFolderButton = GUICtrlCreateButton("Select Master Movie Folder", 60, 375, 220, 25) GUICtrlSetTip($Control_MasterMovieFolderButton, "Select folder where the master movies are located," & @LF & "the ones to comapre with (length and size)", "Master Movie Folder", 1, 1) GUICtrlSetState(-1, $GUI_DISABLE) $String_MasterMovieFolder = "not set" $Label_MasterMovieFolder = GUICtrlCreateLabel($String_MasterMovieFolder, 30, 405, 280, 15, $SS_CENTER) GUICtrlSetState(-1, $GUI_DISABLE) $String_MasterFoundFiles = "" $Label_MasterFoundFiles = GUICtrlCreateLabel($String_MasterFoundFiles, 45, 425, 250, 15, $SS_CENTER) GUICtrlSetState(-1, $GUI_DISABLE) $Label_Identity1 = GUICtrlCreateLabel("Identical names starts at:", 30, 445) GUICtrlSetState(-1, $GUI_DISABLE) $cutNameLeft = GUICtrlCreateInput("5", 10, 10, 50, 20, $ES_NUMBER) GUICtrlSetState(-1, $GUI_DISABLE) $cutNameLeftSpinner = GUICtrlCreateUpdown($cutNameLeft) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetPos($cutNameLeft, 150, 443, 40, 20) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetTip($cutNameLeft, "Number of characters to cut from the START of the name for comparison", "Identical Base", 1, 1) Local $cutNameFrom = Number(GUICtrlRead($cutNameLeft)) $Label_Identity2 = GUICtrlCreateLabel("Cut from end:", 200, 445) GUICtrlSetState(-1, $GUI_DISABLE) $cutNameRight = GUICtrlCreateInput("0", 10, 10, 50, 20, $ES_NUMBER) GUICtrlSetState(-1, $GUI_DISABLE) $cutNameRightSpinner = GUICtrlCreateUpdown($cutNameRight) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetPos($cutNameRight, 270, 443, 40, 20) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetTip($cutNameRight, "Number of characters to cut from the END of the name for comparison", "Identical Base", 1, 1) Local $cutNameTo = Number(GUICtrlRead($cutNameRight)) $Label_IdentityExample = GUICtrlCreateLabel("Example first file:", 30, 475) GUICtrlSetState(-1, $GUI_DISABLE) $String_FirstFile = "This will show the first file" $Label_FirstFile = GUICtrlCreateLabel($String_FirstFile, 120, 475, 180, 15) GUICtrlSetState(-1, $GUI_DISABLE) $Label_IdentityPortion = GUICtrlCreateLabel("Identical portion:", 30, 495) GUICtrlSetState(-1, $GUI_DISABLE) $String_Portion = "This will show the portion to compare" $Label_Portion = GUICtrlCreateLabel($String_Portion, 120, 495, 180, 15) GUICtrlSetState(-1, $GUI_DISABLE) $compareLogical = GUICtrlCreateRadio("Logical Comparison", 45, 520, 110, 15) GUICtrlSetTip($compareLogical, "This method compares all the files from the Movie Folder to all the files of the Master Folder," & _ @LF & "making it more accurate." & @LF & "i.e. - These two files will yield different results, as they should:" & @LF & _ "0102_L_Foul_Dribbling_01.mp4" & @LF & "0201_L_Foul_Dribbling_01.mp4", "Logical Comparison", 1, 1) GUICtrlSetState(-1, $GUI_DISABLE) $comparePortion = GUICtrlCreateRadio("Compare Using Portion", 165, 520, 130, 15) GUICtrlSetTip($comparePortion, "This method compares only the identical portion - which may be less accurate since two files" & @LF & _ "that have the same portion will report equally when one might be missing." & @LF & _ "i.e. - These two files have the same portion ('L_Foul_Dribbling_01.mp4'):" & @LF & _ "0102_L_Foul_Dribbling_01.mp4" & @LF & "0201_L_Foul_Dribbling_01.mp4", "Portion Comparison", 1, 1) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetState($compareLogical, $GUI_CHECKED) $imgOutput_Section = _GUIExtender_Section_Create($mainWin, 555, 50) $Test_Output = GUICtrlCreateCheckbox("Output a Single Frame at a defined time", 50, 560, 220, 20) GUICtrlSetState(-1, $GUI_UNCHECKED) GUICtrlSetTip($Test_Output, "Saves an image from the movie at a defined time, to later compare with images" & @LF & "of other movies (i.e. - to check the position of a ball in the frame)", "Output a Single Frame at a defined time", 1, 1) ;_GUIExtender_Section_Activate($mainWin, $BadFrames_Section + 1, "", "", 48, 115, 15, 15) ; Note easy way to denote next section ;_GUIExtender_Section_Activate($mainWin, $BadFrames_Section + 1) $img_Section = _GUIExtender_Section_Create($mainWin, 600, 400) GUICtrlCreateGroup("Output Images Folder", 20, 590, 300, 150) ; Output Folder Button $Control_OutputImageFolderButton = GUICtrlCreateButton("Select Output Images Folder", 60, 610, 220, 25) GUICtrlSetTip($Control_OutputImageFolderButton, "Select the output folder where defined timed frames will be stored", "Output Image Folder", 1, 1) GUICtrlSetState(-1, $GUI_DISABLE) $String_OutputImageFolder = "not set" $Label_OutputImageFolder = GUICtrlCreateLabel($String_OutputImageFolder, 30, 640, 280, 15, $SS_CENTER) GUICtrlSetState(-1, $GUI_DISABLE) $Label_OutputTime1 = GUICtrlCreateLabel("Defined Time:", 80, 660) GUICtrlSetState(-1, $GUI_DISABLE) $Label_OutputTime2 = GUICtrlCreateLabel("Seconds", 195, 660) GUICtrlSetState(-1, $GUI_DISABLE) $OutputTime = GUICtrlCreateInput("4", 10, 10, 50, 20) GUICtrlSetState(-1, $GUI_DISABLE) $OutputTimeSpinner = GUICtrlCreateUpdown($OutputTime) GUICtrlSetTip($OutputTime, "Will output an image at second " & GUICtrlRead($OutputTime) & @LF & _ "(Make sure all games to compare use the same output time)", "Output Time", 1, 1) GUICtrlSetTip($OutputTimeSpinner, "Will output an image at second " & GUICtrlRead($OutputTime) & @LF & _ "(Make sure all games to compare use the same output time)", "Output Time", 1, 1) GUICtrlSetPos($OutputTime, 150, 658, 40, 20) $Label_FileFolder = GUICtrlCreateLabel("Subfolder names start at:", 30, 692) GUICtrlSetState(-1, $GUI_DISABLE) $cutFileFolderName = GUICtrlCreateInput("5", 10, 10, 50, 20, $ES_NUMBER) GUICtrlSetState(-1, $GUI_DISABLE) $cutFileFolderNameSpinner = GUICtrlCreateUpdown($cutFileFolderName) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetPos($cutFileFolderName, 160, 690, 40, 20) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetTip($cutFileFolderName, "Output images will be stored in sub-folders identical in name to other games", "Sliced Folder Names", 1, 1) Local $cutFileFolder = Number(GUICtrlRead($cutFileFolderName)) $Label_FileFolderExample = GUICtrlCreateLabel("Subfolder of first file:", 30, 715) GUICtrlSetState(-1, $GUI_DISABLE) $String_FirstFileFolder = "This will show the first File-Folder" $Label_FirstFileFolder = GUICtrlCreateLabel($String_FirstFileFolder, 130, 715, 180, 15) GUICtrlSetState(-1, $GUI_DISABLE) $end_Section = _GUIExtender_Section_Create($mainWin, -1, 100) $Testbutton = GUICtrlCreateCheckbox("RUN TESTS", 120, 750, 100, 40, $BS_PUSHLIKE) $String_Progress = "Awaiting..." $Label_Progress = GUICtrlCreateLabel($String_Progress, 75, 795, 200, 15, $SS_CENTER) $String_Counter = "" $Label_Counter = GUICtrlCreateLabel($String_Counter, 240, 795, 80, 15, $SS_RIGHT) $ProgressBarTest = GUICtrlCreateProgress(20, 815, 300, 8) GUICtrlSetColor($ProgressBarTest,0x0099ff) $ProgressBarAll = GUICtrlCreateProgress(20, 828, 300, 10) GUICtrlSetColor($ProgressBarAll,0x00ff00) $ProgressBarSubfolders = GUICtrlCreateProgress(20, 843, 300, 6) GUICtrlSetColor($ProgressBarSubfolders,0xff0000) _GUIExtender_Section_Create($mainWin, -99) GUICtrlCreateGroup("", -99, -99, 1, 1) ; Retract all extendable sections _GUIExtender_Section_Action($mainWin, 0, 0) GUISetState(@SW_SHOW) #endregion XPStyleToggle(0) _TipDisplayLen(15000) ;extend the tips display time ; ################# GUI CONTROLS While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $MovieFormat_Combo ListInfo() Case $msg[0] = $Control_MovieFolderButton ; Prompt For Directory $Root_Folder = FileSelectFolder("Please locate your source directory", "\\server\PROJECTS_SOCCER\") If $Root_Folder <> "" Then ConsoleWrite("Root Folder: " & $Root_Folder & @LF) if StringLen($Root_Folder) > 40 Then $String_MovieFolder = "..." & StringTrimLeft($Root_Folder, StringLen($Root_Folder)-40) Else $String_MovieFolder = $Root_Folder EndIf ListInfo() EndIf GUICtrlSetData($Label_MovieFolder, $String_MovieFolder) Case $msg[0] = $Test_Length OR $msg[0] = $Test_Size OR $msg[0] = $Test_Resolution OR $msg[0] = $Test_Missing If _IsChecked($Test_Length) OR _IsChecked($Test_Size) OR _IsChecked($Test_Resolution) OR _IsChecked($Test_Missing) Then GUICtrlSetState($Control_MasterMovieFolderButton, $GUI_ENABLE) GUICtrlSetState($Label_MasterMovieFolder, $GUI_ENABLE) GUICtrlSetState($cutNameLeft, $GUI_ENABLE) GUICtrlSetState($cutNameLeftSpinner, $GUI_ENABLE) GUICtrlSetState($cutNameRight, $GUI_ENABLE) GUICtrlSetState($cutNameRightSpinner, $GUI_ENABLE) GUICtrlSetState($Label_FirstFile, $GUI_ENABLE) GUICtrlSetState($Label_Portion, $GUI_ENABLE) GUICtrlSetState($Label_Identity1, $GUI_ENABLE) GUICtrlSetState($Label_Identity2, $GUI_ENABLE) GUICtrlSetState($Label_IdentityExample, $GUI_ENABLE) GUICtrlSetState($Label_IdentityPortion, $GUI_ENABLE) GUICtrlSetState($compareLogical, $GUI_ENABLE) GUICtrlSetState($comparePortion, $GUI_ENABLE) GUICtrlSetState($Label_MasterFoundFiles, $GUI_ENABLE) _GUIExtender_Section_Action($mainWin, $BadFramesSettings_Section, 9) ; toggling bad-frames section to prevent GUI problems with input boxes/spinners _GUIExtender_Section_Action($mainWin, $BadFramesSettings_Section, 9) Else GUICtrlSetState($Control_MasterMovieFolderButton, $GUI_DISABLE) GUICtrlSetState($Label_MasterMovieFolder, $GUI_DISABLE) GUICtrlSetState($cutNameLeft, $GUI_DISABLE) GUICtrlSetState($cutNameLeftSpinner, $GUI_DISABLE) GUICtrlSetState($cutNameRight, $GUI_DISABLE) GUICtrlSetState($cutNameRightSpinner, $GUI_DISABLE) GUICtrlSetState($Label_FirstFile, $GUI_DISABLE) GUICtrlSetState($Label_Portion, $GUI_DISABLE) GUICtrlSetState($Label_Identity1, $GUI_DISABLE) GUICtrlSetState($Label_Identity2, $GUI_DISABLE) GUICtrlSetState($Label_IdentityExample, $GUI_DISABLE) GUICtrlSetState($Label_IdentityPortion, $GUI_DISABLE) GUICtrlSetState($compareLogical, $GUI_DISABLE) GUICtrlSetState($comparePortion, $GUI_DISABLE) GUICtrlSetState($Label_MasterFoundFiles, $GUI_DISABLE) _GUIExtender_Section_Action($mainWin, $BadFramesSettings_Section, 9) ; toggling bad-frames section to prevent GUI problems with input boxes/spinners _GUIExtender_Section_Action($mainWin, $BadFramesSettings_Section, 9) EndIf If _IsChecked($Test_Size) Then GUICtrlSetState($Label_SizeThreshold, $GUI_ENABLE) GUICtrlSetState($SizeThreshold, $GUI_ENABLE) GUICtrlSetState($SizeThresholdSpinner, $GUI_ENABLE) GUICtrlSetState($SizeFormat_Combo, $GUI_ENABLE) Else GUICtrlSetState($Label_SizeThreshold, $GUI_DISABLE) GUICtrlSetState($SizeThreshold, $GUI_DISABLE) GUICtrlSetState($SizeThresholdSpinner, $GUI_DISABLE) GUICtrlSetState($SizeFormat_Combo, $GUI_DISABLE) EndIf Case $msg[0] = $cDummyInput GuiCtrlSetData($BadFramesThreshold, $iInitialValue + GuiCtrlRead($cDummyInput) * $iIncrement) Case $msg[0] = $Test_Output If _IsChecked($Test_Output) Then GUICtrlSetState($Control_OutputImageFolderButton, $GUI_ENABLE) GUICtrlSetState($Label_OutputImageFolder, $GUI_ENABLE) GUICtrlSetState($Label_OutputTime1, $GUI_ENABLE) GUICtrlSetState($Label_OutputTime2, $GUI_ENABLE) GUICtrlSetState($OutputTime, $GUI_ENABLE) GUICtrlSetState($OutputTimeSpinner, $GUI_ENABLE) GUICtrlSetState($Label_FileFolder, $GUI_ENABLE) GUICtrlSetState($cutFileFolderName, $GUI_ENABLE) GUICtrlSetState($cutFileFolderNameSpinner, $GUI_ENABLE) GUICtrlSetState($Label_FileFolderExample, $GUI_ENABLE) GUICtrlSetState($Label_FirstFileFolder, $GUI_ENABLE) _GUIExtender_Section_Action($mainWin, $BadFramesSettings_Section, 9) ; toggling bad-frames section to prevent GUI problems with input boxes/spinners _GUIExtender_Section_Action($mainWin, $BadFramesSettings_Section, 9) ;_GUIExtender_Section_Action($mainWin, $img_Section, 1) Else GUICtrlSetState($Control_OutputImageFolderButton, $GUI_DISABLE) GUICtrlSetState($Label_OutputImageFolder, $GUI_DISABLE) GUICtrlSetState($Label_OutputTime1, $GUI_DISABLE) GUICtrlSetState($Label_OutputTime2, $GUI_DISABLE) GUICtrlSetState($OutputTime, $GUI_DISABLE) GUICtrlSetState($OutputTimeSpinner, $GUI_DISABLE) GUICtrlSetState($Label_FileFolder, $GUI_DISABLE) GUICtrlSetState($cutFileFolderName, $GUI_DISABLE) GUICtrlSetState($cutFileFolderNameSpinner, $GUI_DISABLE) GUICtrlSetState($Label_FileFolderExample, $GUI_DISABLE) GUICtrlSetState($Label_FirstFileFolder, $GUI_DISABLE) _GUIExtender_Section_Action($mainWin, $BadFramesSettings_Section, 9) ; toggling bad-frames section to prevent GUI problems with input boxes/spinners _GUIExtender_Section_Action($mainWin, $BadFramesSettings_Section, 9) ;_GUIExtender_Section_Action($mainWin, $img_Section, 0) EndIf Case $msg[0] = $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED if $TestSingleFolderSelection == false Then GUICtrlSetData($Control_MovieFolderButton, "Select Test Movie Folder") GUICtrlSetState($Label_DirLevel, $GUI_DISABLE) GUICtrlSetState($DirLevel, $GUI_DISABLE) GUICtrlSetState($DirLevelSpinner, $GUI_DISABLE) GUICtrlSetState($Hide_Reports, $GUI_DISABLE) $Root_Folder = "" GUICtrlSetData($Label_FirstFileFolder, "This will show the first File-Folder") GUICtrlSetData($Label_FoundFiles, "") GUICtrlSetData($Label_MovieFolder, "not set") $TestSingleFolderSelection = true EndIf Case $msg[0] = $TestMethodRoot And BitAND(GUICtrlRead($TestMethodRoot), $GUI_CHECKED) = $GUI_CHECKED if $TestSingleFolderSelection == true Then GUICtrlSetData($Control_MovieFolderButton, "Select Test Movies Root Folder") GUICtrlSetState($Label_DirLevel, $GUI_ENABLE) GUICtrlSetState($DirLevel, $GUI_ENABLE) GUICtrlSetState($DirLevelSpinner, $GUI_ENABLE) GUICtrlSetState($Hide_Reports, $GUI_ENABLE) $Root_Folder = "" GUICtrlSetData($Label_FirstFileFolder, "This will show the first File-Folder") GUICtrlSetData($Label_FoundFiles, "") GUICtrlSetData($Label_MovieFolder, "not set") $TestSingleFolderSelection = False EndIf Case $msg[0] = $DirLevelSpinner _ArrayDisplay($LevelFolderList) ;ConsoleWrite("$levelFolderlist: " & $LevelFolderList & @CRLF) ListInfo() Case $msg[0] = $OutputTime OR $msg[0] = $OutputTimeSpinner GUICtrlSetTip($OutputTime, "Will output an image at second " & GUICtrlRead($OutputTime), "Output Time", 1, 1) GUICtrlSetTip($OutputTimeSpinner, "Will output an image at second " & GUICtrlRead($OutputTime), "Output Time", 1, 1) Case $msg[0] = $Control_MasterMovieFolderButton ; Prompt For Directory $Master_Folder = FileSelectFolder("Please locate Master directory", "\\server\PROJECTS_SOCCER\") If $Master_Folder <> "" Then ;$String_MasterMovieFolder = $Master_Folder ConsoleWrite("Master Folder: " & $Master_Folder & @LF) if StringLen($Master_Folder) > 40 Then $String_MasterMovieFolder = "..." & StringTrimLeft($Master_Folder, StringLen($Master_Folder)-40) Else $String_MasterMovieFolder = $Master_Folder EndIf GUICtrlSetData($Label_MasterMovieFolder, $String_MasterMovieFolder) ListInfo() EndIf Case $msg[0] = $cutNameRightSpinner OR $msg[0] = $cutNameLeftSpinner OR $msg[0] = $cutNameRight OR $msg[0] = $cutNameLeft $cutNameTo = Number(GUICtrlRead($cutNameRight)) $cutNameFrom = Number(GUICtrlRead($cutNameLeft)) If ($String_FirstFile <> "This will show the first file") AND ($String_FirstFile <> "No " & $MovieFormat & " files found") Then $String_Portion = StringTrimRight(StringTrimLeft($FirstFile, $cutNameFrom), $cutNameTo) GUICtrlSetData($Label_Portion, $String_Portion) EndIf Case $msg[0] = $compareLogical And BitAND(GUICtrlRead($compareLogical), $GUI_CHECKED) = $GUI_CHECKED $ComparisonLogic = True Case $msg[0] = $comparePortion And BitAND(GUICtrlRead($comparePortion), $GUI_CHECKED) = $GUI_CHECKED $ComparisonLogic = False Case $msg[0] = $Control_OutputImageFolderButton ; Prompt For Directory $OutImage_Folder = FileSelectFolder("Please locate Master directory", "\\server\PROJECTS_SOCCER\") If $OutImage_Folder <> "" Then ;$String_MasterMovieFolder = $Master_Folder ConsoleWrite("OutImage Folder: " & $OutImage_Folder & @LF) if StringLen($OutImage_Folder) > 40 Then $String_OutputImageFolder = "..." & StringTrimLeft($OutImage_Folder, StringLen($OutImage_Folder)-40) Else $String_OutputImageFolder = $OutImage_Folder EndIf ListInfo() EndIf GUICtrlSetData($Label_OutputImageFolder, $String_OutputImageFolder) Case $msg[0] = $cutFileFolderName OR $msg[0] = $cutFileFolderNameSpinner $cutFileFolder = Number(GUICtrlRead($cutFileFolderName)) If ($String_FirstFileFolder <> "This will show the first File-Folder") AND ($String_FirstFileFolder <> "No " & $MovieFormat & " files found") Then $String_FirstFileFolder = StringTrimLeft($FirstFileFolderNoExt[1], $cutFileFolder) EndIf GUICtrlSetData($Label_FirstFileFolder, $String_FirstFileFolder) Case $msg[0] = $aboutitem aboutWindow() Case $msg[0] = $infoitem infoWindow() Case $msg[0] = $GUI_EVENT_CLOSE Or $msg[0] = $exititem Exit Case $msg[0] = $Testbutton While GUICtrlRead($Testbutton) == $GUI_CHECKED GUICtrlSetData($Label_Progress, "Preparing...") If $Root_Folder = "" Then If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then MsgBox(4096, "Folder Not Selected", "No Movie Folder chosen") Else MsgBox(4096, "Root Folder Not Selected", "No Root Folder of game subfolders chosen") EndIf GUICtrlSetState($Testbutton, $GUI_UNCHECKED) GUICtrlSetData($Testbutton, "RUN") GUICtrlSetData($Label_Progress, "Awaiting...") ExitLoop EndIf if _PathIsWritable($Root_Folder) = False Then MsgBox(4096, "No Write Permission", "Test Folder should have write permissions to write the reports") GUICtrlSetState($Testbutton, $GUI_UNCHECKED) GUICtrlSetData($Testbutton, "RUN") GUICtrlSetData($Label_Progress, "Awaiting...") ExitLoop EndIf $MovieFormat = GUICtrlRead($MovieFormat_Combo) ;$TestFileList = _FileListToArray($Root_Folder, "*." & $MovieFormat, 1) ;$NumFilesTested = UBound($TestFileList)-1 ;ConsoleWrite("Number of files to test: " & $NumFilesTested & @LF) If $NumFilesTested < 1 Then MsgBox(0, "No " & $MovieFormat & " files", "No suitable files found in folder/s") GUICtrlSetState($Testbutton, $GUI_UNCHECKED) GUICtrlSetData($Testbutton, "RUN") GUICtrlSetData($Label_Progress, "Awaiting...") ExitLoop EndIf ; $LevelFolderList for multiple folders was defined in the ListInfo() function when Root_Folder of subfolder was selected. ; Setting it herer to contain the Root_Folder only if a single folder is chosen. If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $LevelFolderList[0] = $Root_Folder EndIf ; Looping through all the folders (or only one, in the case of Test_Single...) Global $NumTestSubfolders = UBound($LevelFolderList) For $p = 0 to $NumTestSubfolders-1 ConsoleWrite("Processing folder " & $p & ": " & $LevelFolderList[$p] & @CRLF) $currentSubFolder = $p + 1 Local $TestFileList = _FileListToArray($LevelFolderList[$p], "*." & $MovieFormat, 1) $NumFilesTested = UBound($TestFileList)-1 If $NumFilesTested < 1 Then ContinueLoop ; skip folders that don't have relevant files If (_IsChecked($Test_Missing) OR _IsChecked($Test_Length) OR _IsChecked($Test_Size) OR _IsChecked($Test_Resolution)) Then If $Master_Folder = "" Then MsgBox(4096, "Folder Not Selected", "Master Movie Folder not chosen") GUICtrlSetState($Testbutton, $GUI_UNCHECKED) GUICtrlSetData($Testbutton, "RUN") GUICtrlSetData($Label_Progress, "Awaiting...") ExitLoop Else ; extracting the team numbers from the Test folder and the Master folder Local $TestFilesTeams = StringSplit($TestFileList[1], "_") ; i.e. ["0913", "L", "Foul", "Dribbling", "01.mp4"] Local $MasterFilesTeams = StringSplit($MasterFileList[1], "_") Local $TestTeamA = StringTrimLeft($TestFilesTeams[1], 2) ; i.e. ["09"] Local $TestTeamB = StringTrimRight($TestFilesTeams[1], 2) ; i.e. ["13"] Local $MasterTeamA = StringTrimLeft($MasterFilesTeams[1], 2) Local $MasterTeamB = StringTrimRight($MasterFilesTeams[1], 2) ConsoleWrite("Current Teams to test: " & $TestTeamA & ", " & $TestTeamB & @CRLF) ; separating the list of files to TeamATeamB, and TeamBTeamA Local $TestFilesCombination1 = [] Local $TestFilesCombination2 = [] Local $MasterFilesCombination1 = [] Local $MasterFilesCombination2 = [] for $q = 1 to UBound($TestFileList)-1 if StringInStr($TestFileList[$q], ($TestTeamA & $TestTeamB)) Then _ArrayAdd($TestFilesCombination1, $TestFileList[$q]) if StringInStr($TestFileList[$q], ($TestTeamB & $TestTeamA)) Then _ArrayAdd($TestFilesCombination2, $TestFileList[$q]) Next for $w = 1 to UBound($MasterFileList)-1 if StringInStr($MasterFileList[$w], ($MasterTeamA & $MasterTeamB)) Then _ArrayAdd($MasterFilesCombination1, $MasterFileList[$w]) if StringInStr($MasterFileList[$w], ($MasterTeamB & $MasterTeamA)) Then _ArrayAdd($MasterFilesCombination2, $MasterFileList[$w]) Next EndIf EndIf If _IsChecked($Test_Size) Then Global $SizeThresholdBytes ; FileGetSize gets sizes in bytes, so we convert the spinner from Kb/Mb/Gb to bytes too Switch _GUICtrlComboBox_GetCurSel($SizeFormat_Combo) ; Check Size Units and convert to Bytes below Case 0 ; Bytes $SizeThresholdBytes = GUICtrlRead($SizeThreshold) ConsoleWrite("Size Units are Bytes. Threshold in bytes is: " & $SizeThresholdBytes & @CRLF) Case 1 ; Kb $SizeThresholdBytes = GUICtrlRead($SizeThreshold) * 1024 ConsoleWrite("Size Units are Kb. Threshold in bytes is: " & $SizeThresholdBytes & @CRLF) Case 2 ; Mb $SizeThresholdBytes = GUICtrlRead($SizeThreshold) * 1024 * 1024 ConsoleWrite("Size Units are Mb. Threshold in bytes is: " & $SizeThresholdBytes & @CRLF) Case 3 ; Gb $SizeThresholdBytes = GUICtrlRead($SizeThreshold) * 1024 * 1024 * 1024 ConsoleWrite("Size Units are Gb. Threshold in bytes is: " & $SizeThresholdBytes & @CRLF) EndSwitch EndIf If _IsChecked($Test_Output) AND $OutImage_Folder = "" Then MsgBox(4096, "Folder Not Selected", "Output Image Folder not chosen") GUICtrlSetState($Testbutton, $GUI_UNCHECKED) GUICtrlSetData($Testbutton, "RUN") GUICtrlSetData($Label_Progress, "Awaiting...") ExitLoop EndIf GUICtrlSetData($Testbutton, "RUNNING") Local $DoTests = [] If _IsChecked($Test_Audio) Then _ArrayAdd($DoTests, "Test_Audio") If _IsChecked($Test_Black) Then _ArrayAdd($DoTests, "Test_Black") If _IsChecked($Test_Missing) Then _ArrayAdd($DoTests, "Test_Missing") If _IsChecked($Test_Length) Then _ArrayAdd($DoTests, "Test_Length") If _IsChecked($Test_Size) Then _ArrayAdd($DoTests, "Test_Size") If _IsChecked($Test_Resolution) Then _ArrayAdd($DoTests, "Test_Resolution") If _IsChecked($Test_Output) Then _ArrayAdd($DoTests, "Test_Output") ;we don't need an output report, just a popup at the end showing the folder Local $NumberTests = UBound($DoTests)-1 If $NumberTests == 0 Then MsgBox(0, "Nothing to test", "No Tests Selected") GUICtrlSetState($Testbutton, $GUI_UNCHECKED) GUICtrlSetData($Testbutton, "RUN") GUICtrlSetData($Label_Progress, "Awaiting...") ExitLoop EndIf Local $progressDataTest = $NumFilesTested GUICtrlSetData($ProgressBarTest, "") ;Local $progressDataAll = $NumberTests ; when showing the progress of sections, one after another, instead of progress by all the files Local $progressDataAll = $NumberTests * $NumFilesTested GUICtrlSetData($ProgressBarAll, "") Local $TestReport[1][6] = [["Files", "Missing Audio", "Bad Frames", "Wrong Length", "Wrong Size", "Wrong Resolution"]] Local $MissingFiles[1][1] = [["Missing Files"]] for $a = 1 to Ubound($TestFileList)-1 Local $tempFileLine[1][6] = [[$TestFileList[$a], "-", "-", "-", "-", "-"]] ;_ArrayAdd($TestReport, $TestFileList[$a]) _ArrayAdd($TestReport, $tempFileLine) Next for $f = 1 to $NumberTests ConsoleWrite("processing: " & $f & " - " & $DoTests[$f] & @LF) $currentProgressAll = $f ; ############################################### TEST AUDIO If $DoTests[$f] == "Test_Audio" Then GUICtrlSetData($Label_Progress, "Testing Missing Audio...") for $t = 1 to Ubound($TestFileList)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = ($t & " / " & Ubound($TestFileList)-1) Else $counter_string = ($currentSubFolder & " / " & $t & " / " & Ubound($TestFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf $State_FFProbe = Run($FFProbe & ' -v error -show_entries format=nb_streams -of default=noprint_wrappers=1:nokey=1 "' & $LevelFolderList[$p] & "\" & $TestFileList[$t] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $String_FFProbe = StdoutRead($State_FFProbe) ; Get Output if $String_FFProbe <> "" Then if $String_FFProbe < 2 Then ; insert value into line $t, column 1 of audio $TestReport[$t][1] = "No Audio" EndIf EndIf $currentProgressTest = $t $currentProgressAll2 = (($f-1) * $NumFilesTested) + $t GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataTest) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next EndIf ; ############################################### TEST BLACK If $DoTests[$f] == "Test_Black" Then GUICtrlSetData($Label_Progress, "Testing Bad Frames...") for $t = 1 to Ubound($TestFileList)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = ($t & " / " & Ubound($TestFileList)-1) Else $counter_string = ($currentSubFolder & " / " & $t & " / " & Ubound($TestFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf Local $RootEscapedSlashes = StringReplace($LevelFolderList[$p], "\", "/") Local $RootEscapedColon = StringReplace($RootEscapedSlashes, ":", "\\:") $State_FFProbe = Run($FFProbe & ' -f lavfi -i "movie=' & $RootEscapedColon & "/" & $TestFileList[$t] & _ ',signalstats=stat=tout+vrep+brng" -show_frames -show_versions -of xml=x=1:q=1 -noprivate', "", @SW_HIDE, $STDOUT_CHILD) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $String_FFProbe = StdoutRead($State_FFProbe) $Array_FFProbe = StringSplit($String_FFProbe, @CR, 1) Local $qtoolsUMax = [] ; Display the maximum U value contained within the input frame. Local $qtoolsSATMax = [] ; Display the maximum saturation value contained within the input frame. Local $qtoolsYDif = [] ; Display the average of sample value difference between all values of the ; Y plane in the current frame and corresponding values of the previous input frame. Local $qtoolsVREP = [] ; Identify vertical line repetition. Vertical line repetition includes similar rows ; of pixels within a frame. For $q = 1 to UBound($Array_FFProbe)-1 if StringInStr($Array_FFProbe[$q], "UMAX") Then _ArrayAdd($qtoolsUMax, $Array_FFProbe[$q]) if StringInStr($Array_FFProbe[$q], "SATMAX") Then _ArrayAdd($qtoolsSATMax, $Array_FFProbe[$q]) if StringInStr($Array_FFProbe[$q], "YDIF") Then _ArrayAdd($qtoolsYDif, $Array_FFProbe[$q]) if StringInStr($Array_FFProbe[$q], "VREP") Then _ArrayAdd($qtoolsVREP, $Array_FFProbe[$q]) Next Local $badframe = False for $b = 1 to UBound($qtoolsVREP)-1 Local $line_VREP = StringSplit($qtoolsVREP[$b], '"') ;If $line_VREP[4] > 0.00 Then $badframe = "Bad Frame" ; found repetitive vertical line ; 0.00 was too low of a setting - should be above 0.5 ; If $line_VREP[4] > 0.5 Then ; using input value instead If $line_VREP[4] > GUICtrlRead($BadFramesThreshold) Then ConsoleWrite("Found Bad Frame with value: " & $line_VREP[4] & @CRLF) If $badframe <> False Then ;check if other frames were marked bad before $badframe = $badframe & "; " ; adding separator for new find Else $badframe = "" ; first find (clear $badframe variable) EndIf $badframe = $badframe & "Bad Frame: " & $b ; & "(" & $line_VREP[4] & ")" EndIf Next for $b = 1 to UBound($qtoolsUMax)-1 Local $line_Umax = StringSplit($qtoolsUMax[$b], '"') ;If $line_Umax[4] > 200 Then $badframe = "Artefact" ; found artefact ;If $line_Umax[4] > 205 Then ;using input value instead: If $line_Umax[4] > GUICtrlRead($ArtefactsThreshold) Then ConsoleWrite("Found Artefact with value: " & $line_Umax[4] & @CRLF) If $badframe <> False Then ;check if other frames were marked bad before $badframe = $badframe & "; " ; adding separator for new find Else $badframe = "" ; first find (clear $badframe variable) EndIf $badframe = $badframe & "Artefact: " & $b EndIf Next for $b = 1 to UBound($qtoolsSATMax)-1 Local $line_SATmax = StringSplit($qtoolsSATMax[$b], '"') ;If $line_SATmax[4] == 0 Then $badframe = "Black Frame" ; found black frame If $line_SATmax[4] == 0 Then If $badframe <> False Then ;check if other frames were marked bad before $badframe = $badframe & "; " ; adding separator for new find Else $badframe = "" ; first find (clear $badframe variable) EndIf $badframe = $badframe & "Black Frame: " & $b EndIf Next for $b = 1 to UBound($qtoolsYDif)-1 Local $line_YDif = StringSplit($qtoolsYDif[$b], '"') ;If $line_YDif[4] > 22 Then $badframe = "Flicker" ; found flicker ;If $line_YDif[4] > 22 Then ;using input value instead: Local $AbsFlicker = Abs($line_YDif[4]) ; making the value an Absolute makes it work in the line below: If $AbsFlicker > GUICtrlRead($FlickerThreshold) Then ConsoleWrite("Found Flicker with value: " & $AbsFlicker & @CRLF) If $badframe <> False Then ;check if other frames were marked bad before $badframe = $badframe & "; " ; adding separator for new find Else $badframe = "" ; first find (clear $badframe variable) EndIf $badframe = $badframe & "Flicker: " & $b EndIf Next ; insert value into line $t, column 2 of Black Frames If $badframe <> False Then $TestReport[$t][2] = $badframe $currentProgressTest = $t $currentProgressAll2 = (($f-1) * $NumFilesTested) + $t GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataTest) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next EndIf ; ############################################### TEST MISSING If $DoTests[$f] == "Test_Missing" Then Local $FoundMatch = False GUICtrlSetData($Label_Progress, "Testing Missing Files...") Local $progressDataMissing = Ubound($MasterFileList)-1 If $compareLogical And BitAND(GUICtrlRead($compareLogical), $GUI_CHECKED) = $GUI_CHECKED Then ; Comparing only lists of TeamATeamB: for $m = 1 to Ubound($MasterFilesCombination1)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = ($m & " / " & Ubound($MasterFileList)-1) Else $counter_string = ($currentSubFolder & " / " & $m & " / " & Ubound($MasterFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf $FoundMatch = False for $h = 1 to UBound($TestFilesCombination1)-1 Local $This_String_Portion = StringTrimRight(StringTrimLeft($TestFilesCombination1[$h], $cutNameFrom), $cutNameTo) if (StringInStr($MasterFilesCombination1[$m], $This_String_Portion, 0)) Then $FoundMatch = True ExitLoop EndIf Next If $FoundMatch == False Then Local $MissingFile = $TestTeamA & $TestTeamB & "_" & StringTrimRight(StringTrimLeft($MasterFilesCombination1[$m], $cutNameFrom), $cutNameTo) _ArrayAdd($MissingFiles, $MissingFile) EndIf $currentProgressTest = $m $currentProgressAll2 = (($f-1) * $NumFilesTested) + $m GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataMissing) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next ; Comparing only lists of TeamBTeamA: for $m = 1 to Ubound($MasterFilesCombination2)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = (($m + Ubound($MasterFilesCombination1)-1) & " / " & Ubound($MasterFileList)-1) Else $counter_string = ($currentSubFolder & " / " & ($m + Ubound($MasterFilesCombination1)-1) & " / " & Ubound($MasterFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf $FoundMatch = False for $h = 1 to UBound($TestFilesCombination2)-1 $This_String_Portion = StringTrimRight(StringTrimLeft($TestFilesCombination2[$h], $cutNameFrom), $cutNameTo) if (StringInStr($MasterFilesCombination2[$m], $This_String_Portion, 0)) Then $FoundMatch = True ExitLoop EndIf Next If $FoundMatch == False Then Local $MissingFile = $TestTeamB & $TestTeamA & "_" & StringTrimRight(StringTrimLeft($MasterFilesCombination2[$m], $cutNameFrom), $cutNameTo) _ArrayAdd($MissingFiles, $MissingFile) EndIf $currentProgressTest = (Ubound($MasterFilesCombination1)-1) + $m $currentProgressAll2 = (($f-1) * $NumFilesTested) + (Ubound($MasterFilesCombination1)-1) + $m GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataMissing) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next Else ; Portion Comparison (less accurate since duplicates might report false reports) for $m = 1 to Ubound($MasterFileList)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = ($m & " / " & Ubound($MasterFileList)-1) Else $counter_string = ($currentSubFolder & " / " & $m & " / " & Ubound($MasterFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf $FoundMatch = False for $h = 1 to UBound($TestFileList)-1 $This_String_Portion = StringTrimRight(StringTrimLeft($TestFileList[$h], $cutNameFrom), $cutNameTo) if (StringInStr($MasterFileList[$m], $This_String_Portion, 0)) Then $FoundMatch = True ExitLoop EndIf Next If $FoundMatch == False Then Local $MissingFile = StringTrimRight(StringTrimLeft($MasterFileList[$m], $cutNameFrom), $cutNameTo) _ArrayAdd($MissingFiles, $MissingFile) EndIf $currentProgressTest = $m $currentProgressAll2 = (($f-1) * $NumFilesTested) + $m GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataMissing) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next EndIf ; Report shows us at the end GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) EndIf ; ############################################### TEST LENGTH If $DoTests[$f] == "Test_Length" Then GUICtrlSetData($Label_Progress, "Testing Wrong Length...") If $compareLogical And BitAND(GUICtrlRead($compareLogical), $GUI_CHECKED) = $GUI_CHECKED Then ; Comparing only lists of TeamATeamB: for $t = 1 to UBound($TestFilesCombination1)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = ($t & " / " & Ubound($TestFileList)-1) Else $counter_string = ($currentSubFolder & " / " & $t & " / " & Ubound($TestFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf for $m = 1 to Ubound($MasterFilesCombination1)-1 $This_String_Portion_MasterFiles = StringTrimRight(StringTrimLeft($MasterFilesCombination1[$m], $cutNameFrom), $cutNameTo) If (StringInStr($TestFilesCombination1[$t], $This_String_Portion_MasterFiles, 0)) Then $State_FFProbe = Run($FFProbe & ' -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "' & $LevelFolderList[$p] & "\" & $TestFilesCombination1[$t] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $LengthOutput = StringSplit(StdoutRead($State_FFProbe), @CRLF) $LengthOutputNumer = Number($LengthOutput[1]) $String_FFProbe_DurationTestFile = Round($LengthOutputNumer,1) ; Get Output $State_FFProbe = Run($FFProbe & ' -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "' & $Master_Folder & "\" & $MasterFilesCombination1[$m] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $LengthOutput = StringSplit(StdoutRead($State_FFProbe), @CRLF) $LengthOutputNumer = Number($LengthOutput[1]) $String_FFProbe_DurationMasterFile = Round($LengthOutputNumer,1) ; Get Output If $String_FFProbe_DurationTestFile <> $String_FFProbe_DurationMasterFile Then $TestFileIndex = _ArraySearch($TestFileList, $TestFilesCombination1[$t]) If $String_FFProbe_DurationTestFile > $String_FFProbe_DurationMasterFile Then $TestReport[$TestFileIndex][3] = "Longer" Else $TestReport[$TestFileIndex][3] = "Shorter" EndIf EndIf ; if durations are not equal EndIf ; if strings are equal Next ; for all master files 1 $currentProgressTest = $t $currentProgressAll2 = (($f-1) * $NumFilesTested) + $t GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataTest) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next ; for all test files 1 ; Comparing only lists of TeamBTeamA: for $t = 1 to UBound($TestFilesCombination2)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = (($t + UBound($TestFilesCombination1)-1) & " / " & Ubound($TestFileList)-1) Else $counter_string = ($currentSubFolder & " / " & ($t + UBound($TestFilesCombination1)-1) & " / " & Ubound($TestFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf for $m = 1 to Ubound($MasterFilesCombination2)-1 $This_String_Portion_MasterFiles = StringTrimRight(StringTrimLeft($MasterFilesCombination2[$m], $cutNameFrom), $cutNameTo) If (StringInStr($TestFilesCombination2[$t], $This_String_Portion_MasterFiles, 0)) Then $State_FFProbe = Run($FFProbe & ' -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "' & $LevelFolderList[$p] & "\" & $TestFilesCombination2[$t] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $LengthOutput = StringSplit(StdoutRead($State_FFProbe), @CRLF) $LengthOutputNumer = Number($LengthOutput[1]) $String_FFProbe_DurationTestFile = Round($LengthOutputNumer,1) ; Get Output $State_FFProbe = Run($FFProbe & ' -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "' & $Master_Folder & "\" & $MasterFilesCombination2[$m] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $LengthOutput = StringSplit(StdoutRead($State_FFProbe), @CRLF) $LengthOutputNumer = Number($LengthOutput[1]) $String_FFProbe_DurationMasterFile = Round($LengthOutputNumer,1) ; Get Output If $String_FFProbe_DurationTestFile <> $String_FFProbe_DurationMasterFile Then $TestFileIndex = _ArraySearch($TestFileList, $TestFilesCombination2[$t]) If $String_FFProbe_DurationTestFile > $String_FFProbe_DurationMasterFile Then $TestReport[$TestFileIndex][3] = "Longer" Else $TestReport[$TestFileIndex][3] = "Shorter" EndIf EndIf ; if durations are not equal EndIf ; if strings are equal Next ; for all master files 2 $currentProgressTest = (UBound($TestFilesCombination1)-1) + $t $currentProgressAll2 = (($f-1) * $NumFilesTested) + (UBound($TestFilesCombination1)-1) + $t GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataTest) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next ; for all test files 2 Else ; Portion Comparison (less accurate since duplicates might report false reports) for $t = 1 to UBound($TestFileList)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = ($t & " / " & Ubound($TestFileList)-1) Else $counter_string = ($currentSubFolder & " / " & $t & " / " & Ubound($TestFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf for $m = 1 to Ubound($MasterFileList)-1 $This_String_Portion_MasterFiles = StringTrimRight(StringTrimLeft($MasterFileList[$m], $cutNameFrom), $cutNameTo) If (StringInStr($TestFileList[$t], $This_String_Portion_MasterFiles, 0)) Then $State_FFProbe = Run($FFProbe & ' -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "' & $Root_Folder & "\" & $TestFileList[$t] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $LengthOutput = StringSplit(StdoutRead($State_FFProbe), @CRLF) $LengthOutputNumer = Number($LengthOutput[1]) $String_FFProbe_DurationTestFile = Round($LengthOutputNumer,1) ; Get Output $State_FFProbe = Run($FFProbe & ' -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "' & $Master_Folder & "\" & $MasterFileList[$m] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $LengthOutput = StringSplit(StdoutRead($State_FFProbe), @CRLF) $LengthOutputNumer = Number($LengthOutput[1]) $String_FFProbe_DurationMasterFile = Round($LengthOutputNumer,1) ; Get Output If $String_FFProbe_DurationTestFile <> $String_FFProbe_DurationMasterFile Then If $String_FFProbe_DurationTestFile > $String_FFProbe_DurationMasterFile Then $TestReport[$t][3] = "Longer" Else $TestReport[$t][3] = "Shorter" EndIf EndIf ; if durations are not equal EndIf ; if strings are equal Next ; for all master files $currentProgressTest = $t $currentProgressAll2 = (($f-1) * $NumFilesTested) + $t GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataTest) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next ; for all test files EndIf EndIf ; ############################################### TEST SIZE If $DoTests[$f] == "Test_Size" Then GUICtrlSetData($Label_Progress, "Testing Wrong File Size...") If $compareLogical And BitAND(GUICtrlRead($compareLogical), $GUI_CHECKED) = $GUI_CHECKED Then ; Comparing only lists of TeamATeamB: for $t = 1 to UBound($TestFilesCombination1)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = ($t & " / " & Ubound($TestFileList)-1) Else $counter_string = ($currentSubFolder & " / " & $t & " / " & Ubound($TestFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf for $m = 1 to Ubound($MasterFilesCombination1)-1 $This_String_Portion_MasterFiles = StringTrimRight(StringTrimLeft($MasterFilesCombination1[$m], $cutNameFrom), $cutNameTo) If (StringInStr($TestFilesCombination1[$t], $This_String_Portion_MasterFiles, 0)) Then $TestFileSize = FileGetSize($LevelFolderList[$p] & "\" & $TestFilesCombination1[$t]) $MasterFileSize = FileGetSize($Master_Folder & "\" & $MasterFilesCombination1[$m]) If $TestFileSize > ($MasterFileSize + $SizeThresholdBytes) Then $TestFileIndex = _ArraySearch($TestFileList, $TestFilesCombination1[$t]) $TestReport[$TestFileIndex][4] = "Bigger" EndIf If $TestFileSize < ($MasterFileSize - $SizeThresholdBytes) Then $TestFileIndex = _ArraySearch($TestFileList, $TestFilesCombination1[$t]) $TestReport[$TestFileIndex][4] = "Smaller" EndIf EndIf ; if strings are equal Next ; for all master files 1 $currentProgressTest = $t $currentProgressAll2 = (($f-1) * $NumFilesTested) + $t GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataTest) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next ; for all test files 1 ; Comparing only lists of TeamBTeamA: for $t = 1 to UBound($TestFilesCombination2)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = (($t + Ubound($MasterFilesCombination1)-1) & " / " & Ubound($TestFileList)-1) Else $counter_string = ($currentSubFolder & " / " & ($t + Ubound($MasterFilesCombination1)-1) & " / " & Ubound($TestFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf for $m = 1 to Ubound($MasterFilesCombination2)-1 $This_String_Portion_MasterFiles = StringTrimRight(StringTrimLeft($MasterFilesCombination2[$m], $cutNameFrom), $cutNameTo) If (StringInStr($TestFilesCombination2[$t], $This_String_Portion_MasterFiles, 0)) Then $TestFileSize = FileGetSize($LevelFolderList[$p] & "\" & $TestFilesCombination2[$t]) $MasterFileSize = FileGetSize($Master_Folder & "\" & $MasterFilesCombination2[$m]) If $TestFileSize > ($MasterFileSize + $SizeThresholdBytes) Then $TestFileIndex = _ArraySearch($TestFileList, $TestFilesCombination2[$t]) $TestReport[$TestFileIndex][4] = "Bigger" EndIf If $TestFileSize < ($MasterFileSize - $SizeThresholdBytes) Then $TestFileIndex = _ArraySearch($TestFileList, $TestFilesCombination2[$t]) $TestReport[$TestFileIndex][4] = "Smaller" EndIf EndIf ; if strings are equal Next ; for all master files 2 $currentProgressTest = (UBound($TestFilesCombination1)-1) + $t $currentProgressAll2 = (($f-1) * $NumFilesTested) + (UBound($TestFilesCombination1)-1) + $t GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataTest) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next ; for all test files 2 Else ; Portion Comparison (less accurate since duplicates might report false reports) for $t = 1 to UBound($TestFileList)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = ($t & " / " & Ubound($TestFileList)-1) Else $counter_string = ($currentSubFolder & " / " & $t & " / " & Ubound($TestFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf for $m = 1 to Ubound($MasterFileList)-1 $This_String_Portion_MasterFiles = StringTrimRight(StringTrimLeft($MasterFileList[$m], $cutNameFrom), $cutNameTo) If (StringInStr($TestFileList[$t], $This_String_Portion_MasterFiles, 0)) Then $TestFileSize = FileGetSize($LevelFolderList[$p] & "\" & $TestFileList[$t]) $MasterFileSize = FileGetSize($Master_Folder & "\" & $MasterFileList) If $TestFileSize > ($MasterFileSize + $SizeThresholdBytes) Then $TestReport[$t][4] = "Bigger" If $TestFileSize < ($MasterFileSize - $SizeThresholdBytes) Then $TestReport[$t][4] = "Smaller" EndIf ; if strings are equal Next ; for all master files $currentProgressTest = $t $currentProgressAll2 = (($f-1) * $NumFilesTested) + $t GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataTest) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next ; for all test files EndIf EndIf ; ############################################### TEST RESOLUTION If $DoTests[$f] == "Test_Resolution" Then GUICtrlSetData($Label_Progress, "Testing Wrong Resolution...") If $compareLogical And BitAND(GUICtrlRead($compareLogical), $GUI_CHECKED) = $GUI_CHECKED Then ; Comparing only lists of TeamATeamB: for $t = 1 to UBound($TestFilesCombination1)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = ($t & " / " & Ubound($TestFileList)-1) Else $counter_string = ($currentSubFolder & " / " & $t & " / " & Ubound($TestFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf for $m = 1 to Ubound($MasterFilesCombination1)-1 $This_String_Portion_MasterFiles = StringTrimRight(StringTrimLeft($MasterFilesCombination1[$m], $cutNameFrom), $cutNameTo) If (StringInStr($TestFilesCombination1[$t], $This_String_Portion_MasterFiles, 0)) Then $State_FFProbe = Run($FFProbe & ' -v error -show_entries stream=width,height -of default=noprint_wrappers=1:nokey=1 "' & $LevelFolderList[$p] & "\" & $TestFilesCombination1[$t] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $String_FFProbe = StdoutRead($State_FFProbe) $Array_FFProbe = StringSplit($String_FFProbe, @CRLF, 1) if UBound($Array_FFProbe)-1 < 2 Then ; couldn't get resolution Local $TestFileWidth = 0 Local $TestFileHeight = 0 Else Local $TestFileWidth = $Array_FFProbe[1] Local $TestFileHeight = $Array_FFProbe[2] EndIf $State_FFProbe = Run($FFProbe & ' -v error -show_entries stream=width,height -of default=noprint_wrappers=1:nokey=1 "' & $Master_Folder & "\" & $MasterFilesCombination1[$m] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $String_FFProbe = StdoutRead($State_FFProbe) $Array_FFProbe = StringSplit($String_FFProbe, @CRLF, 1) if UBound($Array_FFProbe)-1 < 2 Then ; couldn't get resolution Local $MasterFileWidth = 0 Local $MasterFileHeight = 0 Else Local $MasterFileWidth = $Array_FFProbe[1] Local $MasterFileHeight = $Array_FFProbe[2] EndIf ;ConsoleWrite("Res Test: " & $TestFileWidth & "x" & $TestFileHeight & ", Res Master: " & $MasterFileWidth & "x" & $MasterFileHeight & @CRLF) If ($TestFileWidth <> $MasterFileWidth) Or ($TestFileHeight <> $MasterFileHeight) Then $TestFileIndex = _ArraySearch($TestFileList, $TestFilesCombination1[$t]) $TestReport[$TestFileIndex][5] = $TestFileWidth & "x" & $TestFileHeight EndIf ; Resolution mismatch EndIf ; if strings are equal Next ; for all master files 1 $currentProgressTest = $t $currentProgressAll2 = (($f-1) * $NumFilesTested) + $t GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataTest) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next ; for all test files 1 ; Comparing only lists of TeamBTeamA: for $t = 1 to UBound($TestFilesCombination2)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = (($t + UBound($TestFilesCombination1)-1) & " / " & Ubound($TestFileList)-1) Else $counter_string = ($currentSubFolder & " / " & ($t + UBound($TestFilesCombination1)-1) & " / " & Ubound($TestFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf for $m = 1 to Ubound($MasterFilesCombination2)-1 $This_String_Portion_MasterFiles = StringTrimRight(StringTrimLeft($MasterFilesCombination2[$m], $cutNameFrom), $cutNameTo) If (StringInStr($TestFilesCombination2[$t], $This_String_Portion_MasterFiles, 0)) Then $State_FFProbe = Run($FFProbe & ' -v error -show_entries stream=width,height -of default=noprint_wrappers=1:nokey=1 "' & $LevelFolderList[$p] & "\" & $TestFilesCombination2[$t] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $String_FFProbe = StdoutRead($State_FFProbe) $Array_FFProbe = StringSplit($String_FFProbe, @CRLF, 1) if UBound($Array_FFProbe)-1 < 2 Then ; couldn't get resolution Local $TestFileWidth = 0 Local $TestFileHeight = 0 Else Local $TestFileWidth = $Array_FFProbe[1] Local $TestFileHeight = $Array_FFProbe[2] EndIf $State_FFProbe = Run($FFProbe & ' -v error -show_entries stream=width,height -of default=noprint_wrappers=1:nokey=1 "' & $Master_Folder & "\" & $MasterFilesCombination2[$m] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $String_FFProbe = StdoutRead($State_FFProbe) $Array_FFProbe = StringSplit($String_FFProbe, @CRLF, 1) if UBound($Array_FFProbe)-1 < 2 Then ; couldn't get resolution Local $MasterFileWidth = 0 Local $MasterFileHeight = 0 Else Local $MasterFileWidth = $Array_FFProbe[1] Local $MasterFileHeight = $Array_FFProbe[2] EndIf ;ConsoleWrite("Res Test: " & $TestFileWidth & "x" & $TestFileHeight & ", Res Master: " & $MasterFileWidth & "x" & $MasterFileHeight & @CRLF) If ($TestFileWidth <> $MasterFileWidth) Or ($TestFileHeight <> $MasterFileHeight) Then $TestFileIndex = _ArraySearch($TestFileList, $TestFilesCombination2[$t]) $TestReport[$TestFileIndex][5] = $TestFileWidth & "x" & $TestFileHeight EndIf ; Resolution mismatch EndIf ; if strings are equal Next ; for all master files 2 $currentProgressTest = (UBound($TestFilesCombination1)-1) + $t $currentProgressAll2 = (($f-1) * $NumFilesTested) + (UBound($TestFilesCombination1)-1) + $t GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataTest) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next ; for all test files 2 Else ; Portion Comparison (less accurate since duplicates might report false reports) for $t = 1 to UBound($TestFileList)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = ($t & " / " & Ubound($TestFileList)-1) Else $counter_string = ($currentSubFolder & " / " & $t & " / " & Ubound($TestFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf for $m = 1 to Ubound($MasterFileList)-1 $This_String_Portion_MasterFiles = StringTrimRight(StringTrimLeft($MasterFileList[$m], $cutNameFrom), $cutNameTo) If (StringInStr($TestFileList[$t], $This_String_Portion_MasterFiles, 0)) Then $State_FFProbe = Run($FFProbe & ' -v error -show_entries stream=width,height -of default=noprint_wrappers=1:nokey=1 "' & $LevelFolderList[$p] & "\" & $TestFileList[$t] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $String_FFProbe = StdoutRead($State_FFProbe) $Array_FFProbe = StringSplit($String_FFProbe, @CRLF, 1) if UBound($Array_FFProbe)-1 < 2 Then ; couldn't get resolution Local $TestFileWidth = 0 Local $TestFileHeight = 0 Else Local $TestFileWidth = $Array_FFProbe[1] Local $TestFileHeight = $Array_FFProbe[2] EndIf $State_FFProbe = Run($FFProbe & ' -v error -show_entries stream=width,height -of default=noprint_wrappers=1:nokey=1 "' & $Master_Folder & "\" & $MasterFileList[$m] &'"', "", @SW_HIDE, 2) ProcessWaitClose($State_FFProbe) ; works better than while loop. No Sleep() needed and captures all stdout. $String_FFProbe = StdoutRead($State_FFProbe) $Array_FFProbe = StringSplit($String_FFProbe, @CRLF, 1) if UBound($Array_FFProbe)-1 < 2 Then ; couldn't get resolution Local $MasterFileWidth = 0 Local $MasterFileHeight = 0 Else Local $MasterFileWidth = $Array_FFProbe[1] Local $MasterFileHeight = $Array_FFProbe[2] EndIf If ($TestFileWidth <> $MasterFileWidth) Or ($TestFileHeight <> $MasterFileHeight) Then $TestReport[$t][5] = $TestFileWidth & "x" & $TestFileHeight EndIf ; Resolution mismatch EndIf ; if strings are equal Next ; for all master files $currentProgressTest = $t $currentProgressAll2 = (($f-1) * $NumFilesTested) + $t GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataTest) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next ; for all test files EndIf EndIf ; ############################################### TEST OUTPUT If $DoTests[$f] == "Test_Output" Then GUICtrlSetData($Label_Progress, "Outputting Images...") Local $OutputErrors = [] for $t = 1 to Ubound($TestFileList)-1 If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then $counter_string = ($t & " / " & Ubound($TestFileList)-1) Else $counter_string = ($currentSubFolder & " / " & $t & " / " & Ubound($TestFileList)-1) EndIf GUICtrlSetData($Label_Counter, $counter_string) If GUICtrlRead($Testbutton) == $GUI_UNCHECKED Then GUICtrlSetData($Testbutton, "STOPPED") ContinueLoop EndIf $FileNoExt = StringSplit($TestFileList[$t], ".") $FileFolder = StringTrimLeft($FileNoExt[1], $cutFileFolder) ;If DirGetSize($OutImage_Folder & "\" & $FileFolder) == 0 Then DirCreate($OutImage_Folder & "\" & $FileFolder) DirCreate($OutImage_Folder & "\" & $FileFolder) $State_FFMpeg = Run($FFMpeg & ' -loglevel warning -i "' & $LevelFolderList[$p] & "\" & $TestFileList[$t] &'" -ss ' & GUICtrlRead($OutputTime) _ & ' -vframes 1 -y "' & $OutImage_Folder & "\" & $FileFolder & "\" & $TestFileList[$t] & '_' & GUICtrlRead($OutputTime) & '.jpg"', "", @SW_HIDE, $STDERR_CHILD) ProcessWaitClose($State_FFMpeg) ; works better than while loop. No Sleep() needed and captures all stdout. $String_FFMpeg = StderrRead($State_FFMpeg) If (StringInStr($String_FFMpeg, "Output file is empty", 0)) Then ; this error can be ignored - just a warning about wrong pixel-format _ArrayAdd($OutputErrors, $TestFileList[$t]) ;ConsoleWrite("Error in " & $TestFileList[$t] & ": " & $String_FFMpeg & @CRLF) EndIf $currentProgressTest = $t $currentProgressAll2 = (($f-1) * $NumFilesTested) + $t GUICtrlSetData($ProgressBarTest, 100*$currentProgressTest/$progressDataTest) GUICtrlSetData($ProgressBarAll, 100*$currentProgressAll2/$progressDataAll) Next $output_errors = $LevelFolderList[$p] & "\Output_Errors.txt" If FileExists($output_errors) Then FileDelete($output_errors) If UBound($OutputErrors)-1 > 0 Then FileWriteLine($output_errors, "Couldn't Output images for these files:") Local $OutputErrorsString = "" For $o = 1 to UBound($OutputErrors)-1 $OutputErrorsString = $OutputErrorsString & $OutputErrors[$o] & @CRLF Next FileWriteLine($output_errors, $OutputErrorsString) if $TestMethodRoot And BitAND(GUICtrlRead($TestMethodRoot), $GUI_CHECKED) = $GUI_CHECKED Then If _IsChecked($Hide_Reports) == False Then MsgBox(4096, "Output Images", "Output images saved in:" & @CRLF & $OutImage_Folder & @CRLF & @CRLF & "Errors found on these files (i.e. bad time selected):" & @CRLF & $OutputErrorsString) EndIf Else MsgBox(4096, "Output Images", "Output images saved in:" & @CRLF & $OutImage_Folder & @CRLF & @CRLF & "Errors found on these files (i.e. bad time selected):" & @CRLF & $OutputErrorsString) EndIf Else if $TestMethodRoot And BitAND(GUICtrlRead($TestMethodRoot), $GUI_CHECKED) = $GUI_CHECKED Then If _IsChecked($Hide_Reports) == False Then MsgBox(4096, "Output Images", "Output images saved in:" & @CRLF & $OutImage_Folder) EndIf Else MsgBox(4096, "Output Images", "Output images saved in:" & @CRLF & $OutImage_Folder) EndIf EndIf EndIf Next ; end one cycle of running all the tests GUICtrlSetData($ProgressBarSubfolders, 100*$currentSubFolder/$NumTestSubfolders) ; ############################################### REPORTS GUICtrlSetData($Label_Counter, "") GUICtrlSetData($Label_Progress, "Generating Report...") $output_csv = $LevelFolderList[$p] & "\TestReport.csv" If FileExists($output_csv) Then FileDelete($output_csv) $ReportRows = UBound($TestReport) - 1 $ReportColumns = UBound($TestReport, 2) -1 SplashTextOn("","Generating Report...", 300, 80, -1, -1, 33, "Arial", 15, 500) For $i = 0 To $ReportRows $sLine = "" For $j = 0 To $ReportColumns $sLine &= $TestReport[$i][$j] & "," Next FileWriteLine($output_csv, StringTrimRight($sLine, 1)) Next If _IsChecked($Test_Missing) Then ConsoleWrite("Missing files found: " & UBound($MissingFiles) & @CRLF) if UBound($MissingFiles) > 1 Then Local $missing_csv = $LevelFolderList[$p] & "\Missing_Files.csv" If FileExists($missing_csv) Then FileDelete($missing_csv) $MissingRows = UBound($MissingFiles) - 1 $MissingColumns = UBound($MissingFiles, 2) -1 For $i = 0 To $MissingRows Local $sLine = "" For $j = 0 To $MissingColumns $sLine &= $MissingFiles[$i][$j] & "," Next FileWriteLine($missing_csv, StringTrimRight($sLine, 1)) Next EndIf EndIf SplashOff() if $TestMethodRoot And BitAND(GUICtrlRead($TestMethodRoot), $GUI_CHECKED) = $GUI_CHECKED Then ; if Hide_Reports is not checked then show the report for each folder processed If _IsChecked($Hide_Reports) == False Then $messageText = ("TestReport.csv written to:" & @CRLF & $output_csv & @CRLF & @CRLF & "View Report and File?" & @CRLF & "(Yes - with saved file, No - just Report)") Switch MsgBox($MB_YESNOCANCEL, "TestReport Written", $messageText); Yes - No Case $IDYES ;ShellExecute("notepad.exe"," " & $output_csv) ShellExecute($output_csv) _ArrayDisplay($TestReport, "Test Report", Default, 16, Default, Default, Default) Case $IDNO ;_ArrayDisplay($TestReport, "Test Report") _ArrayDisplay($TestReport, "Test Report", Default, 16, Default, Default, Default) Case $IDCANCEL ;nothing EndSwitch If _IsChecked($Test_Missing) Then if UBound($MissingFiles) > 1 Then _ArrayDisplay($MissingFiles, "Test Report - Missing Files") Else MsgBox(4096, "Missing Files", "No Missing Files Found", 20) EndIf EndIf EndIf Else ; Test_Single_Folder will always show the report $messageText = ("TestReport.csv written to:" & @CRLF & $output_csv & @CRLF & @CRLF & "View Report and File?" & @CRLF & "(Yes - with saved file, No - just Report)") Switch MsgBox($MB_YESNOCANCEL, "TestReport Written", $messageText); Yes - No Case $IDYES ;ShellExecute("notepad.exe"," " & $output_csv) ShellExecute($output_csv) _ArrayDisplay($TestReport, "Test Report", Default, 16, Default, Default, Default) Case $IDNO ;_ArrayDisplay($TestReport, "Test Report") _ArrayDisplay($TestReport, "Test Report", Default, 16, Default, Default, Default) Case $IDCANCEL ;nothing EndSwitch If _IsChecked($Test_Missing) Then if UBound($MissingFiles) > 1 Then _ArrayDisplay($MissingFiles, "Test Report - Missing Files") Else MsgBox(4096, "Missing Files", "No Missing Files Found", 20) EndIf EndIf EndIf Next ; end of folder loops GUICtrlSetState($Testbutton, $GUI_UNCHECKED) GUICtrlSetData($Testbutton, "COMPLETE") GUICtrlSetData($Label_Progress, "Done!") WEnd ; while the TestButton is pressed EndSelect ; Check for GUIExtender controls _GUIExtender_EventMonitor($msg[1], $msg[0]) WEnd Func ListInfo() $MovieFormat = GUICtrlRead($MovieFormat_Combo) If $Root_Folder <> "" Then ; if a test folder is selected then check if we're checking a single folder or a root folder of folders If $TestMethodSingle And BitAND(GUICtrlRead($TestMethodSingle), $GUI_CHECKED) = $GUI_CHECKED Then Local $TestFileList = _FileListToArray($Root_Folder, "*." & $MovieFormat, 1) $NumFilesTested = UBound($TestFileList)-1 ;ConsoleWrite("Number of files to test: " & $NumFilesTested & @LF) If $NumFilesTested < 1 Then GUICtrlSetData($Label_FoundFiles, "No " & $MovieFormat & " files found in folder") Else GUICtrlSetData($Label_FoundFiles, $NumFilesTested & " files to be tested") EndIf If $OutImage_Folder <> "" Then Local $FirstFileFolderList = _FileListToArray($Root_Folder, "*." & $MovieFormat, 1) $NumFirstFileFolderList = UBound($FirstFileFolderList)-1 If $NumFirstFileFolderList < 1 Then $String_FirstFileFolder = "No " & $MovieFormat & " files found" Else $FirstFileFolderNoExt = StringSplit($FirstFileFolderList[1], ".") $String_FirstFileFolder = StringTrimLeft($FirstFileFolderNoExt[1], $cutFileFolder) EndIf GUICtrlSetData($Label_FirstFileFolder, $String_FirstFileFolder) EndIf Else ; a root folder of subfolders was selected _ArrayDisplay($LevelFolderList, "LevelFolderList inside function") $LevelFolderList[0] = $Root_Folder For $d = 1 to GUICtrlRead($DirLevel) Local $currentLevelFolders = [] For $e = 0 to UBound($LevelFolderList)-1 if $LevelFolderList[$e] <> "" Then $thisLevelFolders = _FileListToArray($LevelFolderList[$e], "*", 2, True) if UBound($thisLevelFolders) > 0 Then For $w = 1 to UBound($thisLevelFolders)-1 _ArrayAdd($currentLevelFolders, $thisLevelFolders[$w]) Next EndIf Next _ArrayDelete($currentLevelFolders, 0) $LevelFolderList = $currentLevelFolders Next ;ConsoleWrite("about to test files in folder: " & $LevelFolderList[0] & @CRLF) $NumSubFolders = UBound($LevelFolderList) ;ConsoleWrite("numsubfolders: " & $NumSubFolders & ":" & @CRLF) ;ConsoleWrite("folders: " & $LevelFolderList & @CRLF) If $NumSubFolders > 0 Then ; parsing through folders of current level, searching for first match $folderMatch = False For $p = 0 to UBound($LevelFolderList)-1 $TestFileList = _FileListToArray($LevelFolderList[$p], "*." & $MovieFormat, 1) $NumFilesTested = UBound($TestFileList)-1 ;ConsoleWrite("Number of files to test: " & $NumFilesTested & @LF) If $NumFilesTested > 0 Then GUICtrlSetData($Label_FoundFiles, $NumSubFolders & " subfolders found, first folder contains: " & $NumFilesTested & " matches") $folderMatch = True Else GUICtrlSetData($Label_FoundFiles, "No " & $MovieFormat & " files found in first folder of Directory Level " & GUICtrlRead($DirLevel)) $folderMatch = False EndIf If $folderMatch == True Then ExitLoop Next Else GUICtrlSetData($Label_FoundFiles, "No Subfolders found on this Directory Level") EndIf If $OutImage_Folder <> "" Then If $folderMatch == True Then $FirstFileFolderNoExt = StringSplit($TestFileList[1], ".") $String_FirstFileFolder = StringTrimLeft($FirstFileFolderNoExt[1], $cutFileFolder) Else $String_FirstFileFolder = "No valid files found" EndIf GUICtrlSetData($Label_FirstFileFolder, $String_FirstFileFolder) EndIf EndIf EndIf If $Master_Folder <> "" Then $MasterFileList = _FileListToArray($Master_Folder, "*." & $MovieFormat, 1) $NumFilesMaster = UBound($MasterFileList)-1 If $NumFilesMaster < 1 Then GUICtrlSetData($Label_MasterFoundFiles, "No " & $MovieFormat & " files found in folder") $String_FirstFile = "No " & $MovieFormat & " files found" $String_Portion = "No " & $MovieFormat & " files found" Else GUICtrlSetData($Label_MasterFoundFiles, $NumFilesMaster & " master files to be compared with") $FirstFile = $MasterFileList[1] $String_FirstFile = $FirstFile $String_Portion = StringTrimRight(StringTrimLeft($FirstFile, $cutNameFrom), $cutNameTo) EndIf GUICtrlSetData($Label_FirstFile, $String_FirstFile) GUICtrlSetData($Label_Portion, $String_Portion) EndIf EndFunc Func _PathIsWritable($sFile) Local $aRet = DllCall('kernel32.dll', 'handle', 'CreateFileW', _ 'wstr', $sFile, _ 'dword', 2, _ 'dword', 7, _ 'struct*', 0, _ 'dword', 3, _ 'dword', 0x02000000, _ 'handle', 0) If @error Or $aRet[0] = Ptr(-1) Or $aRet[0] = 0 Then Return False DllCall('kernel32.dll', 'bool', 'CloseHandle', 'handle', $aRet[0]) Return True EndFunc ;==>_PathIsWritable Func aboutWindow() $aboutWin = GUICreate("About", 200, 90, $mainWin_Pos[0] + 250, $mainWin_Pos[1] + 50) GUICtrlCreateLabel("Test Movie Integrity v1.21", 35, 10) GUICtrlCreateLabel("Written by Dani Rosen © 2017", 25, 30) _GUICtrlHyperLink_Create("DaniRosen@hotmail.com", 40, 65, 130, 15, 0x0000FF, 0x551A8B, _ -1, 'mailto:DaniRosen@hotmail.com', 'DaniRosen@hotmail.com', $aboutWin) ;GUISetState(@SW_DISABLE,$mainWin) ; -- prevent mainWin access until this is closed GUISetState(@SW_SHOW,$aboutWin) GUISwitch($aboutWin) While 1 $msg = GUIGetMsg(1) If $msg[0] = $GUI_EVENT_CLOSE Then ExitLoop(1) WEnd ;GUISetState(@SW_ENABLE, $mainWin) ; -- prevent mainWin access until this is closed GUIDelete($aboutWin) GUISwitch($mainWin) EndFunc Func infoWindow() $infoWin = GUICreate("Test Movie Integrity - Help", 300, 350, $mainWin_Pos[0] + 250, $mainWin_Pos[1] + 50) GUICtrlCreateLabel("This tool tests movies in a given folder", 20, 10) GUICtrlCreateLabel("It can test the following potential problems:", 20, 30) GUICtrlCreateLabel("1. Checks if movies are missing their audio tracks", 20, 60) GUICtrlCreateLabel("2. Detects black frames and bad artefacts", 20, 90) GUICtrlCreateLabel("3. Compares with a master movie to see if:", 20, 120) GUICtrlCreateLabel(" 3a. It has the wrong length", 20, 140) GUICtrlCreateLabel(" 3b. It has a wrong size", 20, 160) GUICtrlCreateLabel(" 3c. It has the wrong resolution", 20, 180) GUICtrlCreateLabel(" 3d. Files are missing", 20, 200) GUICtrlCreateLabel(" When comparing files with a Master Folder, trim the", 20, 220) GUICtrlCreateLabel(" extension of the filenames from the end, and trim the", 20, 235) GUICtrlCreateLabel(" teams/players portion from the start, using the spinners.", 20, 250) GUICtrlCreateLabel("4. Outputs an image at a defined time so images can", 20, 280) GUICtrlCreateLabel(" later be compared between movies", 20, 300) GUICtrlCreateLabel(" (i.e. to check the position of a ball)", 20, 320) ;GUISetState(@SW_DISABLE,$mainWin) ; -- prevent mainWin access until this is closed GUISetState(@SW_SHOW,$infoWin) GUISwitch($infoWin) While 1 $msg = GUIGetMsg(1) If $msg[0] = $GUI_EVENT_CLOSE Then ExitLoop(1) WEnd ;GUISetState(@SW_ENABLE, $mainWin) ; -- prevent mainWin access until this is closed GUIDelete($infoWin) GUISwitch($mainWin) EndFunc Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked Func XPStyleToggle($OnOff = 1) If Not StringInStr(@OSTYPE, "WIN32_NT") Then Return 0 If $OnOff Then $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Return 1 ElseIf IsArray($XS_n) Then DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0]) $XS_n = "" Return 1 EndIf Return 0 EndFunc Func _TipDisplayLen($time=5000) Local $tiphandles, $i $tiphandles=WinList('[CLASS:tooltips_class32]') for $i=1 to $tiphandles[0][0] If WinGetProcess($tiphandles[$i][1]) = @AutoItPID Then _SendMessage($tiphandles[$i][1],0x0403,2,$time) Next EndFunc