directshow

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) {

How can I omit capturing of a button/region using DirectShow APIs?

删除回忆录丶 提交于 2019-12-12 02:23:00
问题 I am using "Push Source Desktop" filter for capturing screen in my application. I hide my application while recording is going on. Only a button for stopping the recording is visible on screen. The button also gets recorded by the filter. During playback of the saved recording the button is visible along with rest of the screen region. Is there any way I can prevent the button from getting recorded ? My aim is to record the screen without the button. I cannot hide the button as it required

DirectShow - How to rotate web cam preview video?

二次信任 提交于 2019-12-12 01:42:44
问题 I am using DirectShow ICaptureGraphBuilder2, IVideoWIndow & IGraphBuilder to preview web cam video into specified window. I am successful to preview web cam view. Now, I want to rotate this web cam preview by 90 degree. Explored web and people suggest to use transform filter but I didn't exactly find how to do it. Can somebody help ? 回答1: MSDN describes it in Writing Transform Filters, and you will find some related discussions: I want to Rotate a video with some angle Need help on video in

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

Loopback is saved in buffer, how to write to disk as wav?

独自空忆成欢 提交于 2019-12-12 01:36:31
问题 In the code below, you can copy paste it to an empty proejct, add main.cpp and it is saving it to buffer, however I don't know how to write that buffer to file. You can see in SetFormat I set it up, and then in CopyData I am writing to the buffer. Complete C++ beginner here, I was able to mash this up. How can I write the buffer to file? #include <mmdeviceapi.h> #include <audioclient.h> #include "debug.h" #include <comdef.h> #define UNICODE //--------------------------------------------------

Not releasing filter com object causing a crash

亡梦爱人 提交于 2019-12-12 01:22:19
问题 I am using Viveks capture filter with vlc (http://tmhare.mvps.org/downloads/vcam.zip) to emulate a capture source. When the filter is open and I close vlc I get a crash. The stack trace indicates that 2 COM objects still exist (Im guessing the filter and pin) which should be released before a CoUninitialize call. My problem is I am not sure where to release the filter and pin COM objects, I have a destructor for the fitler and pin but they are never called when vlc closes. Someone who had a

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 can I mix Image with a Video stream from USB capture device using DirectShowLib in C#

假装没事ソ 提交于 2019-12-12 00:05:42
问题 I'm able to show a video stream in a window. I'm using DirectShow VideoMixingRenderer9 in C#. I have created an Image with sometext in it. Now, how can I mix this image with the video stream so that both video stream and text is shown in the capture window. I tried with ISampleGrabber filter but it doesn't work with all video device and capture screan only shows the text with black background but no video stream. So I don't want to use ISampleGrabber filter. 回答1: IVMRMixerBitmap9 interface

How to capture 8MP still image from a Microsoft LifeCam programatically?

跟風遠走 提交于 2019-12-11 23:09:43
问题 I have a Microsoft LifeCam that is capable of capturing 8MP (3840 x 2160) still jpg images. Using the software that comes with the LifeCam when you switch to this mode then video capture is disabled. It is intended for still photos only. Video capture only goes up to 1280 x 720. I can't see how to get access to the functionality using any method other than the supplied software. When inspecting the capture device in GraphEdit there is only 1 pin (called "capture") and it only supplies video.