directshow.net

Capture still image from webcam (DirectSHowLib, VB.NET)

别来无恙 提交于 2019-12-12 04:21:43
问题 I'm ashamed, but I'll ask anyway: which is the most straightforward way to take a picture from a webcam with its default size and color-depth? I started playing with DirectShowLib but I'm clueless... Can anyone guive me a guidance? Imports DirectShowLib Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click PictureBox1.Image = Nothing Dim Cam As DsDevice = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice).FirstOrDefault If Cam IsNot

DirectShow VB.net can't change recording format

做~自己de王妃 提交于 2019-12-12 03:14:42
问题 I'm using direct show to try and capture a webcam stream in to my vb.net program. Heres the subroutine running which works: Private Sub CaptureVideo() Dim hr As Integer = 0 Dim sourceFilter As IBaseFilter = Nothing Try GetInterfaces() hr = Me.CaptureGraphBuilder.SetFiltergraph(Me.GraphBuilder) Debug.WriteLine("Attach the filter graph to the capture graph : " & DsError.GetErrorText(hr)) DsError.ThrowExceptionForHR(hr) sourceFilter = FindCaptureDevice() hr = Me.GraphBuilder.AddFilter

Stopping IMediaControl never ends

妖精的绣舞 提交于 2019-12-12 02:36:09
问题 I'm using DirectShowLib-2005 for my C#/WPF project. When camera starts, I run media control: m_FilterGraph = new FilterGraph() as IFilterGraph2; /* Initializations */ IMediaControl mediaCtrl = m_FilterGraph as IMediaControl; hr = mediaCtrl.Run(); DsError.ThrowExceptionForHR(hr); Application Runs, camera works good. But sometimes (not always) when I quit the application freeze. I paused the debugger and I saw that the application is stop on the following line: if (m_FilterGraph != null) {

Desktop screen recording using Directshow - PushSourceDesktop

自作多情 提交于 2019-12-12 01:39:55
问题 I am working on DirectShow.NET to avail webcam and desktop screen recording features. I am successful with webcam recording. Now, moving towards desktop screen recording I have done this: Downloaded Windows SDK, compiled push source project and pushsource.dll is generated. Registered pushsource.dll using regsvr32 Successfully able build the graph in graphedit using PushSource Desktop Filter and genrated AVI/asf file. After all this now I want to do this using c# code, while trying to start

Directshow - Stop and close a file (but reuse graph and some filters)

人走茶凉 提交于 2019-12-12 01:14:37
问题 I am building a multistream video player. I am currently having issues trying to close a file. Effectively I may have 1 to 4 video files playing at any one time. When I am playing 4 files, then the next sequence only has one, I can't seem to repaint the video panel correctly after removing the source file filter. I must say that I am building and managing the graph manually (to get some extra speed), including connecting all filters/renderers etc. I have looked into GMFBridge, but ultimately

IBasicVideo CetCurrentImage catastrophic failure(DirectShow.NET)

血红的双手。 提交于 2019-12-12 00:12:51
问题 I'm trying to grab image from webcam using DirectShow.NET and IBasicVideo CetCurrentImage. But I only get catastrophic failure on second call GetCurrentImage. What I'm doing particularly: IBasicVideo bv = (IBasicVideo)graph; IntPtr bvp = new IntPtr(); int size = 0; int hr = bv.GetCurrentImage(ref size, IntPtr.Zero); DsError.ThrowExceptionForHR(hr); bvp = Marshal.AllocCoTaskMem(size); hr = bv.GetCurrentImage(ref size, bvp); DsError.ThrowExceptionForHR(hr); Bitmap image = new Bitmap(480, 320,

How to Show Preview in PictureBox?

拟墨画扇 提交于 2019-12-11 19:06:33
问题 my is too record video from webcam using DirectshowLib and c# but during video recoding video preview is also be shown so for this i have done following steps 1.i got the available video device init. IFilterGrapth2 object by using Graph = (IFilterGraph2)new FilterGraph(); init. ICaptureGraphBuilder2 object by using captureGraph = (ICaptureGraphBuilder2)new CaptureGraphBuilder2(); 4.filter grapth is set to ICaptureGraphBuilder2 object captureGraph.SetFiltergraph(Graph); and then added

VB.Net Directshow Webcam Snapshot

帅比萌擦擦* 提交于 2019-12-11 18:13:11
问题 I am new to stackoverflow but I registered because I think here is the right place to get professional help for programming :) My goal is to create a webcam snapshot tool which directly saves the snapshot to a file. I don't need any preview in a picturebox or something like that. I am thinking about a application like this: A simple Interface with a Combobox for the connected webcam devices and one button which will take a snapshot and saves it to a file. I like to use DirectShow for this

Programmatically add AVI file header to video stream

旧巷老猫 提交于 2019-12-11 15:04:22
问题 I have a capturing device (analogue to digital converter: AverMedia USB Capture Card). When I want to record video using DirectShowLib in C#, I only receive frames. I am able to record frames and play the file using RawVideo Player. How can I create a standard video file header like AVI? Second problem occurs when I want to compress the data. When I use compression, I can't read it at all. Here is my working GraphEdit schema: How can I create standard AVI or MPEG file with header and etc? 回答1

text overlay issue?

走远了吗. 提交于 2019-12-11 14:07:58
问题 by using directshow.net i can able to record the video and with recording i am doing text overlay for this i configured sample grabber and in buffercb method i am working on frames here is the code.. int ISampleGrabberCB.BufferCB(double SampleTime, IntPtr pBuffer, int BufferLen) { Graphics g; String s; float sLeft; float sTop; SizeF d; g = Graphics.FromImage(bitmapOverlay); g.Clear(System.Drawing.Color.Transparent); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; //