![]() ![]() ![]() ![]() Private IPin GetPin(PinDirection pinDir, string name, IBaseFilter filter)īool found = (pinfo.dir = pinDir & pinfo.According to, the Elgato Cam Link 4K is a great choice if you’re looking for a HDMI capture device that works under Linux. IntPtr fetched = Marshal.AllocCoTaskMem(4) Private IPin GetPin(PinDirection pinDir, IBaseFilter filter) Vw.put_WindowStyle(WindowStyle.Child | WindowStyle.ClipSiblings | WindowStyle.ClipChildren) Set the video preview to be the videoFeed panel InPin = GetPin(PinDirection.Input, videoRendererFilter) ĬaptureGraph.RenderStream(PinCategory.Preview, MediaType.Video, videoRendererFilter, null, null) OutPin = GetPin(PinDirection.Output, "Preview", smartTeeFilter) Graph.AddFilter(videoRendererFilter, "Video Renderer") VideoRendererFilter = (IBaseFilter)new VideoRenderer() Create video renderer filter, add it to graph, connect smartTee Preview pin to video renderer's input pin IPin inPin = GetPin(PinDirection.Input, smartTeeFilter) IPin outPin = GetPin(PinDirection.Output, "Video", elgatoFilter) Graph.AddFilter(smartTeeFilter, "Smart Tee") SmartTeeFilter = (IBaseFilter)new SmartTee() Create smart tee filter, add to graph, connect Elgato's video out to smart tee in Graph.AddFilter(elgatoFilter, "Elgato Video Capture Filter") Type comType = Type.GetTypeFromCLSID(elgatoGuid) ĮlgatoFilter = (IBaseFilter)Activator.CreateInstance(comType) Graph = (IFilterGraph2)new FilterGraph() ĬaptureGraph = (ICaptureGraphBuilder2)new CaptureGraphBuilder2() Initialize filter graph and capture graph Set the video size to use for capture and recording using DirectShowLib ĭsROTEntry rot //Used for remotely connecting to graph Here is an example of creating a simple graph and previewing the Elgato's video stream. I know this is an old question, but in case anyone else stumbles across it it is quite easy to use the video stream from an Elgato capture card in C# with DirectShow. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |