How to get started with directshow?

2020-06-28 01:25发布

问题:

I'm having a great trouble trying to understand this,

what's the least set up to compile/run directshow apps?

I've already installed visual c++ 2008 express.

A hello world will be nice,

RGS!

回答1:

Try downloading SDK such as Windows SDK "http://www.microsoft.com/downloads/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b&displaylang=en". There are usually a bunch of samples for directshow. But, mainly they either use commandline "nmake" (not make) or "cl" (not cc or gcc) to build. Sometimes they provide *.sln files to be used under VS. Your vcam package is only a dll and you still need to write an application to test this. Based on the samples from there, I believe you can be able to cook up one hello-world app for your vcam ;)



回答2:

Setting up Your Environment

Setting up the environment is a cumbersome process, since DirectShow has now been buried deep in the Windows 7 SDK. If you don't already have the baseclasses built, which you'lll need to do any DirectShow development, you must first compile the DirectShow baseclasses.

You'll find the baseclasses in the Windows SDK. The latest Windows SDK is v7.1.

You can download the Windows SDK from microsoft's website.

If you install the Windows SDK to it's default folder, you'll find the baseclasses here:

C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses

In that folder, you'll find a Visual Studio solution file. Open that solution in Visual Studio and compile it for both Debug and Release modes.

Next, in Visual Studio, go to the following menu option: Tools -> Options, Projects & Solutions -> VC++ Directories Show directories for -> Include files

Add this:

C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses

Show directories for -> Library files

Add these:

C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\Debug
C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\Release

You should now be all set to build DirectShow programs. You may also want to add extra libraries like the DirectX libraries, (which you'll need if you're doing more advanced rendering with VMR9) and the WMFSDK (if you're working with Windows Media Format stuff).

Writing a Hello World program is a little long for pasting into Stack Overflow. I'll have a look at posting one sometime this weekend, but you might like to check out CodeProject in the meantime, which is bound to have oodles of DirectShow examples.

DirectShow has an active community of developers, where you can discuss problems and solutions.

Good luck!



回答3:

To get the vcam example, you basically have to create a fresh new "dll" project in VC 2010, add the old files into it, then setup the .def file to export all the methods you need.

Here's some links for ya:

http://betterlogic.com/roger/?p=3096

To make it easier on ya, I add a "visual studio express 2010 project" to the vcam_vs_2010 folder of

http://github.com/rdp/directshow-demo-audio-input-source

(checkout its README.txt)

GL. -r