directshow

Simplest way to play mp3 from Visual C++

牧云@^-^@ 提交于 2019-11-30 09:41:38
A few years back, I wrote some util library around DShow/DSound to let me play MP3s in a Windows C++ application. Is that still the normal way to do it in a C++/MFC app, or is that an area of DirectX that has been subsumed into the general Windows APIs? The motivation is simply we use the standard Windows PlaySound method for WAVs, and would like to be able to play MP3s using a similarly simple API, either provided by Windows or something we write to wrap more complex functionality. EDIT: this is for a large, commercial, closed-source project. And we only want to play things simply, paying a

Preview a camera in DirectShow and capture a still image - in VB.net

我是研究僧i 提交于 2019-11-29 23:24:20
问题 I am trying to write a program in Visual Studio 2008 that will access a webcam, show a preview on the screen and then save a still snapshot (.jpg) when the button is pushed. Later I am going to integrate it with a database, but I shouldn't have a problem with that part. After doing some research, it looks like DirectShow is the best bet, because WIA didn't work on the camera I had (and I'm not sure it will continue to work into the future). Preferably, I need my solution to work from Windows

Directshow Preview Only and Capture & Preview with a single Graph

三世轮回 提交于 2019-11-29 17:19:38
I have a Directshow application that needs to preview a webcam video, and when user clicks 'Record' it needs to start capturing the video to a file. To that end I created a single Capture Graph, with PREVIEW pin connected to a RENDER filter and CAPTURE pin connected to a AVI_MUX filter that saves to a file. It looks something like this: /[PREVIEW PIN]-->[VIDEO_RENDERER]--->[SCREEN] [VIDEO CAPTURE FILTER] / \ \[CAPTURE PIN]--->[AVI_MUX]--->[FILE WRITER] When I call Run() on the graph the video shows on screen and gets saved to the file correctly. My question is, how can I only run the PREVIEW

How to access an audio stream using DirectShow.NET C#

末鹿安然 提交于 2019-11-29 15:19:48
问题 What I would like to do is to pass an arbitrary audio file to a DirectShow filtergraph and receive a (PCM audio) stream object in the end using .NET 3.5 C# and DirectShow.NET. I would like to reach the point that I can just say: Stream OpenFile(string filename) {...} and stream.Read(...) I have been reading up on DirectShow for a couple of days and think I have started to grasp the idea of filters and filtergraphs. I found examples (to file / to device) how to play audio or write it to a file

take picture from webcam c#

狂风中的少年 提交于 2019-11-29 15:16:57
I'm streaming video to my Window Form with DirectShowLib. I also want to save image when i press button "Save" for example. How to get picture from webcam with DirectShowLib methods or with WIN32 API methods? DirectShow.NET Samples are there: http://sourceforge.net/projects/directshownet/files/DirectShowSamples/2010-February/ The following sample demoes the requested function: Samples\VMR9\vMR9Snapper ------------------------ This sample shows how to capture bitmaps from VMR9. Having it working with other renderer might require small code modifications. The question also discussed a multitude

Simplest way to play mp3 from Visual C++

五迷三道 提交于 2019-11-29 15:11:41
问题 A few years back, I wrote some util library around DShow/DSound to let me play MP3s in a Windows C++ application. Is that still the normal way to do it in a C++/MFC app, or is that an area of DirectX that has been subsumed into the general Windows APIs? The motivation is simply we use the standard Windows PlaySound method for WAVs, and would like to be able to play MP3s using a similarly simple API, either provided by Windows or something we write to wrap more complex functionality. EDIT:

Reading a video with openCV

ぃ、小莉子 提交于 2019-11-29 13:41:15
I have a video engine2.avi that I want to read and show with openCV. Here's my code: #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> using namespace cv; int main(int argc, char** argv) { string filename = "D:\\BMDvideos\\engine2.avi"; VideoCapture capture(filename); Mat frame; if( !capture.isOpened() ) throw "Error when reading steam_avi"; namedWindow("w", 1); for( ; ; ) { capture >> frame; //if(!frame) // break; imshow("w", frame); waitKey(20); // waits to display frame } waitKey(0); } This code doesn't work if my file has the codec YUV 4:2:2 (UYVY)

Efficiently grabbing pixels from video

会有一股神秘感。 提交于 2019-11-29 08:49:58
I am looking for an effective way to grab image data off video files. I am currently testing FilgraphManagerClass.GetCurrentImage() from the Interop.QuartzTypeLib library. This does what I need but is painfully slow. I need to process all frames of each video. What better options do I have? Requirements Must be frame accurate. <-- Very important! Gives me access to the decoded pixel buffer (array of int or byte[] ), ideally RGB24 or RGB32. The buffer can be grabbed in realtime or faster. I do not need to display the video, I only need to analyze the pixels. Handle mp4 files (h264/aac). I can

Where are the DirectShow samples in the Windows 8 SDK?

半世苍凉 提交于 2019-11-29 04:51:39
DirectShow samples lived under (SDK samples root)\DirectShow\ in the Windows 7.1 SDK, but the Windows 8 SDK does not have the files neither in C:\Program Files (x86)\Windows Kits\8.0 nor C:\Program Files (x86)\Microsoft SDKs\Windows. The samples are also not for download at http://code.msdn.microsoft.com/windowsapps I believe DirectShow is to be phased out and replaced by Microsoft Media Foundation (MF). I think that's been the intention since Windows Vista, although at that time MF was not capable enough to replace DirectShow. Microsoft representatives have stated that DirectShow will not be

Best DirectShow way to capture image from web cam preview ? SampleGrabber is deprecated

橙三吉。 提交于 2019-11-28 19:58:14
I have developed DirectShow C++ app which successfully previews web cam view into provided window. Now I want to capture image from this live web cam preview. I have used graph manager, ICaptureGraphBuilder2, IMoniker etc. for that. I have searched and found following options: WIA & Sample Grabber. Many recommends using SampleGrabber but as per MS's msdn document SampleGrabber is deprecated and one should not use. And I don't want to use WIA API. So which is the best DirectShow way to capture image from live web cam preview? Here is a quote from DxSnap sample from DirectShow.NET library : Use