Skip to main content

 none
Adjusting Brightness and Contrast Interactively RRS feed

  • Question

  • Urgent help needed.
    I'm on a project with a very short deadline and need urgent help with the SDK's for controlling video media, specifically the brightness and contrast.

    I have a Microsoft VX6000 camera installed and working. I have downloaded several test apps the use the capture multimedia API calls, ( ex - capDlgVideoSource(hWndC)  ). Initially I thought this was going to be the answer, but it does not appear that you can interactively adjust brightness and contrast while the video is running.

    I'm a seasoned developer, but new to multimedia programming.

    Any help would be much appreciated.

    Thanks Al Harper
    Monday, July 23, 2007 2:07 PM

All replies

  • Are you using DirectShow?  Or vfw?  That looks like a vfw call.

     

    For DS, if your device supports it, there is IVideoProcAmp.  If you are playing thru VMR9, there is IVMRMixerControl9 and you might also look at IAMVideoProcAmp.

    Monday, July 23, 2007 6:46 PM
  • Well, I know next to nothing about VFW, so I can neither confirm or deny.

     

    As for contrast/brightness, it seems some devices support it and some don't.  And some support the standard DS interfaces to control it (like the ones I mentioned), and some have their own custom property pages (accessed via OleCreatePropertyFrame).

    Monday, July 23, 2007 7:34 PM
  • Well al, if you have written the app that is doing the capturing you can do it dynamically by allowing the dialog to be loaded.

    If you are using an app that cant be altered for capturing. or to just do it quickly you can always create a NEW filter graph, Load the Capture device into the graph WITHOUT RENDERING PINS.
    Query interface for iprocamp and either use the ispecificpropertypages or create your own control dialog using the interface pointer.
    You can always send the capture driver messages from another filtergraph in cases where only one instance of the data stream can be created. As long as you are not rendering the stream or attempting to mess with the mkediatype.

    To test the theory. Load your device in amcap and start the captuer, then load it again in graphedit but only querying for propertypages in graph edit.

    You can easily make a utility that adjust all  the properties of all cameras on your system, while they are in use!
    Monday, July 23, 2007 10:39 PM
  • If you go to my code link in my signature and download the AutoCap class .
    The constructor takes and int coresponding the the VFW index.

    first look for
    Code Snippet

    hr = g_pCapture->RenderStream (&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio,
    pSrcFilter, NULL,NULL);


    hr = g_pCapture->RenderStream (&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video,
    pSrcFilter, pGrabberF, pNullF);

    And comment them out. You might comment out all the 'queryinterfac'es that you wont use, and especially the media control, because the destructor will call stop if the interface is present.
    Add an instance of the class to your app and pass it the int for the device you want to control. My main app object CAutoMix, is an CAMThread doing all my blending and buffer deliver behind my application. Also available for reference.

    Now in your app dialog, make a button. note: CCAutoMixer2Dlg is my VS generated MFC app class. The button checks for the pointer and then checks for the prop page
    Code Snippet


    void CCAutoMixer2Dlg::OnBnClickedButton33()
    {
    HRESULT hr;
    //MixMaster is my CAutoMix class and ac the AutoCap =)
    if(!MixMaster->ac->pProcAmp )
    return;
    ISpecifyPropertyPages *pSpec;
    CAUUID cauuid;

    hr = MixMaster->ac->pProcAmp->QueryInterface(IID_ISpecifyPropertyPages,
    (void **)&pSpec);
    if(hr == S_OK)
    {
    hr = pSpec->GetPages(&cauuid);

    hr = OleCreatePropertyFrame((HWND)this->GetSafeHwnd(), 30, 30, NULL, 1,
    (IUnknown **)&MixMaster->ac->pProcAmp, cauuid.cElems,

    (GUID *)cauuid.pElems, 0, 0, NULL);
    CoTaskMemFree(cauuid.pElems);
    pSpec->Release();
    }

    }

    You should get the dialog now and it will send mesages to your loaded device while capturing.
    Any further questions, dont hesitate. I'll be back after work Wink
    Tuesday, July 24, 2007 2:01 PM
  • Hi there, I'm looking for a way to use  IVideoProcAmp. I checked MSDN. It says I should include VidCap.h but I can't find this file in my directX folders. Anyone knows where can I get this file?

    Steven
    Tuesday, December 23, 2008 3:54 AM
  • stevenchen1116 said:

    Hi there, I'm looking for a way to use  IVideoProcAmp. I checked MSDN. It says I should include VidCap.h but I can't find this file in my directX folders. Anyone knows where can I get this file?

    \Include\vidcap.h in latest Windows SDK


    http://alax.info/blog/tag/directshow
    Tuesday, December 23, 2008 6:00 AM