Thread: Capture video to wmv with DirectShow

  1. #1
    Registered User
    Join Date
    Oct 2002

    Capture video to wmv with DirectShow


    We are trying to change the "amcap" example from msdn-DirectShow so that it saves the file as .wmv instead of .avi. According to the msdn it shouldnt be much difference between capture to .avi and .wmv. But when we have tried to run the graph with .wmv we get this strange error message (0x80004005).

    Here is the code to capture asf:
    hr = gcap.pBuilder->SetOutputFileName(&MEDIASUBTYPE_Asf, L"C:\\capture.wmv",
            &gcap.pRender, NULL);    
    	if(hr != NOERROR) {
            ErrMsg(TEXT("Cannot set output file"));
            goto SetupCaptureFail;
    hr = gcap.pRender->QueryInterface(IID_IConfigAsfWriter,(void**)&pConfig);
    if(hr == NOERROR && pConfig) {	
    Any help is appreciated.

    /K & K

    Code tags added by kermi3

  2. #2
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998

    Code Tags

    I am posting this because you did not use code tags on this thread. In the furture please use Code Tags. They make your code MUCH easier to read and people will be much more likely to help you if you do. And they'll be happy about helping you

    For example:

    Without code tags:

    for(int i=0;i<5;i++)
    cout << "No code tags are bad";

    With Code Tags:
    for(int i=0;i<5;i++)
         cout << "This code is easy to read";
    This is of course a basic example...more complicated code is even easier to read with code tags than without.

    I've added code tags for you this time. They can be added by putting [code] at the beginning of your code and [/code] at the end. More information on code tags may be found at the link in my signature. Any further questions or ways I can help please feel free to PM me.

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How do video capture programs work
    By silk.odyssey in forum Windows Programming
    Replies: 4
    Last Post: 10-07-2008, 09:00 AM
  2. preferred sdk for video capture under windows?
    By reanimated in forum Windows Programming
    Replies: 2
    Last Post: 03-20-2006, 06:16 PM
  3. File as video capture source?
    By SMurf in forum Tech Board
    Replies: 0
    Last Post: 07-04-2004, 11:06 AM
  4. video capture card
    By dP munky in forum Tech Board
    Replies: 2
    Last Post: 11-27-2002, 09:51 PM
  5. Drawing a circle in a video captured frame
    By skyhigh in forum C Programming
    Replies: 2
    Last Post: 12-05-2001, 01:00 AM