Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / General Programming / DirectShow GraphEdit Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

February 02, 2005, 11:01 AM

Hello all,

I am a TOTAL newbie to DirectX/Show etc. I want to use it to stream a webcam so i can view it on a different machine.

I tried a very simple graph. i read somewhere that all you need to do to be able to view your webcam is to insert a filter .. (the webcam one).. in my case, go to Graph->InsertFilters->Video Capture Sources->Logitech QuickCam Web. Then you right click on the Capture output pin and say "Render Pin". I did this and i am able to view something. but what i am able to view is terrible! There are "fuzzy lines" across the view window and you can't make anything out! If i wave my hand in front of the webcam, you can see something is moving, but you can't really tell what it is.

I was hoping someone could suggest what i could do to fix this problem. Because i also read somewhere that if my graph doesn't work, tehn there is no point even attempting to write code because that will not work either.

THe precise instructions i read to do what i just described:

"To render live video:
! From filter list, under “Video Capture Sources”, insert filter
for camera
! Right-click on capture pin and select “Render pin”
! Press “Play”"

Available at (on slide 10).

I'm not sure if i need any other filters. I know very little about multimedia stuff.. and there are just so many filters i don't even know where to start trying to fix this!

Would really appreciate any input you guys could give me on this!
Thanks a lot!


February 02, 2005, 11:28 AM

You can Try something simple like playing an Avi file first

Yo go to File Open in the GraphEdit and it will render the AVI

It's not ''File Open'' but something like Render File

If it works maybe it's a problem with the capture file

Here is what GraphEdit do:

He put the File Source Filter and then try to match a Decompressor Filter
The File Source Filter Connect his pin out and the pin IN of the decompressor

Then he will try to find a Match in the Format sent and received

Each filter have a ''Best Format for me List''
The First Filter (Source Reader) Knows he do well
If not he can also do:
Or he could try to send:

The Receiver Filter has format of his own that he can receive
UYV (That he do best)
XRGB (this one they could agree on...)

Those Filter who try to connect will have to Enumerate until they
agreed on a Format to use

It follow a Loop that says : ''I can do XRGB, can you send me that ?''
The Source Filter will look at his option that he can do and Answer
yes or no

If the Receiver Filter get a No
He will try his second format:
''Can you send me XRGB ?''
If the Source Filter can do it, he will tell the Receiver ''Yes'' I can
so the Format will be Agreed on XRGB

After that both Filter will be Connected at XRGB
You can see that if you choose properties in the Filter
You will see what Format he agreed on and connected to

Here is the hard part (has if all of this was not bad enough)
He can connect to the bad format by automaticly adding a Filter in between
that will do a convertion of format...

Basicaly anything could happen

What I do is go to the Source Filter and Only accept ONE Format
Ex: RGBA32
(removing the other choice)
So when I try to connect a receiver Filter he only could connect
if he can Receive XRGB32

So by clicking with the mouse on the pin or the filter you can see
the format they connected with...they could connect with other format
That process is a try and verify (hand shake)
If you see a list it's the list of format he can send or receive
You can see the IN or OUT video format connection in the Properties of the Filter

What your probleme might be is that your Source Video Grabber is in UYV
The Typical Format for Video feed
And along the way the Format got mixed

You might want to add your filter one by one
(This may result in the format to be different when they connect)
And see to what format the connection was established
(Right Click the Filter and go to properties to see IN or OUT put Pin
Format accepted or Permited if PIN not Connected yet)

Their is a Direction for all this
The Receiver filter Allways ask what he want
The Source Filter Try to provide it...
(Maybe this is the oposite but the direction is important, one Filter
ask the other try to adapt)

Don't worry your Camera is not broken, it's the conversion who is the wrong
one along the way :-)


February 02, 2005, 11:38 AM

Just to complicate matter more
When the Filter Agreed on one Format on his IN pin
Exemple XRGB32 he will force his OUT pin to that format
because he don't want to convert inside (Some filter can convert)

I'm not sure If it's not the Source Filter who do the Asking of What
format he can send, but one Filter Ask and the other Filter check if he can do it by looking in his list of Format (It's important to know who is
doing the asking)

Once a IN pin was set to a format it will force the OUT pin to the same format
and you can continue to add filter

I like to force those format to the Format I want to use
when I program a Filter, because you only have one format to worry about
and the filter will just not connect if he can agree to that format
with the next filter

This thread contains 3 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.