Shady Posted February 13, 2009 Share Posted February 13, 2009 Hi everybody! I'm a begginer at AutoIt and I have some questions Well, I need to get techincal video information from a video formats files such as file duration, video/audio streams, frames per second, etc. Can AutoIt do this? PS I used a search but I have not found any topic with the same problem. [font="Tahoma"]Sorry for my bad English, Russian is my native language...[/font] Link to comment Share on other sites More sharing options...
Andreik Posted February 13, 2009 Share Posted February 13, 2009 (edited) Hi everybody!I'm a begginer at AutoIt and I have some questions Well, I need to get techincal video information from a video formats files such as file duration, video/audio streams, frames per second, etc. Can AutoIt do this?PS I used a search but I have not found any topic with the same problem.Search on forum for MCI_Video.au3 Edited February 13, 2009 by Andreik Link to comment Share on other sites More sharing options...
Shady Posted February 13, 2009 Author Share Posted February 13, 2009 Search on forum for MCI_Video.au3It returned just one link... And I don't see anything in that thread that can help me. [font="Tahoma"]Sorry for my bad English, Russian is my native language...[/font] Link to comment Share on other sites More sharing options...
Andreik Posted February 13, 2009 Share Posted February 13, 2009 Look here:Video.au3 shotiko 1 Link to comment Share on other sites More sharing options...
Shady Posted February 13, 2009 Author Share Posted February 13, 2009 Andreik, it will be cool if you will show me how to use this UDF [font="Tahoma"]Sorry for my bad English, Russian is my native language...[/font] Link to comment Share on other sites More sharing options...
Shady Posted February 15, 2009 Author Share Posted February 15, 2009 is there's somebody who can help me? [font="Tahoma"]Sorry for my bad English, Russian is my native language...[/font] Link to comment Share on other sites More sharing options...
Manjish Posted February 15, 2009 Share Posted February 15, 2009 UDF's contain the functions u need.. just include them in ur script, and call them from there.. like this #include<Video.au3> $sFile='D:\VIDEOS\friends.mpg';put ur file path here $dimns=_Video_Dimension($sFile) MsgBox(4096,"Video Dimensions","Width: "&$dimns[0] & @CRLF & "Height: "&$dimns[1]) [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Manjish Posted February 15, 2009 Share Posted February 15, 2009 (edited) oops forgot to mention.. copy the video.au3 in ur @script directory.. where ur script resides.. or put it in the Include folder in c:\Program Files\AutoIT\Include.. Cheers, Edited February 15, 2009 by Manjish [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Shady Posted February 15, 2009 Author Share Posted February 15, 2009 Manjish, thanks, it works!But I don't understand how to get other info... I use this script:#NoTrayIcon #include <Video.au3> $sFile = 'I:\dc.mpg' $dimns=_Video_Dimension($sFile) $getFrameRate=_Video_FrameRate($sFile) $getLength=_Video_Length($sFile) MsgBox(4096,"Video Dimensions","Width: "&$dimns[0] & @CRLF & "Height: "&$dimns[1]) MsgBox(64, "Frames Rate", $getFrameRate) MsgBox(64, "Length", $getLength)Your example works but other not. 'Frames rate' and 'Length' returns 0. Can you tell me why? [font="Tahoma"]Sorry for my bad English, Russian is my native language...[/font] Link to comment Share on other sites More sharing options...
Shady Posted February 16, 2009 Author Share Posted February 16, 2009 Up [font="Tahoma"]Sorry for my bad English, Russian is my native language...[/font] Link to comment Share on other sites More sharing options...
Manjish Posted February 16, 2009 Share Posted February 16, 2009 Manjish, thanks, it works! But I don't understand how to get other info... I use this script: #NoTrayIcon #include <Video.au3> $sFile = 'I:\dc.mpg' $dimns=_Video_Dimension($sFile) $getFrameRate=_Video_FrameRate($sFile) $getLength=_Video_Length($sFile) MsgBox(4096,"Video Dimensions","Width: "&$dimns[0] & @CRLF & "Height: "&$dimns[1]) MsgBox(64, "Frames Rate", $getFrameRate) MsgBox(64, "Length", $getLength) Your example works but other not. 'Frames rate' and 'Length' returns 0. Can you tell me why? _Video_FrameRate ; Description....: Close a video. ; Syntax.........: _Video_FrameRate($sAlias) ; Parameters ....: $sAlias - Alias name returned by _Video_Open. ; Return values .: Success - Returns the Frames Per Second of the video. ; Failure - Return 0 and @error 1 ; @error 1 = Invalid Alias ; Author ........: smashly ; ==================================================================================================== ===== Func _Video_FrameRate($sAlias) U'll first need to use _Video_Open.. and the use this handle in _Video_FrameRate [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Shady Posted February 16, 2009 Author Share Posted February 16, 2009 Manjish, yes, i've used this but nothing change. it's still returns "0".Examples:1st script:#NoTrayIcon #include <Video.au3> $sFile = 'D:\Video\!NEW_VIDEO\AmytivilleHorror.avi' $hWnd="1280" $hWnd = "1" $iX="1" $iY="1" $iW="1280" $iH="720" $open = _Video_Open($sFile, $hWnd, $iX, $iY, $iW, $iH) $dimns=_Video_Dimension($sFile) $getFrameRate=_Video_FrameRate($sFile) $getLength=_Video_Length($sFile, 0) MsgBox(4096,"Video Dimensions","Width: "&$dimns[0] & @CRLF & "Height: "&$dimns[1]) MsgBox(4096, "Frames Rate", $getFrameRate) MsgBox(4096, "Length", $getLength)and second:#NoTrayIcon #include <Video.au3> $sFile = 'D:\Video\!NEW_VIDEO\AmytivilleHorror.avi' $hWnd="1280" $hWnd = "1" $iX="1" $iY="1" $iW="1280" $iH="720" $open = _Video_Open($sFile, $hWnd, $iX, $iY, $iW, $iH) $dimns=_Video_Dimension($sFile) $getFrameRate=_Video_FrameRate($open) $getLength=_Video_Length($sFile, 0) MsgBox(4096,"Video Dimensions","Width: "&$dimns[0] & @CRLF & "Height: "&$dimns[1]) MsgBox(4096, "Frames Rate", $getFrameRate) MsgBox(4096, "Length", $getLength)May be you will show me really stable script? ;-) [font="Tahoma"]Sorry for my bad English, Russian is my native language...[/font] Link to comment Share on other sites More sharing options...
Manjish Posted February 16, 2009 Share Posted February 16, 2009 1) keep ur video file open.. 2) use wingethandle to get the handle of the open video file.. 3) use it in _Video_Open.. [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Shady Posted February 16, 2009 Author Share Posted February 16, 2009 1) keep ur video file open.. 2) use wingethandle to get the handle of the open video file.. 3) use it in _Video_Open..Ok, please look this script: #NoTrayIcon #include <Video.au3> $iX = "1" $iY = "1" $iW = "1280" $iH = "720" $video = 'I:\dc.mpg' $hWnd= WinGetHandle("dc.mpg - GOM Player") _Video_Open($video, $hWnd, $iX, $iY, $iW, $iH) $dimns = _Video_Dimension($video) $getFrameRate = _Video_FrameRate($video) $getLength = _Video_Length($video, 0) MsgBox(4096, "Video Dimensions", "Width: " & $dimns[0] & @CRLF & "Height: " & $dimns[1]) MsgBox(4096, "Frames Rate", $getFrameRate) MsgBox(4096, "Length", $getLength) File is still open, title of window is correct but it STILL returns zeros. Where's my mistake? [font="Tahoma"]Sorry for my bad English, Russian is my native language...[/font] Link to comment Share on other sites More sharing options...
Manjish Posted February 16, 2009 Share Posted February 16, 2009 Here's where ur mistake is.. please read the comments in the video.au3 file.. _Video_Open($video, $hWnd, $iX, $iY, $iW, $iH) C'mon try.. I have pushed u in the right direction.. now find the solution.. [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Shady Posted February 16, 2009 Author Share Posted February 16, 2009 Oh my God I'm not so stupid, it works!! :)Manjish, thank you very much!!!So, really stable code:#NoTrayIcon #include <Video.au3> $iX = "1" $iY = "1" $iW = "1280" $iH = "720" $video = 'I:\Video\DM.avi' $hWnd= WinGetHandle("DM.avi - GOM Player") $sDevice = "AVIVideo" $file = _Video_Open($video, $hWnd, $iX, $iY, $iW, $iH, $sDevice) $dimns = _Video_Dimension($video) $getFrameRate = _Video_FrameRate($file) $getLength = _Video_Length($file, 0) MsgBox(4096, "Video Dimensions", "Width: " & $dimns[0] & @CRLF & "Height: " & $dimns[1]) MsgBox(4096, "Frames Rate", $getFrameRate) MsgBox(4096, "Length", $getLength)So, I have just one question: is it possible to get information about audio and video codecs of file? In comments of Video.au3 I haven't found any solution... [font="Tahoma"]Sorry for my bad English, Russian is my native language...[/font] Link to comment Share on other sites More sharing options...
Manjish Posted February 16, 2009 Share Posted February 16, 2009 i don't know of a way to do it in autoit (there maybe.. but haven't found.. so if any1 knows please share).. n i don't have time to find out how it can be done.. try using this. [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Belini Posted March 18, 2012 Share Posted March 18, 2012 @ Andreik, your UDF ran videos MKV, MPG, MP4, AVI and reornou the duration of them perfectly, congratulations on the excellent work My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now