directshow.net

Get bitmap info from MPEG-2 Program / Transport Stream?

守給你的承諾、 提交于 2019-12-01 14:18:26
In order to render a DirectShow graph in my WPF application, I use a sample grabber to write a bitmap to memory, and read it elsewhere in code. This may seem as a wierd solution, but seems to be the only way to get a WPF brush out of it. The following code gives me the information I need about the bitmap: AMMediaType mt = grabber.GetConnectedMediaType(); VideoInfoHeader header = (VideoInfoHeader)Marshal.PtrToStructure(mt.formatPtr, typeof VideoInfoHeader); header.BmiHeader // ... Now, header.BmiHeader is of type BitmapInfoHeader and provides information such as the width and height of the

Getting MP4 File Duration with DirectShow

自作多情 提交于 2019-12-01 14:15:07
I need to get the duration of an mp4 file, preferably as a double in seconds. I was using DirectShow (see code below), but it keeps throwing a particularly unhelpful error. I'm wondering if someone has an easy solution to this. (Seriously, who knew that getting that information would be so difficult) public static void getDuration(string moviePath) { FilgraphManager m_objFilterGraph = null; m_objFilterGraph = new FilgraphManager(); m_objFilterGraph.RenderFile(moviePath); IMediaPosition m_objMediaPosition = null; m_objMediaPosition = m_objFilterGraph as IMediaPosition; Console.WriteLine(m

Simulate a DirectShow Webcam

那年仲夏 提交于 2019-12-01 13:06:21
I am a developer in DotNet. I want to give skype a possibility to add a webcam simulator and send my bitmap frames to the DirectShow simulator. In this case I can draw my images in my application and on skype I can share this images to my friend. I was on: http://msdn.microsoft.com/en-us/library/dd407344%28VS.85%29.aspx but it's no Dotnet and I am not sure what example I should believe in. I also saw: http://directshownet.sourceforge.net/ But as far as I undestand, here I cannot do with this framework what I need, or can I? My question is: What is basically needed to create such an DirectShow

Rendering from memory using DirectShow

不想你离开。 提交于 2019-12-01 12:47:06
I'm very new to DirectShow and I'm looking for a way to render a video which is already loaded into the memory using DirectShow.NET. How can I do that? I'd be thankful even if you give me a highlight of the path. Roman R. There is no standard component to play from memory data, however Async Filter Sample from Windows SDK implements exactly this. The application reads the file into memory at the specified rate and plays the file. Note that the filter requires, however, expects some C++ development from you. See also: On Async Filter Sample Play video file from a memory stream How do you get

Getting MP4 File Duration with DirectShow

左心房为你撑大大i 提交于 2019-12-01 12:34:56
问题 I need to get the duration of an mp4 file, preferably as a double in seconds. I was using DirectShow (see code below), but it keeps throwing a particularly unhelpful error. I'm wondering if someone has an easy solution to this. (Seriously, who knew that getting that information would be so difficult) public static void getDuration(string moviePath) { FilgraphManager m_objFilterGraph = null; m_objFilterGraph = new FilgraphManager(); m_objFilterGraph.RenderFile(moviePath); IMediaPosition m

Writing a Direct Show Source Filter

冷暖自知 提交于 2019-12-01 11:10:46
I should have to write a Direct Show Filter which takes input(video,audio) from live source. And it should give the data(video,audio : which are encoded) to a decoder Filter MyCustomDirectShowSourceFilter ---> Decoder Any real working examples which i can build my own source filter and any suggestion for implementation? Best Wishes Update: Basically i want a source filter which takes streams from network and let to handle the parsing and decoding of video stream by another filter. So when i modify Microsoft sample Push Source Filter and connect to a decoder it does not call FilllBuffer method.

Simulate a DirectShow Webcam

回眸只為那壹抹淺笑 提交于 2019-12-01 11:04:52
问题 I am a developer in DotNet. I want to give skype a possibility to add a webcam simulator and send my bitmap frames to the DirectShow simulator. In this case I can draw my images in my application and on skype I can share this images to my friend. I was on: http://msdn.microsoft.com/en-us/library/dd407344%28VS.85%29.aspx but it's no Dotnet and I am not sure what example I should believe in. I also saw: http://directshownet.sourceforge.net/ But as far as I undestand, here I cannot do with this

Writing a Direct Show Source Filter

天涯浪子 提交于 2019-12-01 09:49:11
问题 I should have to write a Direct Show Filter which takes input(video,audio) from live source. And it should give the data(video,audio : which are encoded) to a decoder Filter MyCustomDirectShowSourceFilter ---> Decoder Any real working examples which i can build my own source filter and any suggestion for implementation? Best Wishes Update: Basically i want a source filter which takes streams from network and let to handle the parsing and decoding of video stream by another filter. So when i

使用DirectShow.NET获取摄像头视频流

我是研究僧i 提交于 2019-12-01 08:03:50
开源社区提供了DirectShow的.NET版本,为C#开发者提供了便利。这里分享下如何用DirectShow.NET API来启动摄像头,以及获取视频流数据。 参考原文: Read Barcode from Webcam Viewer with DirectShow.NET 作者: Xiao Ling 翻译:yushulx 学习资源 DirectShow.NET library DirectShow.NET Documentation DirectShow.NET samples 示例:获取视频流数据识别barcode 获取连接设备: DsDevice[] devices = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); 获取DirectShow接口: int hr = 0; this.graphBuilder = (IFilterGraph2)new FilterGraph(); this.captureGraphBuilder = (ICaptureGraphBuilder2)new CaptureGraphBuilder2(); this.mediaControl = (IMediaControl)this.graphBuilder; this.videoWindow = (IVideoWindow

Am I using the GMFBridge.DLL to preview/capture a stream correctly?

孤人 提交于 2019-11-30 18:12:53
问题 I am trying to use the GMFBuilder so that i can preview a stream from a webcam and save it periodically without restarting the whole graph. However Im not sure if this is correct or not, I was trying to follow examples but the codes been updated and things have changed. I try and create: WEbcam -> Smart Tee (preview) -> AVI Decompressor -> Video Renderer Smart Tee (Capture) -> BridgeSinkFilter and also: BridgeSourceFilter -> ffdshow video encoder -> haali mastroska muxer (just cause its easy