<p>I have a DirectShow graph to render MPEG2/4 movies from a network stream. When I assemble the graph by connecting the pins manually it doesn't render. But when I call Render on the GraphBuilder it renders fine. </p>

<p>Obviously there is some setup step that I'm not performing on some filter in the graph that GraphBuilder is performing. </p>

<p>Is there any way to see debug output from GraphBuilder when it assembles a graph?</p>

<p>Is there a way to dump a working graph to see how it was put together?</p>

<p>Any other ideas for unraveling the mystery that lives in the DirectShow box?</p>

<p>Thanks!
-Z</p>

[{'answer_id': 27858, 'author': 'Timbo', 'author_id': 1810, 'author_profile': 'https://Stackoverflow.com/users/1810', 'pm_score': 5, 'selected': True, 'text': '<p>You can watch the graph you created using GraphEdit, a tool from the DirectShow SDK. In GraphEdit, select File->Connect to remote Graph...</p>\n\n<p>In order to find your graph in the list, you have to register it in the running object table:</p>\n\n<pre><code>void AddToRot( IUnknown *pUnkGraph, DWORD *pdwRegister ) \n{\n    IMoniker* pMoniker;\n    IRunningObjectTable* pROT;\n    GetRunningObjectTable( 0, &amp;pROT );\n\n    WCHAR wsz[256];     \n    swprintf_s( wsz, L"FilterGraph %08p pid %08x", (DWORD_PTR)pUnkGraph, GetCurrentProcessId() );\n    CreateItemMoniker( L"!", wsz, &amp;pMoniker );\n\n    pROT-&gt;Register( 0, pUnkGraph, pMoniker, pdwRegister );\n\n    // Clean up any COM stuff here ...\n}\n</code></pre>\n\n<p>After destroying your graph, you should remove it from the ROT by calling IRunningObjectTable::Revoke</p>\n'}, {'answer_id': 66739, 'author': 'Jon Clegg', 'author_id': 1489, 'author_profile': 'https://Stackoverflow.com/users/1489', 'pm_score': 0, 'selected': False, 'text': '<p>Older versions of DirectX, I belive 9a, but not 9b had a "debug mode" for dshow. It would output logs of debug info into the debug console. </p>\n\n<p>So download an older version, set it to debug. then open up debugview or load graphedt.exe in visual studio to see the debug info.</p>\n'}, {'answer_id': 1070337, 'author': 'Cristian Adam', 'author_id': 131814, 'author_profile': 'https://Stackoverflow.com/users/131814', 'pm_score': 3, 'selected': False, 'text': '<p>Roman Ryltsov has created a DirectShow Filter Graph Spy tool (<a href="http://alax.info/blog/777" rel="noreferrer">http://alax.info/blog/777</a>), a wrapper COM dll over the FilterGraph interface, which logs all the calls to FilterGraph methods.</p>\n\n<p>Also it will add all the created graphs into Running Object Table (ROT) which you can then visualize using tools like GraphEdit or GraphStudio. Very useful when you need to see how a Windows Media Player graph looks like.</p>\n'}, {'answer_id': 5515482, 'author': 'persiflage', 'author_id': 222026, 'author_profile': 'https://Stackoverflow.com/users/222026', 'pm_score': 3, 'selected': False, 'text': '<p>IGraphBuilder::SetLogFile (see <a href="http://msdn.microsoft.com/en-us/library/dd390091(v=vs.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/dd390091(v=vs.85).aspx</a>) will give you lots of useful diagnostic information about what happens during graph building. Pass in a file handle (e.g. opened by CreateFile) and cast it to a DWORD_PTR. Call again with NULL to finish logging before you close the file handle.</p>\n\n<p>The code in the following blog post for dumping a graph will give you some extra information to interpret the numbers in the log file.</p>\n\n<p><a href="http://rxwen.blogspot.com/2010/04/directshow-debugging-tips.html" rel="noreferrer">http://rxwen.blogspot.com/2010/04/directshow-debugging-tips.html</a></p>\n'}, {'answer_id': 7625454, 'author': 'Aliza', 'author_id': 2885493, 'author_profile': 'https://Stackoverflow.com/users/2885493', 'pm_score': 1, 'selected': False, 'text': '<p>There is a detailed MSDN entry on this.\n<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd390650(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/dd390650(v=vs.85).aspx</a></p>\n'}, {'answer_id': 11781370, 'author': 'rogerdpack', 'author_id': 32453, 'author_profile': 'https://Stackoverflow.com/users/32453', 'pm_score': 0, 'selected': False, 'text': '<p>You could "save" the graph (serialize it) to a .grf graphedit file, possibly: <a href="https://stackoverflow.com/a/10612735/32453">https://stackoverflow.com/a/10612735/32453</a></p>\n\n<p>Also it appears that graphedit can "remote attach" to a running graph? <a href="http://rxwen.blogspot.com/2010/04/directshow-debugging-tips.html" rel="nofollow noreferrer">http://rxwen.blogspot.com/2010/04/directshow-debugging-tips.html</a></p>\n'}, {'answer_id': 26786068, 'author': 'Nitay', 'author_id': 328059, 'author_profile': 'https://Stackoverflow.com/users/328059', 'pm_score': 1, 'selected': False, 'text': '<p>You need to:</p>\n\n<ol>\n<li>Register you filter graph to the "Running Objects Table" - ROT - Using the code below</li>\n<li>Connect to your filter graph using GraphEdit (File->Connect to Remote Graph) or even better - With <a href="http://www.infognition.com/GraphEditPlus/" rel="nofollow">GraphEditPlus</a></li>\n</ol>\n\n<p>To register your filter graph as a "connectable" graph, call this with your filter graph:</p>\n\n<pre><code>void AddToROT( IUnknown *pUnkGraph, DWORD *pdwRegister ) \n{\n    IMoniker * pMoniker;\n    IRunningObjectTable *pROT;\n    WCHAR wsz[128];\n    HRESULT hr;\n\n    if (FAILED(GetRunningObjectTable(0, &amp;pROT)))\n        return;\n\n    wsprintfW(wsz, L"FilterGraph %08x pid %08x", (DWORD_PTR)pUnkGraph, GetCurrentProcessId());\n\n    hr = CreateItemMoniker(L"!", wsz, &amp;pMoniker);\n    if (SUCCEEDED(hr)) \n    {\n        hr = pROT-&gt;Register(0, pUnkGraph, pMoniker, pdwRegister);\n        pMoniker-&gt;Release();\n    }\n\n    pROT-&gt;Release();\n}\n</code></pre>\n\n<p>And call this before you release the graph:</p>\n\n<pre><code>void RemoveFromROT(DWORD pdwRegister)\n{\n    IRunningObjectTable *pROT;\n\n    if (SUCCEEDED(GetRunningObjectTable(0, &amp;pROT))) \n    {\n        pROT-&gt;Revoke(pdwRegister);\n        pROT-&gt;Release();\n    }\n}\n</code></pre>\n\n<p>`</p>\n'}]
['https://Stackoverflow.com/questions/27832', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2587612/']