VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Member
    Join Date
    Dec 2007
    Location
    Italy
    Search Comp PM
    Hello,
    I'm new to DirectShow and I need to use a webcam inside my C++ application. I'm looking at the capture examples that come with Microsoft SDK, namely AMCap and PlayCap.

    To start I'd like to change some properties concerning the webcam stream, for example I'd like to v-flip the stream. In order to do so, I changed PlayCap example adding something like this:

    IAMVideoControl *pAMVidControl = NULL;
    hr = pFilter->QueryInterface(IID_IAMVideoControl, (void**)&pAMVidControl);

    where pFilter is the capture filter and then I also added:

    hr = pBuild->FindPin(pFilter, PINDIR_OUTPUT, &PIN_CATEGORY_CAPTURE, 0, FALSE, 0, &pPin);

    where pBuild is the Capture Graph Builder. Finally I try to set the property I'd like to manage using:

    VideoControlFlags flags_v;
    flags_v = VideoControlFlag_FlipVertical;

    pAMVidControl->SetMode(pPin, flags_v);

    but if I get it again with:

    pAMVidControl->GetMode(pPin, &flags);

    I realize that nothing was set (flags is always 0 instead of 2 as expected). Am I doing something wrong? Is correct to use FindPin like I did?

    Thank you very much. Regards.
    Alex
    Quote Quote  
  2. Member
    Join Date
    Jul 2008
    Location
    Singapore
    Search Comp PM
    Hi,

    sorry to bother you. i am doing something exactly like you. i need to create an application to capture video using a osprey capture card. i have downloaded the windows sdk and i used the Playcap sample codes. But however, it doesn't seems to be working. There is no error and can be debug but all it appear is a black screen. Is there anyway you can assist me or is it convenient for you to give me some codes for capturing video because i am new to C++. Your help will be greatly appreciated,thank you (:

    Cheers,
    kelvin
    Quote Quote  
  3. Mod Neophyte Super Moderator redwudz's Avatar
    Join Date
    Sep 2002
    Location
    USA
    Search Comp PM
    We have a few members familiar with C++ programming, but they may not visit here very often. You may have better luck searching for a C++ forum or site for that part of your problem. And it may take a while here to get assistance, so be patient.

    And welcome to our forums.

    And kelvin/, please do not double post. I've locked the other topics. If you want to move a topic to another forum, PM a Mod.

    Moderator redwudz
    Quote Quote  
  4. Member
    Join Date
    Oct 2001
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by alexjep
    I realize that nothing was set (flags is always 0 instead of 2 as expected). Am I doing something wrong? Is correct to use FindPin like I did?
    You don't say if you checked the result (hr) codes as you went?

    It's years since I got my DirectX video capture code (based on PlayCap) working, so my memories of it are pretty hazy. My code doesn't seem to use FindPin() - it looks like if I wanted to find an IAMxxxx interface I would call "FindInterface" on the capture graph (the PlayCap sample shows how to do this for eg. the IAMVideoProcAmp interface. I would try that method first. When I need to identify a pin I call the EnumPins() function on the IBaseFilter interface.

    Also, isn't capture an input pin? (you specified PINDIR_OUTPUT). But if this really causes a problem I'd expect you to get an error result, hence my first question...
    Quote Quote