ptrex Posted March 15, 2009 Share Posted March 15, 2009 (edited) VLC Media Player Many times I have seen attemps to get the famous VLC Payer into AU3. VLC media player - the cross-platform media player and streaming server VLC media player is a highly portable multimedia player for various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg, ...) as well as DVDs, VCDs, and various streaming protocols. It can also be used as a server to stream in unicast or multicast in IPv4 or IPv6 on a high-bandwidth network I seemed always to crash the GUI when using the VLC ActiveX object ? Before running the script download and install the VLC Player expandcollapse popupopt("GUIOnEventMode", 1) #include <GUIConstantsEX.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> ;VLCPlaylistMode Const $VLCPlayListInsert = 1 Const $VLCPlayListReplace = 2 Const $VLCPlayListAppend = 4 Const $VLCPlayListGo = 8 Const $VLCPlayListInsertAndGo = 9 Const $VLCPlayListReplaceAndGo = 10 Const $VLCPlayListAppendAndGo = 12 Const $VLCPlayListCheckInsert = 16 ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; ---------------------------------- Declare objects ------------------------------- $oVLC = ObjCreate("VideoLAN.VLCPlugin.1") ; -------------------------------------------- Main Gui --------------------------------- $hGui = GuiCreate("VLC Viewer", 500, 390,-1, -1, Bitor($WS_OVERLAPPEDWINDOW,$WS_VISIBLE, $WS_CLIPSIBLINGS)) GUISetOnEvent($GUI_EVENT_CLOSE, "GUIeventClose") $bSelect = GUICtrlCreateButton("Select ... ", 10, 20, 70) GUICtrlSetOnEvent(-1, "_SelectFile") ;$oVLC_Object = GUICtrlCreateObj ($hGui, 10, 70 , 700 , 460) ;GUICtrlSetStyle ( $oVLC_Object, $WS_VISIBLE ) ;GUICtrlSetResizing ($oVLC_Object,$GUI_DOCKAUTO) ; $GUI_DOCKAUTO Auto Resize Object GuiSetState() $size = WinGetPos("[active]") While 1 Sleep(100) WEnd Func _SelectFile () $File = FileOpenDialog("Select a movie File ", @MyDocumentsDir & "", "Images (*.flv;*.swf;*.wmv;*.avi;*.*)", 1) If @error Then MsgBox(4096,"","No File chosen ...") Return Else Sleep(100) _StartPlay($File) EndIf EndFunc Func _StartPlay($hFile) With $oVLC ;.AddTarget ($hFile, Default, $VLCPlayListInsert, 0) .MRL = $hFile .AutoLoop = 0 ;False .AutoPlay = 0 ;False .Visible = 1 ;True .Play () .Volume = 50 EndWith EndFunc Func GUIeventClose() Exit EndFunc ;==>GUIeventClose ;This is custom error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc The only way to get it run without crashing is NOT to use the "GUICtrlCreateObj". The VLC Player creates some kind of own GUI and Control when calling the Object. This make it hard of course to attach the Control to the parent window. Some Movie flexdrainwit.zip Enjoy !! Regards, ptrex Edited September 14, 2012 by ptrex mLipok 1 Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
FireFox Posted March 15, 2009 Share Posted March 15, 2009 @ptrex briliant !! Good job and useful COM udf Cheers, FireFox. Earthshine 1 Link to comment Share on other sites More sharing options...
ptrex Posted March 15, 2009 Author Share Posted March 15, 2009 @Firefox You are welcome !! But it needs lots of improvements. regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
FireFox Posted March 15, 2009 Share Posted March 15, 2009 @ptrex Of course, im waiting for this improvements Cheers, FireFox. Link to comment Share on other sites More sharing options...
87yj Posted March 17, 2009 Share Posted March 17, 2009 I got an error saying "The procedure point VLC_Play could not be located in the dll libvlc.dll I have VLC 0.98a installed. err.number # 8007007f err.lastdllerror 127 err.scriptline 20 Link to comment Share on other sites More sharing options...
ptrex Posted March 18, 2009 Author Share Posted March 18, 2009 @87yj This means that your system did not install correctly the VLC Player. try reinstalling it or run this cmd "regsvr32 "C:\Program Files\VideoLAN\VLC\axvlc.dll" Regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
ghetek Posted March 20, 2009 Share Posted March 20, 2009 im getting no video when i run your example. i get audio in the background. when thw app starts i get the following error: errnumber is FFFFFFFF err.lastdllerror is 0 err.scriptline is 41 Link to comment Share on other sites More sharing options...
ghetek Posted March 20, 2009 Share Posted March 20, 2009 line 41 is $oVLC_Object = GUICtrlCreateObj ($hGui, 10, 70 , 700 , 460) Link to comment Share on other sites More sharing options...
ptrex Posted March 20, 2009 Author Share Posted March 20, 2009 @ghetek I don't see what you mean ? Rgds ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
fZkFUvA Posted March 20, 2009 Share Posted March 20, 2009 (edited) All this fails to [link snipped] ! Edited March 20, 2009 by SmOke_N Link to comment Share on other sites More sharing options...
Dampe Posted March 20, 2009 Share Posted March 20, 2009 (edited) Working well and strong for me. This is awesome. Would be nice to see some control features like play pause stop volume or something. EDIT: Started to write it into a UDF for my own use expandcollapse popup#include-once Local Const $VLCPlayListInsert = 1 Local Const $VLCPlayListReplace = 2 Local Const $VLCPlayListAppend = 4 Local Const $VLCPlayListGo = 8 Local Const $VLCPlayListInsertAndGo = 9 Local Const $VLCPlayListReplaceAndGo = 10 Local Const $VLCPlayListAppendAndGo = 12 Local Const $VLCPlayListCheckInsert = 16 $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $oVLC = ObjCreate("VideoLAN.VLCPlugin.1") _VLC_Startup() $tFile = FileOpenDialog ("Select media", "", "All files (*.*)") If $tFile <> "" Then _VLC_OpenFile($tFile) Else Exit EndIf ;//Demo _VLC_Play() Sleep (5000) _VLC_Pause() Sleep (3000) _VLC_Play() _VLC_SetVolume(5) Sleep (5000) _VLC_SetVolume(100) Sleep (2500) _VLC_SetVolume() Sleep (2500) _VLC_Stop() Func _VLC_Startup($_VLC_AutoLoop=0, $_VLC_AutoPlay=0, $_VLC_Visible=1, $_VLC_Volume=50) With $oVLC .AutoLoop = $_VLC_AutoLoop .AutoPlay = $_VLC_AutoPlay .Visible = $_VLC_Visible .Volume = $_VLC_Volume EndWith EndFunc Func _VLC_OpenFile($_VLC_File) If not FileExists ($_VLC_File) Then SetError(1) Return -1 Else $oVLC.MRL = $_VLC_File Return 1 EndIf EndFunc Func _VLC_Play() $oVLC.Play() EndFunc Func _VLC_Pause() $oVLC.Pause() EndFunc Func _VLC_Stop() $oVLC.Stop() EndFunc Func _VLC_SetVolume($_VLC_SetVolume=50) $oVLC.Volume = $_VLC_SetVolume EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Also, is there anyway to make this start full screen by default? Edited March 20, 2009 by Dampe Link to comment Share on other sites More sharing options...
87yj Posted April 5, 2009 Share Posted April 5, 2009 I think the com support was taken out of VLC 0.9xx can anyone else confirm? This should work with the older 0.8xx versions Link to comment Share on other sites More sharing options...
ptrex Posted April 5, 2009 Author Share Posted April 5, 2009 @87yj I don't think so. Last time used with 0.9.8.1 Regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
jcpetu Posted August 3, 2014 Share Posted August 3, 2014 Hi Ptrex, I know it is quite an old thread but by the way, is it possible to capture a video stream? thanks a lot and regards. Link to comment Share on other sites More sharing options...
georgetaupobungy Posted November 1, 2017 Share Posted November 1, 2017 On 8/3/2014 at 1:09 PM, jcpetu said: Hi Ptrex, I know it is quite an old thread but by the way, is it possible to capture a video stream? thanks a lot and regards. Even older thread now, but I'm extremely interested in capturing video with autoit. I've had some luck with ffmpeg. Jceptu, what did you end up doing? Regards George Link to comment Share on other sites More sharing options...
ptrex Posted November 2, 2017 Author Share Posted November 2, 2017 I have not been using VLC for ages now, so I can't tell if they are still having COM support at the moment ? But as mentioned in the internet in many examples you can easily use the commandline interface ... See here : https://www.computing.net/answers/programming/looking-for-a-vbscript-to-stream-record-using-videolan/30512.html In combination with : Run(@WindowsDir & "\VLC.exe", "", @SW_MAXIMIZE) Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New 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