mLipok Posted November 5, 2023 Posted November 5, 2023 3 hours ago, Belini said: UDF made by Frank10 with changes made to SaveFile() by mLipok (Recording working) Can you stick with separate UDF files instead merging them ? I mean: WebcamDS_UDF.au3 + DirectShow_Interfaces.au3 + WebcamDS_ExampleUDF.au3 Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
Belini Posted November 6, 2023 Posted November 6, 2023 14 hours ago, mLipok said: How old is your computer ? Which codec you choose ? The computer I tested is about 5 years old. the codec I used was "Xvid MPEG-4" which creates smaller files. 14 hours ago, mLipok said: Can you stick with separate UDF files instead merging them ? I put everything together in a script, just the UDF made by Frank10 and the other one that you changed to make it easier to compare and thus try to remove the errors that occurred in the UDF that you changed. Shark007 1 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
konya Posted December 13, 2023 Posted December 13, 2023 (edited) It is very good UDF,I'm reference it modify to full function program. 5 stars UDF Edited August 14, 2024 by konya Read Public or Pravite key information data tool (Read PEM) GDI+ Image deskew and crop Multicast membership UDF
Parsix Posted June 25 Posted June 25 (edited) Hi How to add ffmpeg to Codecs ? How to use x264vfw for create mp4 file? how to setup audio for codecs ? How to save to x264 mp4 format ? audio not synced in certain of codecs (example : x264vfw - H.264/MPEG-4 AVC codec) Edited June 26 by Parsix
water Posted June 26 Posted June 26 User DCCD has not been active for more than two years. So don't hold your breath while waiting for a reply 😉 Parsix 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
konya Posted Tuesday at 09:52 AM Posted Tuesday at 09:52 AM (edited) On 6/26/2026 at 6:44 AM, Parsix said: Hi How to add ffmpeg to Codecs ? How to use x264vfw for create mp4 file? how to setup audio for codecs ? How to save to x264 mp4 format ? audio not synced in certain of codecs (example : x264vfw - H.264/MPEG-4 AVC codec) Ans : [1]Register COM (1)regsvr32 -s C:\ffdshow.dll or (2)Dllcall ffdshow.dll DllRegisterServer function [2]AddFilter Example like : $Custom_PushSource_Desktop_Filter = ObjCreateInterface($CLSID_PushSource_Desktop_Filter, $IID_IBaseFilter, $tagIBaseFilter) $hr = $oGraph.AddFilter($Custom_PushSource_Desktop_Filter, "Custom_PushSource_Desktop_Filter") [3]Setting and writte file pBuild->SetOutputFileName( $MEDIASUBTYPE_Avi, "C:\Recording.avi", $pMux, $pSink ) [4]Connect & Render Find pin and connect [Capture filter] ----> [Encode filter (H.264/AAC)] ----> [Write filter (Mux/Writer)] [5] Setting Video to GUI $oVideoWindow.put_Owner($hGUI) Edited Tuesday at 09:53 AM by konya Parsix 1 Read Public or Pravite key information data tool (Read PEM) GDI+ Image deskew and crop Multicast membership UDF
Parsix Posted Tuesday at 04:17 PM Posted Tuesday at 04:17 PM 6 hours ago, konya said: Ans : [1]Register COM (1)regsvr32 -s C:\ffdshow.dll or (2)Dllcall ffdshow.dll DllRegisterServer function [2]AddFilter Example like : $Custom_PushSource_Desktop_Filter = ObjCreateInterface($CLSID_PushSource_Desktop_Filter, $IID_IBaseFilter, $tagIBaseFilter) $hr = $oGraph.AddFilter($Custom_PushSource_Desktop_Filter, "Custom_PushSource_Desktop_Filter") [3]Setting and writte file pBuild->SetOutputFileName( $MEDIASUBTYPE_Avi, "C:\Recording.avi", $pMux, $pSink ) [4]Connect & Render Find pin and connect [Capture filter] ----> [Encode filter (H.264/AAC)] ----> [Write filter (Mux/Writer)] [5] Setting Video to GUI $oVideoWindow.put_Owner($hGUI) please put a sample code
konya Posted Wednesday at 01:45 AM Posted Wednesday at 01:45 AM (edited) expandcollapse popupGlobal Enum $PINDIR_INPUT, _ $PINDIR_OUTPUT Global Const $tagREFTIME = 'double' Global Const $IID_IDispatch = "{00020400-0000-0000-C000-000000000046}" Global Const $tagIDispatch = "GetTypeInfoCount hresult(dword*);" & _ "GetTypeInfo hresult(dword;dword;ptr*);" & _ "GetIDsOfNames hresult(clsid;ptr;dword;dword;ptr);" & _ "Invoke hresult(dword;clsid;dword;word;ptr;ptr;ptr;dword*);" Global Const $CLSID_FilterGraph = "{E436EBB3-524F-11CE-9F53-0020AF0BA770}" Global Const $IID_IGraphBuilder = "{56A868A9-0AD4-11CE-B03A-0020AF0BA770}" Global Const $tagIGraphBuilder = "AddFilter hresult(ptr;wstr);" & _ "RemoveFilter hresult(ptr);" & _ "EnumFilters hresult(ptr*);" & _ "FindFilterByName hresult(wstr;ptr*);" & _ "ConnectDirect hresult(ptr;ptr;ptr);" & _ "Reconnect hresult(ptr);" & _ "Disconnect hresult(ptr);" & _ "SetDefaultSyncSource hresult();" & _ "Connect hresult(ptr;ptr);" & _ "Render hresult(ptr);" & _ "RenderFile hresult(wstr;ptr);" & _ "AddSourceFilter hresult(wstr;wstr;ptr*);" & _ "SetLogFile hresult(dword_ptr);" & _ "Abort hresult();" & _ "ShouldOperationContinue hresult();" Global Const $CLSID_CaptureGraphBuilder2 = '{BF87B6E1-8C27-11D0-B3F0-00AA003761C5}' Global Const $IID_ICaptureGraphBuilder2 = '{93e5a4e0-2d50-11d2-abfa-00a0c9c6e38d}' Global Const $tagICaptureGraphBuilder2 = "SetFiltergraph hresult(ptr);" & _ "GetFiltergraph hresult(ptr*);" & _ "SetOutputFileName hresult(clsid;wstr;ptr*;ptr*);" & _ "FindInterface hresult(clsid;clsid;ptr;clsid;ptr*);" & _ "RenderStream hresult(ptr;ptr;ptr;ptr;ptr);" & _ "ControlStream hresult(clsid;clsid;ptr;int64*;int64*;word;word);" & _ "AllocCapFile hresult(wstr;int64);" & _ "CopyCaptureFile hresult(wstr;wstr;int;ptr*);" & _ "FindPin hresult(ptr;int;ptr;ptr;bool;int;ptr*);" Global Const $IID_IVideoWindow = "{56A868B4-0AD4-11CE-B03A-0020AF0BA770}" Global Const $tagIVideoWindow = $tagIDispatch & _ "put_Caption hresult(bstr);" & _ "get_Caption hresult(bstr*);" & _ "put_WindowStyle hresult(long);" & _ "get_WindowStyle hresult(long*);" & _ "put_WindowStyleEx hresult(long);" & _ "put_WindowStyleEx hresult(long*);" & _ "put_AutoShow hresult(long);" & _ "get_AutoShow hresult(long*);" & _ "put_WindowState hresult(long);" & _ "get_WindowState hresult(long*);" & _ "put_BackgroundPalette hresult(long);" & _ "get_BackgroundPalette hresult(long*);" & _ "put_Visible hresult(long);" & _ "get_Visible hresult(long*);" & _ "put_Left hresult(long);" & _ "get_Left hresult(long*);" & _ "put_Width hresult(long);" & _ "get_Width hresult(long*);" & _ "put_Top hresult(long);" & _ "get_Top hresult(long*);" & _ "put_Height hresult(long);" & _ "get_Height hresult(long*);" & _ "put_Owner hresult(long_ptr);" & _ "get_Owner hresult(long_ptr*);" & _ "put_MessageDrain hresult(long_ptr);" & _ "get_MessageDrain hresult(long_ptr*);" & _ "get_BorderColor hresult(long*);" & _ "put_BorderColor hresult(long);" & _ "get_FullScreenMode hresult(long*);" & _ "put_FullScreenMode hresult(long);" & _ "SetWindowForeground hresult(long);" & _ "NotifyOwnerMessage hresult(long_ptr;long;long_ptr;long_ptr);" & _ "SetWindowPosition hresult(long;long;long;long);" & _ "GetWindowPosition hresult(long*;long*;long*;long*);" & _ "GetMinIdealImageSize hresult(long*;long*);" & _ "GetMaxIdealImageSize hresult(long*;long*);" & _ "GetRestorePosition hresult(long*;long*;long*;long*);" & _ "HideCursor hresult(long);" & _ "IsCursorHidden hresult(long*);" Global Const $IID_IBasicVideo = "{56A868B5-0AD4-11CE-B03A-0020AF0BA770}" Global Const $tagIBasicVideo = $tagIDispatch & _ "get_AvgTimePerFrame hresult("&$tagREFTIME&"*);" & _ "get_BitRate hresult(long*);" & _ "get_BitErrorRate hresult(long*);" & _ "get_VideoWidth hresult(long*);" & _ "get_VideoHeight hresult(long*);" & _ "put_SourceLeft hresult(long);" & _ "get_SourceLeft hresult(long*);" & _ "put_SourceWidth hresult(long);" & _ "get_SourceWidth hresult(long*);" & _ "put_SourceTop hresult(long);" & _ "get_SourceTop hresult(long*);" & _ "put_SourceHeight hresult(long);" & _ "get_SourceHeight hresult(long*);" & _ "put_DestinationLeft hresult(long);" & _ "get_DestinationLeft hresult(long*);" & _ "put_DestinationWidth hresult(long);" & _ "get_DestinationWidth hresult(long*);" & _ "put_DestinationTop hresult(long);" & _ "get_DestinationTop hresult(long*);" & _ "put_DestinationHeight hresult(long);" & _ "get_DestinationHeight hresult(long*);" & _ "SetSourcePosition hresult(long;long;long;long);" & _ "GetSourcePosition hresult(long*;long*;long*;long*);" & _ "SetDefaultSourcePosition hresult();" & _ "SetDestinationPosition hresult(long;long;long;long);" & _ "GetDestinationPosition hresult(long*;long*;long*;long*);" & _ "SetDefaultDestinationPosition hresult();" & _ "GetVideoSize hresult(long*;long*);" & _ "GetVideoPaletteEntries hresult(long;long;long*;long*);" & _ "GetCurrentImage hresult(ptr;ptr);" & _ "IsUsingDefaultSource hresult();" & _ "IsUsingDefaultDestination hresult();" Global Const $IID_IBaseFilter = '{56a86895-0ad4-11ce-b03a-0020af0ba770}' Global Const $tagIBaseFilter = "GetClassID hresult(ptr*);" & _ "Stop hresult();" & _ "Pause hresult();" & _ "Run hresult(int64);" & _ "GetState hresult(dword;dword*);" & _ "SetSyncSource hresult(ptr);" & _ "GetSyncSource hresult(ptr*);" & _ "EnumPins hresult(ptr*);" & _ "FindPin hresult(wstr;ptr*);" & _ "QueryFilterInfo hresult(struct*);" & _ "JoinFilterGraph hresult(ptr;wstr);" & _ "QueryVendorInfo hresult(wstr*);" Global Const $IID_IPin = '{56a86891-0ad4-11ce-b03a-0020af0ba770}' Global Const $tagIPin = 'Connect hresult(ptr;ptr);' & _ 'ReceiveConnection hresult(ptr;ptr);' & _ 'Disconnect hresult();' & _ 'ConnectedTo hresult(ptr*);' & _ "ConnectionMediaType hresult(ptr*);" & _ "QueryPinInfo hresult(struct*);" & _ "QueryDirection hresult(int*);" & _ "QueryId hresult(wstr*);" & _ "QueryAccept hresult(ptr);" & _ "EnumMediaTypes hresult(ptr*);" & _ "QueryInternalConnections hresult(ptr*;dword*);" & _ "EndOfStream hresult();" & _ "BeginFlush hresult();" & _ "EndFlush hresult();" & _ "NewSegment hresult(int64;int64;double);" Global Const $IID_IMediaControl = '{56A868B1-0AD4-11CE-B03A-0020AF0BA770}' Global Const $PIN_CATEGORY_CAPTURE = "{fb6c4281-0353-11d1-905f-0000c0cc16ba}" Global Const $CLSID_VideoMixingRenderer9 = "{51b4abf3-748f-4e3b-a276-c828330e926a}" Global Const $CLSID_PushSource_Desktop_Filter = "{4EA6930A-2C8A-4AE6-A561-56E4B5044437}" Global Const $CLSID_Colour = "{1643e180-90f5-11ce-97d5-00aa0055595a}" Global Const $MEDIATYPE_Video = "{73646976-0000-0010-8000-00aa00389b71}" Global $oColor_Space_Converter Global $oVideo_renderer Global $Custom_PushSource_Desktop_Filter Global Const $WS_CHILD = 0x40000000 Global Const $WS_CLIPCHILDREN = 0x02000000 Local $hGUI = GUICreate("Load directshow dll example", 800, 600) GUISetState(@SW_SHOW,$hGUI) Local $hr $oGraph = ObjCreateInterface($CLSID_FilterGraph, $IID_IGraphBuilder, $tagIGraphBuilder) If Not IsObj($oGraph) Then MsgBox(0, "", "IGraphBuilder Fail") $oBuild = ObjCreateInterface($CLSID_CaptureGraphBuilder2, $IID_ICaptureGraphBuilder2, $tagICaptureGraphBuilder2) If Not IsObj($oBuild) Then MsgBox(0, "", "ICaptureGraphBuilder2 Fail") $hr = $oBuild.SetFiltergraph($oGraph) If $hr < 0 Then MsgBox(0, "", "SetFiltergraph Fail") Local $pMediaControl $oGraph.QueryInterface($IID_IMediaControl, $pMediaControl) $oMediaControl = ObjCreateInterface($pMediaControl, $IID_IMediaControl) If Not IsObj($oMediaControl) Then MsgBox(0, "", "IMediaControl Fail") Local $pVideoWindow $oGraph.QueryInterface($IID_IVideoWindow, $pVideoWindow) $oVideoWindow = ObjCreateInterface($pVideoWindow, $IID_IVideoWindow, $tagIVideoWindow) If Not IsObj($oVideoWindow) Then MsgBox(0, "", "IVideoWindow Fail") Local $pBasicVideo $oGraph.QueryInterface($IID_IBasicVideo, $pBasicVideo) $oBasicVideo = ObjCreateInterface($pBasicVideo, $IID_IBasicVideo, $tagIBasicVideo) If Not IsObj($oBasicVideo) Then MsgBox(0, "", "IBasicVideo Fail") If Not IsObj($oColor_Space_Converter) Then $oColor_Space_Converter = ObjCreateInterface($CLSID_Colour, $IID_IBaseFilter, $tagIBaseFilter) $hr = $oGraph.AddFilter($oColor_Space_Converter, "Color_Space_Converter") If $hr < 0 Then MsgBox(0, "", "$oGraph.AddFilter Color Space Converter Fail") EndIf If Not IsObj($oVideo_renderer) Then $Record_renderer_name = "VMR" $oVideo_renderer = ObjCreateInterface($CLSID_VideoMixingRenderer9, $IID_IBaseFilter, $tagIBaseFilter) $hr = $oGraph.AddFilter($oVideo_renderer, $Record_renderer_name) If $hr < 0 Then MsgBox(0, "", "$oGraph.AddFilter VMR Fail") EndIf If Not IsObj($Custom_PushSource_Desktop_Filter) Then $Custom_PushSource_Desktop_Filter = ObjCreateInterface($CLSID_PushSource_Desktop_Filter, $IID_IBaseFilter, $tagIBaseFilter) $hr = $oGraph.AddFilter($Custom_PushSource_Desktop_Filter, "Custom_PushSource_Desktop_Filter") If $hr < 0 Then MsgBox(0, "", "$oGraph.AddFilter Custom_PushSource_Desktop_Filter Fail") EndIf Local $pPin, $pFilter, $oFilter, $vmr_in_pin, $Image_out_pin $hr = $oBuild.FindPin($Custom_PushSource_Desktop_Filter, $PINDIR_OUTPUT, $PIN_CATEGORY_CAPTURE, $MEDIATYPE_Video, False, 0, $pPin) $Image_out_pin = ObjCreateInterface($pPin, $IID_IPin, $tagIPin) $pPin = 0 $hr = $oGraph.FindFilterByName("VMR", $pFilter) $oFilter = ObjCreateInterface($pFilter, $IID_IBaseFilter, $tagIBaseFilter) $hr = $oBuild.FindPin($oFilter, $PINDIR_INPUT, 0, 0, FALSE, 0, $pPin) $vmr_in_pin = ObjCreateInterface($pPin, $IID_IPin, $tagIPin) $hr = $oGraph.Connect($Image_out_pin,$vmr_in_pin) If $hr < 0 Then MsgBox(0, "", "$oGraph.Connect($Image_out_pin,$vmr_in_pin) Fail") $hr = $oVideoWindow.put_Owner($hGUI) Local $aClientSize = WinGetClientSize($hGUI) $xVideo = $aClientSize[0] $yVideo = $aClientSize[1] Local $iX2 = 0, $iY2 = 0 $hr = $oVideoWindow.SetWindowPosition($iX2, $iY2, $xVideo - $iX2, $yVideo - $iY2) $hr = $oVideoWindow.put_WindowStyle(BitOR($WS_CHILD, $WS_CLIPCHILDREN)) $oMediaControl.Run() while 1 $idMsg = GUIGetMsg() Select Case $idMsg = -3 ExitLoop EndSelect WEnd regsvr32 -s PushSource.dll then run the code. PushSource.dll Edited Wednesday at 01:48 AM by konya Parsix, mutleey and argumentum 3 Read Public or Pravite key information data tool (Read PEM) GDI+ Image deskew and crop Multicast membership UDF
Parsix Posted Wednesday at 10:53 AM Posted Wednesday at 10:53 AM 9 hours ago, konya said: expandcollapse popupGlobal Enum $PINDIR_INPUT, _ $PINDIR_OUTPUT Global Const $tagREFTIME = 'double' Global Const $IID_IDispatch = "{00020400-0000-0000-C000-000000000046}" Global Const $tagIDispatch = "GetTypeInfoCount hresult(dword*);" & _ "GetTypeInfo hresult(dword;dword;ptr*);" & _ "GetIDsOfNames hresult(clsid;ptr;dword;dword;ptr);" & _ "Invoke hresult(dword;clsid;dword;word;ptr;ptr;ptr;dword*);" Global Const $CLSID_FilterGraph = "{E436EBB3-524F-11CE-9F53-0020AF0BA770}" Global Const $IID_IGraphBuilder = "{56A868A9-0AD4-11CE-B03A-0020AF0BA770}" Global Const $tagIGraphBuilder = "AddFilter hresult(ptr;wstr);" & _ "RemoveFilter hresult(ptr);" & _ "EnumFilters hresult(ptr*);" & _ "FindFilterByName hresult(wstr;ptr*);" & _ "ConnectDirect hresult(ptr;ptr;ptr);" & _ "Reconnect hresult(ptr);" & _ "Disconnect hresult(ptr);" & _ "SetDefaultSyncSource hresult();" & _ "Connect hresult(ptr;ptr);" & _ "Render hresult(ptr);" & _ "RenderFile hresult(wstr;ptr);" & _ "AddSourceFilter hresult(wstr;wstr;ptr*);" & _ "SetLogFile hresult(dword_ptr);" & _ "Abort hresult();" & _ "ShouldOperationContinue hresult();" Global Const $CLSID_CaptureGraphBuilder2 = '{BF87B6E1-8C27-11D0-B3F0-00AA003761C5}' Global Const $IID_ICaptureGraphBuilder2 = '{93e5a4e0-2d50-11d2-abfa-00a0c9c6e38d}' Global Const $tagICaptureGraphBuilder2 = "SetFiltergraph hresult(ptr);" & _ "GetFiltergraph hresult(ptr*);" & _ "SetOutputFileName hresult(clsid;wstr;ptr*;ptr*);" & _ "FindInterface hresult(clsid;clsid;ptr;clsid;ptr*);" & _ "RenderStream hresult(ptr;ptr;ptr;ptr;ptr);" & _ "ControlStream hresult(clsid;clsid;ptr;int64*;int64*;word;word);" & _ "AllocCapFile hresult(wstr;int64);" & _ "CopyCaptureFile hresult(wstr;wstr;int;ptr*);" & _ "FindPin hresult(ptr;int;ptr;ptr;bool;int;ptr*);" Global Const $IID_IVideoWindow = "{56A868B4-0AD4-11CE-B03A-0020AF0BA770}" Global Const $tagIVideoWindow = $tagIDispatch & _ "put_Caption hresult(bstr);" & _ "get_Caption hresult(bstr*);" & _ "put_WindowStyle hresult(long);" & _ "get_WindowStyle hresult(long*);" & _ "put_WindowStyleEx hresult(long);" & _ "put_WindowStyleEx hresult(long*);" & _ "put_AutoShow hresult(long);" & _ "get_AutoShow hresult(long*);" & _ "put_WindowState hresult(long);" & _ "get_WindowState hresult(long*);" & _ "put_BackgroundPalette hresult(long);" & _ "get_BackgroundPalette hresult(long*);" & _ "put_Visible hresult(long);" & _ "get_Visible hresult(long*);" & _ "put_Left hresult(long);" & _ "get_Left hresult(long*);" & _ "put_Width hresult(long);" & _ "get_Width hresult(long*);" & _ "put_Top hresult(long);" & _ "get_Top hresult(long*);" & _ "put_Height hresult(long);" & _ "get_Height hresult(long*);" & _ "put_Owner hresult(long_ptr);" & _ "get_Owner hresult(long_ptr*);" & _ "put_MessageDrain hresult(long_ptr);" & _ "get_MessageDrain hresult(long_ptr*);" & _ "get_BorderColor hresult(long*);" & _ "put_BorderColor hresult(long);" & _ "get_FullScreenMode hresult(long*);" & _ "put_FullScreenMode hresult(long);" & _ "SetWindowForeground hresult(long);" & _ "NotifyOwnerMessage hresult(long_ptr;long;long_ptr;long_ptr);" & _ "SetWindowPosition hresult(long;long;long;long);" & _ "GetWindowPosition hresult(long*;long*;long*;long*);" & _ "GetMinIdealImageSize hresult(long*;long*);" & _ "GetMaxIdealImageSize hresult(long*;long*);" & _ "GetRestorePosition hresult(long*;long*;long*;long*);" & _ "HideCursor hresult(long);" & _ "IsCursorHidden hresult(long*);" Global Const $IID_IBasicVideo = "{56A868B5-0AD4-11CE-B03A-0020AF0BA770}" Global Const $tagIBasicVideo = $tagIDispatch & _ "get_AvgTimePerFrame hresult("&$tagREFTIME&"*);" & _ "get_BitRate hresult(long*);" & _ "get_BitErrorRate hresult(long*);" & _ "get_VideoWidth hresult(long*);" & _ "get_VideoHeight hresult(long*);" & _ "put_SourceLeft hresult(long);" & _ "get_SourceLeft hresult(long*);" & _ "put_SourceWidth hresult(long);" & _ "get_SourceWidth hresult(long*);" & _ "put_SourceTop hresult(long);" & _ "get_SourceTop hresult(long*);" & _ "put_SourceHeight hresult(long);" & _ "get_SourceHeight hresult(long*);" & _ "put_DestinationLeft hresult(long);" & _ "get_DestinationLeft hresult(long*);" & _ "put_DestinationWidth hresult(long);" & _ "get_DestinationWidth hresult(long*);" & _ "put_DestinationTop hresult(long);" & _ "get_DestinationTop hresult(long*);" & _ "put_DestinationHeight hresult(long);" & _ "get_DestinationHeight hresult(long*);" & _ "SetSourcePosition hresult(long;long;long;long);" & _ "GetSourcePosition hresult(long*;long*;long*;long*);" & _ "SetDefaultSourcePosition hresult();" & _ "SetDestinationPosition hresult(long;long;long;long);" & _ "GetDestinationPosition hresult(long*;long*;long*;long*);" & _ "SetDefaultDestinationPosition hresult();" & _ "GetVideoSize hresult(long*;long*);" & _ "GetVideoPaletteEntries hresult(long;long;long*;long*);" & _ "GetCurrentImage hresult(ptr;ptr);" & _ "IsUsingDefaultSource hresult();" & _ "IsUsingDefaultDestination hresult();" Global Const $IID_IBaseFilter = '{56a86895-0ad4-11ce-b03a-0020af0ba770}' Global Const $tagIBaseFilter = "GetClassID hresult(ptr*);" & _ "Stop hresult();" & _ "Pause hresult();" & _ "Run hresult(int64);" & _ "GetState hresult(dword;dword*);" & _ "SetSyncSource hresult(ptr);" & _ "GetSyncSource hresult(ptr*);" & _ "EnumPins hresult(ptr*);" & _ "FindPin hresult(wstr;ptr*);" & _ "QueryFilterInfo hresult(struct*);" & _ "JoinFilterGraph hresult(ptr;wstr);" & _ "QueryVendorInfo hresult(wstr*);" Global Const $IID_IPin = '{56a86891-0ad4-11ce-b03a-0020af0ba770}' Global Const $tagIPin = 'Connect hresult(ptr;ptr);' & _ 'ReceiveConnection hresult(ptr;ptr);' & _ 'Disconnect hresult();' & _ 'ConnectedTo hresult(ptr*);' & _ "ConnectionMediaType hresult(ptr*);" & _ "QueryPinInfo hresult(struct*);" & _ "QueryDirection hresult(int*);" & _ "QueryId hresult(wstr*);" & _ "QueryAccept hresult(ptr);" & _ "EnumMediaTypes hresult(ptr*);" & _ "QueryInternalConnections hresult(ptr*;dword*);" & _ "EndOfStream hresult();" & _ "BeginFlush hresult();" & _ "EndFlush hresult();" & _ "NewSegment hresult(int64;int64;double);" Global Const $IID_IMediaControl = '{56A868B1-0AD4-11CE-B03A-0020AF0BA770}' Global Const $PIN_CATEGORY_CAPTURE = "{fb6c4281-0353-11d1-905f-0000c0cc16ba}" Global Const $CLSID_VideoMixingRenderer9 = "{51b4abf3-748f-4e3b-a276-c828330e926a}" Global Const $CLSID_PushSource_Desktop_Filter = "{4EA6930A-2C8A-4AE6-A561-56E4B5044437}" Global Const $CLSID_Colour = "{1643e180-90f5-11ce-97d5-00aa0055595a}" Global Const $MEDIATYPE_Video = "{73646976-0000-0010-8000-00aa00389b71}" Global $oColor_Space_Converter Global $oVideo_renderer Global $Custom_PushSource_Desktop_Filter Global Const $WS_CHILD = 0x40000000 Global Const $WS_CLIPCHILDREN = 0x02000000 Local $hGUI = GUICreate("Load directshow dll example", 800, 600) GUISetState(@SW_SHOW,$hGUI) Local $hr $oGraph = ObjCreateInterface($CLSID_FilterGraph, $IID_IGraphBuilder, $tagIGraphBuilder) If Not IsObj($oGraph) Then MsgBox(0, "", "IGraphBuilder Fail") $oBuild = ObjCreateInterface($CLSID_CaptureGraphBuilder2, $IID_ICaptureGraphBuilder2, $tagICaptureGraphBuilder2) If Not IsObj($oBuild) Then MsgBox(0, "", "ICaptureGraphBuilder2 Fail") $hr = $oBuild.SetFiltergraph($oGraph) If $hr < 0 Then MsgBox(0, "", "SetFiltergraph Fail") Local $pMediaControl $oGraph.QueryInterface($IID_IMediaControl, $pMediaControl) $oMediaControl = ObjCreateInterface($pMediaControl, $IID_IMediaControl) If Not IsObj($oMediaControl) Then MsgBox(0, "", "IMediaControl Fail") Local $pVideoWindow $oGraph.QueryInterface($IID_IVideoWindow, $pVideoWindow) $oVideoWindow = ObjCreateInterface($pVideoWindow, $IID_IVideoWindow, $tagIVideoWindow) If Not IsObj($oVideoWindow) Then MsgBox(0, "", "IVideoWindow Fail") Local $pBasicVideo $oGraph.QueryInterface($IID_IBasicVideo, $pBasicVideo) $oBasicVideo = ObjCreateInterface($pBasicVideo, $IID_IBasicVideo, $tagIBasicVideo) If Not IsObj($oBasicVideo) Then MsgBox(0, "", "IBasicVideo Fail") If Not IsObj($oColor_Space_Converter) Then $oColor_Space_Converter = ObjCreateInterface($CLSID_Colour, $IID_IBaseFilter, $tagIBaseFilter) $hr = $oGraph.AddFilter($oColor_Space_Converter, "Color_Space_Converter") If $hr < 0 Then MsgBox(0, "", "$oGraph.AddFilter Color Space Converter Fail") EndIf If Not IsObj($oVideo_renderer) Then $Record_renderer_name = "VMR" $oVideo_renderer = ObjCreateInterface($CLSID_VideoMixingRenderer9, $IID_IBaseFilter, $tagIBaseFilter) $hr = $oGraph.AddFilter($oVideo_renderer, $Record_renderer_name) If $hr < 0 Then MsgBox(0, "", "$oGraph.AddFilter VMR Fail") EndIf If Not IsObj($Custom_PushSource_Desktop_Filter) Then $Custom_PushSource_Desktop_Filter = ObjCreateInterface($CLSID_PushSource_Desktop_Filter, $IID_IBaseFilter, $tagIBaseFilter) $hr = $oGraph.AddFilter($Custom_PushSource_Desktop_Filter, "Custom_PushSource_Desktop_Filter") If $hr < 0 Then MsgBox(0, "", "$oGraph.AddFilter Custom_PushSource_Desktop_Filter Fail") EndIf Local $pPin, $pFilter, $oFilter, $vmr_in_pin, $Image_out_pin $hr = $oBuild.FindPin($Custom_PushSource_Desktop_Filter, $PINDIR_OUTPUT, $PIN_CATEGORY_CAPTURE, $MEDIATYPE_Video, False, 0, $pPin) $Image_out_pin = ObjCreateInterface($pPin, $IID_IPin, $tagIPin) $pPin = 0 $hr = $oGraph.FindFilterByName("VMR", $pFilter) $oFilter = ObjCreateInterface($pFilter, $IID_IBaseFilter, $tagIBaseFilter) $hr = $oBuild.FindPin($oFilter, $PINDIR_INPUT, 0, 0, FALSE, 0, $pPin) $vmr_in_pin = ObjCreateInterface($pPin, $IID_IPin, $tagIPin) $hr = $oGraph.Connect($Image_out_pin,$vmr_in_pin) If $hr < 0 Then MsgBox(0, "", "$oGraph.Connect($Image_out_pin,$vmr_in_pin) Fail") $hr = $oVideoWindow.put_Owner($hGUI) Local $aClientSize = WinGetClientSize($hGUI) $xVideo = $aClientSize[0] $yVideo = $aClientSize[1] Local $iX2 = 0, $iY2 = 0 $hr = $oVideoWindow.SetWindowPosition($iX2, $iY2, $xVideo - $iX2, $yVideo - $iY2) $hr = $oVideoWindow.put_WindowStyle(BitOR($WS_CHILD, $WS_CLIPCHILDREN)) $oMediaControl.Run() while 1 $idMsg = GUIGetMsg() Select Case $idMsg = -3 ExitLoop EndSelect WEnd regsvr32 -s PushSource.dll then run the code. PushSource.dll 54.5 kB · 1 download nice, Do you have an example of connecting to a webcam that has the ability to select the image and audio source?
konya Posted 23 hours ago Posted 23 hours ago (edited) You can install k-lite codec and load directshow LAVSplitter.ax connect rtsp。 That's all I can do for you. (Test Lav filter success) Edited 19 hours ago by konya Parsix 1 Read Public or Pravite key information data tool (Read PEM) GDI+ Image deskew and crop Multicast membership UDF
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