Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Video directshow
Why my code below does not work? It compiles fine, but when I execute it gives error "Could'nt run the graph 0x80070005"
IGraphBuilder * g_pGraph = NULL;
ICaptureGraphBuilder2 * g_pCapture = NULL;
 
IBaseFilter *pMux = NULL;
IFileSinkFilter *pSink = NULL;
 
///////////////////////////////////////////////////////////////////////////////////////

    // Render the preview pin on the video capture filter
    // Use this instead of g_pGraph->RenderFile

    hr = g_pCapture->SetOutputFileName(&MEDIASUBTYPE_Avi,L"C:\\Example.avi", &pMux, NULL);
    hr = g_pCapture->RenderStream (&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pSrcFilter, NULL, pMux);
 if (FAILED(hr))
    {
        Msg(TEXT("Couldnt render the video capture stream.  hr=0x%x\r\n")
            TEXT("The capture device may already be in use by another application.\r\n\r\n")
            TEXT("The sample will now close"), hr);
        pSrcFilter->Release();
        return hr;
    }
 
    hr = g_pCapture->RenderStream (&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, pSrcFilter, NULL, NULL);
 
 if (FAILED(hr))
    {
        Msg(TEXT("Couldnt render the video capture stream.  hr=0x%x\r\n")
            TEXT("The capture device may already be in use by another application.\r\n\r\n")
            TEXT("The sample will now close"), hr);
        pSrcFilter->Release();
        return hr;
    }
Posted 21-May-11 7:10am
Edited 21-May-11 8:23am
v3
Comments
Christian Graus at 21-May-11 12:12pm
   
Tihs is a code snippet - do you have a question ?
S Mewara at 21-May-11 13:24pm
   
OP said:
Ideally as per MSDN it should have inserted smart tee and executed fine. But it does not work. What am I doing wrong?
WhizzMurtuza at 21-May-11 12:17pm
   
Ideally as per MSDN it should have inserted smart tee and executed fine. But it does not work. What am I doing wrong?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

0x80070005 is ACCESS_DENIED
 
Sure it's just not something as simple as example.avi is RO?
  Permalink  
Comments
WhizzMurtuza at 21-May-11 20:40pm
   
What do you mean by RO?
barneyman at 21-May-11 20:42pm
   
read only
WhizzMurtuza at 21-May-11 21:57pm
   
Example.avi is an output file if you notice.
barneyman at 21-May-11 22:06pm
   
yes - i did notice
 
You got an access denied error, is there a chance that you either don't have access rights into c:\ or that there is already a c:\example.avi that is marked read only
Ashraf_Rash at 11-Apr-12 9:58am
   
Change C:\ to D:\

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 400
1 Sergey Alexandrovich Kryukov 329
2 Afzaal Ahmad Zeeshan 264
3 BillWoodruff 245
4 CPallini 195
0 OriginalGriff 5,560
1 DamithSL 4,476
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 21 May 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100