DirectShow Development ForumDiscuss how to develop DirectShow applications using the API provided in the Windows Platform SDK© 2009 Microsoft Corporation. All rights reserved.Wed, 25 Nov 2009 23:39:12 Ze17d4690-29b7-46c1-b2a2-34394bf59032http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/10756996-7a4a-49d5-8cdf-9019ab19f060http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/10756996-7a4a-49d5-8cdf-9019ab19f060drewdbhttp://social.msdn.microsoft.com/Profile/en-US/?user=drewdbWhat would i change in the Async Source sampleHi to all,<br/><br/>I am trying to develop a directshow source filter that i can feed a byte array of video and audio data into to then be rendered. I am receiving these bytes over rtp from a graph with the samplegrabber.<br/><br/>I think that the async source filter sample may be my best bet but i'm not a c++ programmer but a c# one.<br/><br/>I can see the ReadTheFile function, so if this filter is my best option, what would i need to change here so that i can feed my byte array chunks into this filter via c#?<br/><br/>any help or pointers would be appreciated.<hr class="sig">new to .net and c#Tue, 24 Nov 2009 23:57:24 Z2009-11-25T23:39:12Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/0fc6e80d-da32-49b1-97b6-57fa111ab1dahttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/0fc6e80d-da32-49b1-97b6-57fa111ab1dasmlsrhttp://social.msdn.microsoft.com/Profile/en-US/?user=smlsrUAC and Directshow Writer and Capture Source IssuesI have noticed when in VISTA or WINDOWS 7, and while running a directshow filter which is providing a live capture breaks when a user does something which causes a UAC box to come up.  What I mean is the whole fitler chain basically restarts it timestamps, from 0, and laggging begins very badly. <br/><br/>There was some discussion of this issue in a previous post, but no response/resolution.<br/><br/>Is their anyway for my SOURCE filter to know when a UAC has been called and returned so i can stop trying to process??<br/><br/> <pre>10:36:44 AM.980: SampleTime=9.3, Time(start=93000000, end=93500000), MediaTime(start=93000000, end=93500000), data length=921600, keyframe=True, Data=2727282727282727... 10:36:45 AM.030: SampleTime=9.35, Time(start=93500000, end=94000000), MediaTime(start=93500000, end=94000000), data length=921600, keyframe=True, Data=2727282727282727... 10:36:45 AM.309: SampleTime=0, Time(start=0, end=500000), MediaTime(start=0, end=500000), data length=921600, keyframe=True, Data=2727282727282727... 10:36:45 AM.330: SampleTime=0.05, Time(start=500000, end=1000000), MediaTime(start=500000, end=1000000), data length=921600, keyframe=True, Data=2727282727282727... 10:36:45 AM.371: SampleTime=0.1, Time(start=1000000, end=1500000), MediaTime(start=1000000, end=1500000), data length=921600, keyframe=True, Data=2727282727282727...</pre> Basically it seems when a UAC is called for, all Directshow processing stops.  When the UAC is closed, dshow resumes but very strangley / bad....<br/><br/>ShawnTue, 24 Nov 2009 15:55:24 Z2009-11-25T22:56:09Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/e2ea60f2-50e9-4755-a99f-9bc21d0ae546http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/e2ea60f2-50e9-4755-a99f-9bc21d0ae546Mister-Zorghttp://social.msdn.microsoft.com/Profile/en-US/?user=Mister-ZorgIVMRWindowlessControl9::SetVideoClippingWindow and his Handle<font size=2><span style="font-family:Arial">How can I get the handle from my panel (windows-form) for the </span></font>IVMRWindowlessControl9:<img height=19 alt="Tongue Tied" src="http://forums.microsoft.com/MSDN/emoticons/emotion-7.gif" width=19>etVideoClippingWindow?Fri, 14 Nov 2008 22:31:33 Z2009-11-25T21:48:57Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/18ca82b1-f977-4973-b0d9-9cbf8dd42d7ahttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/18ca82b1-f977-4973-b0d9-9cbf8dd42d7aSylvain Boisséhttp://social.msdn.microsoft.com/Profile/en-US/?user=Sylvain%20Boiss%u00e9Deadlock with GMFBridge when calling BridgeGraphs(NULL, NULL)Hello, <div><br/></div> <div>we get a deadlock when we try to disconnect graphs and we are having headaches trying to figure out why. We included the GMFBridge source code in our solution so we could trace in it and figure out the cause of the deadlock. The stack traces of the deadlocked threads are the following:</div> <div><br/></div> <div>Thread Id: 6212</div> <div>-------------------------------------</div> <div> <div>GMFBridge.dll!SemLock::SemLock(void * hSem=0x00000aa8)  Line 60 + 0xe bytes<span style="white-space:pre"> </span>C++</div> <div>GMFBridge.dll!BridgeStream::DisconnectBridge()  Line 887 + 0x1a bytes<span style="white-space:pre"> </span>C++</div> <div>GMFBridge.dll!BridgeController::BridgeAtDiscont(IUnknown * pSourceGraphSinkFilter=0x00000000, IUnknown * pRenderGraphSourceFilter=0x00000000, int bIsDiscontinuity=0)  Line 621<span style="white-space:pre"> </span>C++</div> <div>GMFBridge.dll!BridgeController::BridgeGraphs(IUnknown * pSourceGraphSinkFilter=0x00000000, IUnknown * pRenderGraphSourceFilter=0x00000000)  Line 562 + 0x1a bytes<span style="white-space:pre"> </span>C++</div> <div>[External Code]<span style="white-space:pre"> </span></div> <div>DirectShowCapture.dll!MyCompany::VideoEncoder::DirectShowMediaStream::TeardownGraph() Line 657 + 0x41 bytes<span style="white-space:pre"> </span>C++</div> <div>DirectShowCapture.dll!MyCompany::VideoEncoder::DirectShowMediaStream::Stop() Line 285<span style="white-space:pre"> </span>C++</div> <div>DirectShowCapture.dll!MyCompany::VideoEncoder::DirectShowCaptureProvider::EngineThread() Line 436<span style="white-space:pre"> </span>C++</div> <div>[External Code]<span style="white-space:pre"> </span></div> <div>kernel32.dll!76801174() <span style="white-space:pre"> </span></div> <div>ntdll.dll!77cab3f5() <span style="white-space:pre"> </span></div> <div>ntdll.dll!77cab3c8() <span style="white-space:pre"> </span></div> <div><br/></div> </div> <div>Thread id: 8116</div> <div>--------------------------------------</div> <div> <div> <div>ntdll.dll!77c964f4() <span style="white-space:pre"> </span></div> <div>[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]<span style="white-space:pre"> </span></div> <div>ntdll.dll!77c95e6c() <span style="white-space:pre"> </span></div> <div>KernelBase.dll!75e2179c() <span style="white-space:pre"> </span></div> <div>quartz.dll!5400ba2b() <span style="white-space:pre"> </span></div> <div>GMFBridge.dll!BridgeSinkInput::Receive(IMediaSample * pSampleIn=0x04816c18)  Line 771 + 0x3c bytes<span style="white-space:pre"> </span>C++</div> <div>DirectShowCapture.dll!CTransformFilter::Receive()  + 0x147 bytes<span style="white-space:pre"> </span></div> <div>DirectShowCapture.dll!CTransformInputPin::Receive()  + 0xa6 bytes<span style="white-space:pre"> </span></div> <div>DirectShowCapture.dll!CBaseInputPin::ReceiveMultiple()  + 0x86 bytes<span style="white-space:pre"> </span></div> <div>qcap.dll!5a3da8a2() <span style="white-space:pre"> </span></div> <div>qcap.dll!5a3dab78() <span style="white-space:pre"> </span></div> <div>kernel32.dll!76801174() <span style="white-space:pre"> </span></div> <div>ntdll.dll!77cab3f5() <span style="white-space:pre"> </span></div> <div>ntdll.dll!77cab3c8() <span style="white-space:pre"> </span></div> <div><br/></div> <div>The way we could find the threads causing the deadlocks was by outputing in the debug output what threads where locking the handle used by SemLock():</div> <div>2728 = 0xaa8</div> <div>----------------------------------------------</div> <div> <div>[TID #6212] - DisconnectBridge - Getting lock of handle 3836</div> <div>[TID #8116] BridgeSinkInput::unlock() - Releasing semaphore 2728</div> <div>[TID #8116] BridgeSinkInput::LockIncremental() - Getting semaphore 2728</div> <div>[TID #6212] - DisconnectBridge - Releasing lock of handle 3836</div> <div>[TID #6212] - DisconnectBridge - Getting lock of handle 2728</div> <div><br/></div> <div>Using these traces, we could identify that thread id 8116 was locking the semaphore thread 6212 was waiting on, but would never release it, because it is stuck waiting on the following call:</div> <div><br/></div> <div>BridgeSinkInput::Receive(IMediaSample *pSampleIn)</div> <div>{</div> <div>[...]</div> <div>pProxy = new ProxySample(this, &amp;hr); // The proxy sample is the object that locks the semaphore in that thread by calling BridgeSinkInput::LockIncremental() in its cstr.</div> <div>[...]</div> <div>hr = m_pCopyAllocator-&gt;GetBuffer(&amp;pOut, NULL, NULL, 0); // The thread is stuck here, so it never releases the semaphore, thus preventing the other thread from completing DisconnectBridge();</div> </div> </div> <div>[...]</div> <div>}</div> </div> <div><br/></div> <div>We found various other developers experiencing a similar problem in the past, none of the forum threads we could find on the web would lead to a solution that would fix or work around the problem. They would actually not go as far as we did in their investigation, so we hope maybe this time someone will be able to help us figure out the problem, since we could find what thread is blocking BridgeGraphs().</div> <div><br/></div> <div> <div><a title="http://www.keyongtech.com/2534721-gmfbridge-problem-with-xvid CTRL + Click to follow link" href="http://www.keyongtech.com/2534721-gmfbridge-problem-with-xvid"><span style="text-decoration:none">http://www.keyongtech.com/2534721-gmfbridge-problem-with-xvid</span></a></div> <div><a href="http://www.ureader.com/msg/14711691.aspx"><span style="text-decoration:none">http://www.ureader.com/msg/14711691.aspx</span></a></div> <div><span style="color:#7f7f7f;font-size:small"><span style="color:#7f7f7f;font-size:small"><a title="http://www.keyongtech.com/2535126-gmfbridge-cannot-capture-audio CTRL + Click to follow link" href="http://www.keyongtech.com/2535126-gmfbridge-cannot-capture-audio"><span style="text-decoration:none">http://</span></a></span></span><span style="font-size:small"><span style="text-decoration:none"><a title="http://www.keyongtech.com/2535126-gmfbridge-cannot-capture-audio CTRL + Click to follow link" href="http://www.keyongtech.com/2535126-gmfbridge-cannot-capture-audio">www.keyongtech.com</a></span></span><span style="color:#7f7f7f;font-size:small"><span style="color:#7f7f7f;font-size:small"><span style="text-decoration:none"><a title="http://www.keyongtech.com/2535126-gmfbridge-cannot-capture-audio CTRL + Click to follow link" href="http://www.keyongtech.com/2535126-gmfbridge-cannot-capture-audio">/2535126-gmfbridge-cannot-capture-audio</a></span></span></span></div> <div><span style="color:#7f7f7f;font-size:small"></span> </div> <div>How can we prevent the dealock to happen? Why does GetBuffer() actually locks, preventing BridgeGraphs() from completing?</div> <div><br/></div> <div>Thanks for any input!</div> <div><br/></div> <div>-Sylvain Boissé</div> </div><hr class="sig">-SylvainWed, 25 Nov 2009 21:05:40 Z2009-11-25T21:05:41Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/b8bf047d-8353-4b32-89a5-776bec85cb17http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/b8bf047d-8353-4b32-89a5-776bec85cb17John Archerhttp://social.msdn.microsoft.com/Profile/en-US/?user=John%20ArcherWin7: Switching back from fullscreen produces black videoHi there!<br/> <br/> I built a little test video player and put my DS code inside a MFC application under Windows 7. The filter graph is built automatically with CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void**)&amp;m_pGraph);<br/> I defined an IDC_STATIC area inside the window which contains the video:<br/> <br/> <div style="color:Black;background-color:White"> <pre>HRESULT hr = m_pGraph-&gt;QueryInterface(IID_IVideoWindow, (<span style="color:Blue">void</span> **)&amp;m_pVideo); RECT plane; GetDlgItem(IDC_STATIC_VIDEOPLANE)-&gt;GetWindowRect(&amp;plane); ScreenToClient(&amp;plane); m_pVideo-&gt;put_Owner((OAHWND)GetSafeHwnd()); m_pVideo-&gt;put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS); m_pVideo-&gt;put_Visible(OATRUE); ... </pre> </div> <br/> I turn on and off fullscreen mode with this method:<br/> <br/> <div style="color:Black;background-color:White"> <pre><span style="color:Blue">void</span> CDirectShowPlayerDlg::Fullscreen(<span style="color:Blue">bool</span> enabled) {<br/> <span style="color:Blue">if</span> (m_pGraph) { IVideoWindow *pVideo = NULL; m_pGraph-&gt;QueryInterface(IID_IVideoWindow, (<span style="color:Blue">void</span> **)&amp;pVideo); pVideo-&gt;put_FullScreenMode(enabled?OATRUE:OAFALSE); pVideo-&gt;Release(); } } </pre> </div> <br/> So, if I start the video in windowed mode in runs properly. Then, if I switch to fullscreen the video (with audio) runs nice in fullscreen mode. But if I switch back to windowed mode, my video area is just black, but audio continues to play. :-( If I then switch back to fullscreen again, the video runs properly again!<br/> <br/> So, I am bit helpless why this happens. Any ideas?<br/> <br/> Thanks a lot in advance!Mon, 19 Oct 2009 12:35:53 Z2009-11-25T20:24:38Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/5798af0d-0fc6-4ebc-80d4-2a341053245chttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/5798af0d-0fc6-4ebc-80d4-2a341053245cINondelegatingUnknownhttp://social.msdn.microsoft.com/Profile/en-US/?user=INondelegatingUnknownwho do removes my questions?<p>Dear Moderators,<br/><br/>please describe why my posts disappears? I've posted one hour ago, and now it's disappeared :(</p>Wed, 25 Nov 2009 13:47:45 Z2009-11-25T13:57:20Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/279b8b27-e833-4e8f-835f-7334a0751924http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/279b8b27-e833-4e8f-835f-7334a0751924Venkat Arunhttp://social.msdn.microsoft.com/Profile/en-US/?user=Venkat%20ArunAudio Device not Detected in Windows 7Hello, <div><br/></div> <div>Am working Video Capture using Direct show in c#.It was working fine in XP. But When i try in windows 7, it was not display the audio device and codec. </div> <div><br/></div> <div> <div>&quot; <strong>DsDevice[] audioDevices = DsDevice.GetDevicesOfCat(FilterCategory.AudioInputDevice);</strong></div> <div><strong><br/></strong></div> <div><span style="font-weight:bold">foreach (DsDevice device in audioDevices)</span></div> <div><strong>{</strong></div> <div><strong>    lstAudioDevices.Items.Add(device.Name);</strong></div> <div><strong>}</strong> &quot;</div> <div><br/></div> <div><br/></div> <div>This is a code which am written in my project. can someone help me.</div> <div><br/></div> <div>thanks in advance.</div> <div><br/></div> <div>Venkat.N</div> <div><br/></div> </div> <div><br/></div><hr class="sig">VenkatarunWed, 25 Nov 2009 10:35:34 Z2009-11-25T13:42:10Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/f6f8d1b8-b5b0-4d5c-a157-e48fe0a85769http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/f6f8d1b8-b5b0-4d5c-a157-e48fe0a85769INondelegatingUnknownhttp://social.msdn.microsoft.com/Profile/en-US/?user=INondelegatingUnknowntrouble with IGraphConfig::DynamicReconnect()actually that call returns with 0x80040216 = VFW_E_NOT_FOUND. I just can't understand why... Could you help me?<br/><br/>A citation from documentation : &quot;if the downstream pin does not support <strong>IPinConnection</strong>, or if it rejects the new media type, the method calls the <a href="http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/cdynamicoutputpin_dynamicreconnect.htm"><strong>CDynamicOutputPin::DynamicReconnect</strong></a> method to perform a dynamic reconnection.&quot;<br/><br/>Is it means that downstream input may not support IPinConnection and still can be dynamically reconnected?<br/>Or should I implement IPinConnection on downstream input to enable dynamic reconnection?Tue, 24 Nov 2009 16:16:11 Z2009-11-25T11:11:10Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/dcc7de65-d09d-44f6-8cab-54ed43e04d72http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/dcc7de65-d09d-44f6-8cab-54ed43e04d72rc0310http://social.msdn.microsoft.com/Profile/en-US/?user=rc0310How to save and load the setting of video compressor?Hello,<br/> <br/> I am working with a webcam app.<br/> <br/> It can capture video which XviD video compressor.<br/> <br/> But my boss don't like the configuration dialog provided by XviD (IAMVfwCaptureDialogs).<br/> <br/> So I have to provide a default setting and load it before capture.<br/> <br/> My problem is, <br/> how to Save the settings of XviD to a file?<br/> and how to Load the settings of XviD from the file?<br/> <br/>Wed, 25 Nov 2009 07:51:06 Z2009-11-25T09:09:03Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/186a2dd7-b0e6-42d0-9fa1-f66b31306ed3http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/186a2dd7-b0e6-42d0-9fa1-f66b31306ed3Steven Nagyhttp://social.msdn.microsoft.com/Profile/en-US/?user=Steven%20NagyMpeg1Payload and WaveFormatEx - no soundHi,<br/><br/>I'm trying to get my app to display TV with video and audio. Video works fine. This is on Windows XP SP2.<br/><br/>In GraphEdit I am able to get both video and audio, although audio was a little tricky. Here's a breakdown of the video part of my graph:<br/>DVBT Network Provider =&gt; BDA Tuner =&gt; BDA Capture =&gt; MPEG2 Demux [pin '2'] =&gt; Video Decoder =&gt; VMR9<br/><br/>I've found video is on pin 2 and audio is on pin 3. The default output of that pin when viewed in graph edit is:<br/>Major Type: AUDIO - SubType: MPEG2_AUDIO - Format: WaveFormatEx 48.000 Khz 0bit stereo<br/><br/>Unfortunately I don't have a MPEG2 audio decoder here. I've tried everything. BUT I do have an MPEG1 audio decoder as a standard filter, and I've noticed that by playing around with the demuxer properties, I can create a new pin with output of &quot;MPEG-1 Audio&quot;. When I add such a pin and then check its properties, it has sub type of 'MPEG1Payload' and format of  'WaveFormatEx 48.000 Khz 0bit stereo'. I then wire this up to the MPEG Audio decoder and from there to the direct sound output. However sound STILL doesn't work until I discovered that I needed to map the Audio PID to my new pin as well. Perfect! Now sound works. <br/><br/>The problem is that when I submit a tune request, the PID mapping stays the same and doesn't get updated for the new station. However I have noticed that on pins 2 and 3 the pid mappings ARE updated; something must do this automatically. <br/><br/>So next in graph edit I decided to be tricky. I deleted pin 3 on the demuxer and created a new one with MPEG-1 Audio as described above, and called that new pin &quot;3&quot; (in other words I replaced the old audio pin with my new one). Now when I submit tune request in Graph Edit everything works! Sweeeet.<br/><br/>So I thought, if I can do this in Graph Edit, I should be able to do this in code. However I'm getting quite caught out. In graph edit, when I add a new pin of type 'MPEG-1 Audio' it goes and sets the format automatically. I guess its discovering this information somehow. But in code I cannot replicate it. I create a WaveFormatEx and assign it to my AMMediaType which I use to set the media type on pin 3 (IMpeg2Demultiplexer.SetOutputPinMediaType). I then proceed to render the pin but I can't connect it up. When I connect to the running graph, the new pin3 LOOKS the same, but there are all these other settings on those objects above that graph edit doesn't show and I'm not sure I have the right values. I've been searching the net all morning and can't find a solution.<br/><br/>I suspect that if GraphEdit can auto detect those settings, then I should be able to as well. I'm just not sure how.<br/>I'm doing this in C# but I think its my general approach I need help with, not a bug in my code per se.<br/><br/>Appreciate all help. Thanks<br/><br/>SteveTue, 24 Nov 2009 02:24:32 Z2009-11-24T14:32:43Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/4b2c57ef-1ee0-4987-9d92-3d28f763abf0http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/4b2c57ef-1ee0-4987-9d92-3d28f763abf0kjj902http://social.msdn.microsoft.com/Profile/en-US/?user=kjj902DS demux filters for UVC1.0 MPEG2 Transport StreamWe have a live UVC1.0 MPEG2 Transport Stream, with only one H.264 Elemetary Stream packaged inside. Does anyone know a good publically-available demux filter, such that we can get the H.264 Elementary Stream from UVC1.0 MPEG2 TS? We have tried very hard, but fail to make MS MPEG2 demux working (at an XP-SP3 machine). We also know Elecard MPEG2 Push Demux seems working, but we want to something really publically-available.<br/><br/>Thank you very much and look forward to hearing from you guys.Tue, 24 Nov 2009 13:53:07 Z2009-11-24T13:53:07Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/88cc01d0-29ea-4b40-b0a4-8b8553870abchttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/88cc01d0-29ea-4b40-b0a4-8b8553870abcexcept09http://social.msdn.microsoft.com/Profile/en-US/?user=except09Manually stream video file to the splitterHi, im writing program witch uses multiple hostings as video source so I can dynamically switch between them and play video files. Is there any source filters I can use to manually stream data to splitter or should I write one? I need sometheng like File URL source, but with my own downloading procedure.<br/> <br/> Thank you.Mon, 23 Nov 2009 09:40:37 Z2009-11-23T15:08:08Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/554ea5a2-4534-4ff5-9a9d-6a299cf8d995http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/554ea5a2-4534-4ff5-9a9d-6a299cf8d995KSN Prasadhttp://social.msdn.microsoft.com/Profile/en-US/?user=KSN%20PrasadAEC from C#Hi Sirs,<br/> <br/> I am basically a Java programmer, new to dot net environment. Until this task, I am able to cope up with the things with what the knowledge I have on Java. But this task need compulsory skills on dotnet.<br/> <br/> The task is, I have to activate the AEC feature in windows Operating System. My project is in C#. The code pieces I got in many forums is in C++ only and many suggested me that C++ is the better option for this. I thought of running the code from C++, make dll out of it and use it in my C# project. While running the code piece, at every step I faced many problems (ie AECMicArray technique that uses DMO, work only on Vista and later versions, but my implementation need to work on both XP and Vista). I have following doubts.<br/> <br/> I found that Capture, CaptureBuffer, CaptureBufferDescription, Device, SecondaryBuffer, BufferDescription and FullDuplex classes are defined in managed code environment to enable AEC feature. If you suggest me still to use C++ (Unmanaged code environment), could you tell me what is the purpose of these classes.<br/> <br/> I found that there is no proper documentation (how to use these classes) for the above classes. But I found that all these classes are more or less same to the C++ code environment, where AEC is being achieved with DirectSoundFullDuplexCreate8 function. And I believed that I can write the code in C# and it will work in the same way. But my first bad luck is its not working. Once I create FullDuplex object and use same CpatureBuffer and SecondaryBuffer objects to Capture and play, there is no sound at all from speakers. My second bad luck is there is no documentation for these classes.<br/> <br/> My existing project environment is using CaptureBuffer and SecondaryBuffer objects to capture and play. Now, if I implement my AEC feature in C++ code environment and create new CaptureBuffer and SecondaryBuffer objects, I may need to use the same (new C++ objects) objects for capture and play, and it may lead to change majority of the code.<br/> <br/> I believed that this forum give proper/more reliable solutions instead of searching in google. Please help me. If need any more clarification, reply to this thread. Still if it is not related to this forum, please suggest me in which forum I can rise the same.<br/> <br/> Thanking you,<br/> KSN Prasad.<input type=hidden> <input type=hidden>Mon, 23 Nov 2009 07:26:02 Z2009-11-23T14:56:10Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/9257bab3-383a-4e8c-8da6-7d9548f09716http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/9257bab3-383a-4e8c-8da6-7d9548f09716jo123456http://social.msdn.microsoft.com/Profile/en-US/?user=jo123456Configuring Windows Media Audio Encoder DMO to reduce delayI am writing an application that records audio and video to separate files since the video is supposed to be streamed, the video recoding graph has a very low latency. Now I nedd to configure audio encoding graph to the same low delay (I need to have  sync between audio and video). It is supposed to look like this:<br/> <br/> source-&gt;WMAudio Encoder 9 DMO-&gt;Capture-&gt;Null renderer<br/> <br/> Right now I have a delay of about 2s for audio, compared to 100-200ms for video. The delay in the graph above comes from the Encoder DMO. <br/> <br/> Now I need to know which values I need to send to its Property bag. I have looked through the DMO Encoder reference on <a href="http://msdn.microsoft.com/en-us/library/dd756598(VS.85).aspx">http://msdn.microsoft.com/en-us/library/dd756598%28VS.85%29.aspx</a> , but most of the properties are for Vista (I use Windows Xp sp3). <br/> <br/> Is there anyone who knows which properties I should pass to the property bag?<br/> <br/> Thanks in advance.Mon, 23 Nov 2009 09:11:11 Z2009-11-23T14:29:20Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/699d6635-8311-46f6-898d-f1e4133dc9d0http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/699d6635-8311-46f6-898d-f1e4133dc9d0freefallAddicthttp://social.msdn.microsoft.com/Profile/en-US/?user=freefallAddictPin media type negotiation for a transform filterHi, <div>I'm working through writing a Transform Filter.  For <a title="media type negotiation" href="http://msdn.microsoft.com/en-us/library/ms787691(VS.85).aspx">media type negotiation</a>, I'd like my transform filter to accept the media type MEDIATYPE_Video, and subtype MEDIASUBTYPE_RGB24.</div> <div><br/></div> <div>For my input pin, I've added a CheckMediaType():</div> <div><br/></div> <div></div> <pre style="font-size:11px;border:1px solid #d0d0d0">HRESULT CInputPin::CheckMediaType(const CMediaType *pmt)  {    // CheckMediaType is called once for every media type proposed during the connect process // CheckMediaType must accept or reject the proposed media type  CAutoLock lock_it(m_pLock);          if (m_bInsideCheckMediaType == TRUE)            return NOERROR;            m_bInsideCheckMediaType = TRUE;        HRESULT hr = NOERROR; // major type video, subtype MEDIASUBTYPE_RGB24 or reject if( *pmt-&gt;Type() != MEDIATYPE_Video || *pmt-&gt;Subtype() != MEDIASUBTYPE_RGB24 ) return VFW_E_TYPE_NOT_ACCEPTED;         // The media types that we can support are dependent on the     // downstream connections. If we have downstream connection, we should     // check with them     COutputPin *pOutputPin = m_pParent-&gt;GetOutputPin();         if (pOutputPin != NULL &amp;&amp; pOutputPin-&gt;m_Connected != NULL)      { // The pin is connected, check its peer                 hr = pOutputPin-&gt;m_Connected-&gt;QueryAccept(pmt);                    if (hr != NOERROR)  {                     m_bInsideCheckMediaType = FALSE;                        return VFW_E_TYPE_NOT_ACCEPTED;                     }     }             // Either all the downstream pins have accepted or there are none.         m_bInsideCheckMediaType = FALSE;        return NOERROR;    } </pre> However, during the debug process (running graphedit with my transform filter and hooking its input pin up to a capture card filter's preview pin, although this function returns <span style="font-family:monospace;white-space:pre">VFW_E_TYPE_NOT_ACCEPTED<span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;white-space:normal"> for all but the RGB24 format, the pin connection still ends up connecting with an undesired format (YUY2 or similar!).</span></span> <div><br/></div> <div><span style="font-family:monospace;white-space:pre"></span>Media type negotiation theory is hard to follow from MSDN - can anyone let me know what I'm missing?</div> <div><br/></div> <div>thanks!</div> <div><br/></div>Mon, 23 Nov 2009 11:07:23 Z2009-11-25T13:49:45Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/58d4d17b-3545-471a-8a3a-62adc0785445http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/58d4d17b-3545-471a-8a3a-62adc0785445Ivan Rendulichttp://social.msdn.microsoft.com/Profile/en-US/?user=Ivan%20RendulicRenderFile on mp3 trows an exception<div class=message-content> <div class=message-date>2009-11-20 20:21:51 UTC</div> <p>When trying to RenderFile(mp3filename) on Windows 7 , it trows an exception HRESULT: 0x80040266</p> </div>Sat, 21 Nov 2009 07:53:59 Z2009-11-23T14:21:05Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/5e220088-fc46-4133-ade1-3809e5867959http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/5e220088-fc46-4133-ade1-3809e5867959Exodiahttp://social.msdn.microsoft.com/Profile/en-US/?user=ExodiaDevelope Radio GUI with USB FM TunerI'm doing Radio GUI as my project but I have stuck in how to connect to my hardware(Kworld SnapMusic Mobile 700). Have anyone can teach me or giving some reference to do it ?Sun, 22 Nov 2009 12:53:30 Z2009-11-22T20:11:16Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/0cacd932-12b0-4743-a1d9-211031247cd2http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/0cacd932-12b0-4743-a1d9-211031247cd2lilly_123http://social.msdn.microsoft.com/Profile/en-US/?user=lilly_123Multiple Graph Instance using CLSID_FilterGraphHi All,<br/>    If i create multiple graph instance using <span style="font-size:x-small">CLSID_FilterGraph will each be created in a seperate thread or process.</span>Thu, 19 Nov 2009 07:10:51 Z2009-11-22T14:05:39Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/3c0b9920-695a-421e-8d72-4ed8a9937bebhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/3c0b9920-695a-421e-8d72-4ed8a9937bebniroserhttp://social.msdn.microsoft.com/Profile/en-US/?user=niroserAnalog crossbar video with VMR9Hi,<br/> <br/> When working with graphedit, I am able to use a crossbar-&gt;capture device-&gt;vmr9 in order to generate a preview window.<br/> <br/> While looking in MSDN I found that you cannot create a crossbar filter but when you create ICaptureGraphBuilder2 it will create it for you.<br/> <br/> I don't want to go through that road, I don't want to use ICaptureGraphBuilder2 because it creates another window.<br/> <br/> Can someone please help me to bypass this issue? I just want to create the crossbar and add it as a filter to my graph.<br/> <br/> ThanksSat, 21 Nov 2009 21:46:27 Z2009-11-22T03:29:39Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/3553a7da-7f53-433d-9188-54c504dbac6chttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/3553a7da-7f53-433d-9188-54c504dbac6cYuriy F.http://social.msdn.microsoft.com/Profile/en-US/?user=Yuriy%20F.How to redistribute the DirectShow with your application?<p>Hi All,</p> <p>I use DirectShow in my application to convert certain types of files. <br/>DirectShow was installed to my PC from installation the Platform SDK for Windows (&quot;Windows Server 2003 R2 Platform SDK&quot;) for development purposes, certainly.</p> <p>The end users of my application (and my customer) are afraid to install a few installations a long time and to fill a lot of forms during setup. <br/>It's clear that for end user the full installation of the Platform SDK for Windows which contains the DirectShow (with examples, tools, redundant utilities and etc. for development) isn't needed. <br/>By the way, Platform SDK for Windows package isn't small and weighs about 400 MB. <br/>Unfortunally, the operation of my application will be failed without the installation of DirectShow at all.</p> <p>Could somebody knows the list of necessary components for minimal adequate package of DirectShow? <br/>Or Who has ever used a some small installations of DirectShow for prerequisites?  <br/>(For example, if the some older versions of DirectX package is contained DirectShow installation as single small *.msm or *.msi file? )</p> <p>Does the list of components DirectShow needed to be installed on end-user's target platform be changed depending on the architecture (x86, amd64, ia64) of the target platform?<br/><br/>Thanks in advance,<br/><br/>Yuriy</p>Fri, 20 Nov 2009 19:40:11 Z2009-11-21T05:03:47Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/ed5f5ce0-8b86-46ca-9889-9f94ccb27b0fhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/ed5f5ce0-8b86-46ca-9889-9f94ccb27b0fhurrichttp://social.msdn.microsoft.com/Profile/en-US/?user=hurricabout the reference time and stream timeI am coding a H.264 filter. There is a problem about the reference time and stream time setting.<br/> When there is a sample to be rendered, an IMediaSample is gotten from the down-stream filter and the following code is used to set the reference time and stream time:<br/> <br/> REFERENCE_TIME curSmplTime = sampleTM[iDsblIdx].mdstt, curSmpLstTime;<br/> REFERENCE_TIME curRefTime = sampleTM[iDsblIdx2].mdtmstt, curRefLstTime = _I64_MAX;<br/> pOut-&gt;SetMediaTime(&amp;curRefTime, &amp;curRefLstTime);<br/> curSmpLstTime = curSmplTime+average_FrameTime;<br/> pOut-&gt;SetTime(&amp;curSmplTime,&amp;curSmpLstTime);<br/> <br/> I simplily set the curRefLstTime as _I64_MAX, and the curSmpLstTime as start stream time+average_FrameTime,<br/> in which the average_FrameTime is from VIDEOINFOHEADER::AvgTimePerFrame in HRESULT CMyAVC::CheckInputType(const CMediaType *mtIn).<br/> <br/> Is there some error in the code?Wed, 18 Nov 2009 08:42:07 Z2009-11-23T10:59:04Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/5e2f0cf9-7aee-4254-9e16-b046d4340f62http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/5e2f0cf9-7aee-4254-9e16-b046d4340f62punkypogohttp://social.msdn.microsoft.com/Profile/en-US/?user=punkypogoHow to correctly render a video stream with a custom IReferenceClockHi there,<br/> <br/> Still with my custom Renderer filter, I'm now trying to render a video stream which rate has been altered with a custom clock (implementing IReferenceClock).<br/> With my custom clock I can change the rendering speed. It's working fine with a normal graph:<br/> File Source (Async) -&gt; AVI Splitter -&gt; Video decoder -&gt; VMR9<br/> <br/> But I get decoding artefacts with my custom renderer:<br/> File Source (Async) -&gt; AVI Splitter -&gt; Video decoder -&gt; custom renderer<br/> <br/> Currently in my custom filter, in the Send() method, I'm doing a Sleep( 1000.0 / frameRate ). The frameRate value is a fixed one, I read it from a config file.<br/> I guess this is why a get decoding errors when I change the clock rate.<br/> <br/> So how can I know which is the current frameRate of the video stream???<br/> <br/> Cheers.Fri, 20 Nov 2009 09:22:43 Z2009-11-20T13:55:05Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/dc5fb8c4-fd0f-45fb-a5d9-ab008d1f0e56http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/dc5fb8c4-fd0f-45fb-a5d9-ab008d1f0e56Psychic_Puppyhttp://social.msdn.microsoft.com/Profile/en-US/?user=Psychic_PuppyHow can I tell if a container is in AVI format?<p>I have a program that trancodes HD video using the msmpeg4v2 codec.  The output file is arbitrarily named with a .AVI suffix.  How can I tell what the real format of the container is?<br/></p>Thu, 19 Nov 2009 21:30:29 Z2009-11-19T22:28:54Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/c37028b5-9bbf-4797-ace1-f1f11001429fhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/c37028b5-9bbf-4797-ace1-f1f11001429fkenshin1101http://social.msdn.microsoft.com/Profile/en-US/?user=kenshin1101Buffering QuestionHello!<br/> I got some trouble with media streaming.<br/> Currently i got a media file from [PC A] -&gt; send to [server] -&gt; push data to [PC B]<br/> some file like AVI need random access to be play<br/> <br/> I want to buffering the video &amp; audio received when streaming video (like AVI files) <br/> ~5 seconds to prevent the graph from play/stop/play/stop continues <br/> <br/> Is there a way to do that ? or Is there a way to streaming AVI in my way ?<br/><hr class="sig">Nguyễn Nhật DũngWed, 18 Nov 2009 16:26:50 Z2009-11-19T14:46:25Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/777dada7-ce45-47cc-bd5d-046a4d39300dhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/777dada7-ce45-47cc-bd5d-046a4d39300dkjj902http://social.msdn.microsoft.com/Profile/en-US/?user=kjj902Find out PID of H.264 PES from a MPEG2 TS<div class=message-content> <div class=message-date>I am trying using graphedt to build a graph to preview an H.264 camera, but I don't know much details about that camera, so a lot of guess work.</div> <p>I am quite sure it pushes MPEG2 TS, since GraphEdt filter properties dialog shows that the SubType is MPEG2_TRANSPORT. I also think that the TS packet contains nothing but one H.264 Elementary Stream.</p> <p>However, I don't know the PID of the H.264 PES. Is there a way for me to find out the PID?</p> <p>Thank you very much</p> </div>Wed, 18 Nov 2009 18:56:24 Z2009-11-18T20:53:55Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/21c577be-0b37-4494-8922-1e33b2132182http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/21c577be-0b37-4494-8922-1e33b2132182Will Hendriehttp://social.msdn.microsoft.com/Profile/en-US/?user=Will%20HendrieNo Interface registered for DirectShow FilterI am developing a directshow filter. The build is successful but it doesn't produce an .ax file. The build produces an .ax.embed.manifest file and it also produces a .dll file. I registered the .dll file successfully using REGSVR32 . My problem is there is no interface for the registered code in the registry.<br/> LGS  wrote <br/> <br/> &quot;<em>There is no difference between an ax file and a dll file.  It's just a matter of what the developer decides to name it.&quot; </em> in his post:<br/> <br/> <pre>http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/1189badb-11aa-4059-b934-0ea3d9a7c5b9 </pre> <br/> <br/> How do I get the interface? Is there something wrong with the build? Should a registered .dll file include an interface?<br/> Any ideas. All suggestions are appreciated.<br/> Thanks.<br/> WillThu, 12 Nov 2009 16:52:34 Z2009-11-18T19:48:00Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/c0d1e742-baea-4c68-9de0-216a352cb04ahttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/c0d1e742-baea-4c68-9de0-216a352cb04aJohnnyRosehttp://social.msdn.microsoft.com/Profile/en-US/?user=JohnnyRoseGraphedt crashes (Win XP)Hi,<br/><br/>everytime i'm trying to choose a graph-&gt;filters-&gt;video capture sources, <br/>graphedt shuts down abruplty without showing an error message or anything.<br/><br/>I've allready tried several versions, including the last version in the Windows SDK v7.0.<br/><br/>My system runs Windows XP Prof 2002 sp2.<br/><br/>I don't know what to do...<br/><br/>Yours sincerely,<br/>JohnnyWed, 18 Nov 2009 17:43:05 Z2009-11-18T19:17:30Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/d3203877-bca3-4457-9010-00278b4cbfa1http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/d3203877-bca3-4457-9010-00278b4cbfa1lilly_123http://social.msdn.microsoft.com/Profile/en-US/?user=lilly_123Problem with IMediaControl->run()Hi All,<br/>        I created a graph controller code using IGraphBuilder interface.<br/>I added the filters to the filter graph ,connected the filters and the connection works fine<br/>The problem arises when i call the IMediaControl-&gt;run()<br/>It is streaming application wherein I connect the Filesource(Async fitler) -&gt;Demux-&gt;Renderer(Custom filters which streams data packets to the remote packets)<br/><br/>If i call the IMediaControl-&gt;run() the packets are not getting sent.<br/>But it i block the current thread by using <br/>IMediaControl-&gt;run() <br/>while(1)<br/>{<br/>sleep(1000);<br/>}<br/>the packets are getting sent.<br/>How do i handle this.The same works in graph edit without any issue.<br/>How does grapedit handle IMediaControl-&gt;run()<br/>Can anyone help me in this.<br/><br/><br/>Thanks in advance<br/>Tue, 17 Nov 2009 16:13:58 Z2009-11-18T18:11:25Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/58369dd8-6c61-49e6-815c-121c373473fahttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/58369dd8-6c61-49e6-815c-121c373473falilly_123http://social.msdn.microsoft.com/Profile/en-US/?user=lilly_123Value for the error codes in IMediaControlHi,<br/> Can anyone tell me wht is the value for various error codes in IMediaControl like EC_Complete =0 .<br/>Where can i find thoseWed, 18 Nov 2009 07:38:26 Z2009-11-18T15:40:57Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/21abbec5-1cac-47d6-802c-33bd8c7fb801http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/21abbec5-1cac-47d6-802c-33bd8c7fb801Nate4014http://social.msdn.microsoft.com/Profile/en-US/?user=Nate4014Grab video, modify, and then display to screenHi,<br/><br/>I am doing some video processing and I need a way to capture each video frame, modify it and then display it on the screen.<br/>Currently I am using a sample grabber to access the image data. This works well, but after I have copied and modified<br/>the data I am not sure how to render it. I managed to convert the data from a byte array to a bitmap and display it on a <br/>form using wxWidgets, but this was incredibly slow.<br/><br/>Any ideas on a faster way to do this? For example, is there a way to set a byte array as the input to a directShow render filter? Should I consider <br/>looking at directX or GDI? I know that some libraries, such as OpenCV, provide the ability to capture and render images, but I need access to<br/>the IBase pointer of the capture filter, and as far as I know this interface is not exposed by OpenCV.<br/><br/>At this point I am not commited to any particular strategy as long as I can get at the IBase interface, so any suggestions are appreciated.Wed, 18 Nov 2009 07:00:07 Z2009-11-18T07:41:19Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/2ac9f7d4-40f0-471f-b5ef-2b3829904811http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/2ac9f7d4-40f0-471f-b5ef-2b3829904811Gowtham HKhttp://social.msdn.microsoft.com/Profile/en-US/?user=Gowtham%20HKIAMVideoAccelerator::DisplayFrame() blocking call?Hi,<br/> <br/> MSDN says that DisplayFrame() is a blocking function. If that's the case, any stream rate with 'f' fps would play in '(f-d)' fps rate in a single threaded application, where d is time taken for all other activities other than DisplayFrame().<br/> <br/> http://msdn.microsoft.com/en-us/library/dd375998(VS.85).aspx<br/> <br/> Please ans whether my understanding is correct or not.<br/> <br/> If it's a blocking call, can we make it non-blocking call and how?<br/> <br/> Cheers,<br/> GowthamWed, 11 Nov 2009 09:02:49 Z2009-11-18T06:57:18Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/4aa2fc84-d3fa-43a3-b73a-9b53004c00e8http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/4aa2fc84-d3fa-43a3-b73a-9b53004c00e8dragon*http://social.msdn.microsoft.com/Profile/en-US/?user=dragon%uff0aHow can i synchronize sequence bitmap with timeline.I developing screen capture source filter based on directshow. <div><br/></div> <div>But, i had encountered some problems.</div> <div><br/></div> <div><br/></div> <div>It doesn't synchronized bitmap such as captured desktop screen timeline.</div> <div><br/></div> <div><br/></div> <div>I just set AvgTimePerFrame is FPS(ReferenceTime) for VIDEINFO structure on GetMediaType(); method and Capture, write to the buffer and called SetTime Method(); on FillBuffer(); method.</div> <div><br/></div> <div>Like below..</div> <div><br/></div> <div><br/></div> <div>...::GetMediaType()</div> <div>{</div> <div><span style="background-color:#ffffff"><span style="white-space:pre"> </span></span>...</div> <div> <div><span style="white-space:pre"> </span>VIDEOINFO *pvi = (VIDEOINFO *)pMediaType-&gt;AllocFormatBuffer(sizeof(VIDEOINFO));</div> <div><span style="white-space:pre"> </span>if (NULL == pvi) </div> <div><span style="white-space:pre"> </span>return E_OUTOFMEMORY;</div> <div><br/></div> <div><span style="white-space:pre"> </span>ZeroMemory(pvi, sizeof(VIDEOINFO));</div> <div><span style="white-space:pre"><br/></span></div> <div><span style="white-space:pre"> </span>.......</div> <div><br/></div> <div><span style="white-space:pre"> </span>pvi-&gt;AvgTimePerFrame<span style="white-space:pre"> </span>= m_rtFPS;</div> </div> <div><span style="background-color:#ffffff"><span style="white-space:pre"> </span></span>...</div> <div>}</div> <div><br/></div> <div>...::FillBuffer()</div> <div>{</div> <div><span style="background-color:#ffffff"><span style="white-space:pre"> </span></span>...</div> <div><br/></div> <div> <div><span style="white-space:pre"> </span>REFERENCE_TIME rtStart = m_llFrameCount * m_rtFPS;</div> <div><span style="white-space:pre"> </span>REFERENCE_TIME rtStop  = rtStart + m_rtFPS;</div> <div><br/></div> <div><span style="white-space:pre"> </span>pSample-&gt;SetTime(&amp;rtStart, &amp;rtStop);</div> <div><span style="white-space:pre"> </span>m_llFrameCount++;</div> <div><br/></div> <div><span style="white-space:pre"> </span>pSample-&gt;SetSyncPoint(TRUE);</div> <div><span style="white-space:pre"> </span>...</div> <div>}</div> <div><br/></div> <div>But, it doesn't synchronized.. exactly is.. i record 5 seconds. but recorded file running time is more than 5 seconds..(it is not 1~2 seconds difference.)</div> <div><br/></div> <div>what should i do..?</div> <div><br/></div> <div>and Can i setting to period of call FillBuffer() method..?</div> <div><br/></div> <div><br/></div> <div>Please, help me.</div> <div><br/></div> <div>Have a good day.</div> </div>Tue, 17 Nov 2009 04:45:09 Z2009-11-17T08:36:37Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/e8169cf4-98d0-4c94-8d43-f8ddcb3f8b9ahttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/e8169cf4-98d0-4c94-8d43-f8ddcb3f8b9aGlennNZhttp://social.msdn.microsoft.com/Profile/en-US/?user=GlennNZWin 7: can't get VIDEOINFOHEADER or IMediaDet dataI've just realised that Windows 7 is making tough work of getting information out of my connected graphs. The main problem videos are MP4v encoded. The graphs connect fine, but the the VIDEOINFOHEADER is full of zeros and get_FrameRate on an IMediaDet object returns an error.<br/> <br/> Windows XP is fine and Vista was fine; 'was' fine because it's now been upgraded to Windows 7.<br/> <br/> More especifically, AvgTimePerFrame of a VIDEOINFOHEADER is zero and using...<br/> <br/> IMediaDet *pMediaDet = 0;<br/> hr = ::CoCreateInstance(CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER, IID_IMediaDet, (void**)(&amp;pMediaDet));<br/> hr = pMediaDet-&gt;put_Filename(pathPtr);<br/> double frameRate = 0;<br/> hr = pMediaDet-&gt;get_FrameRate(&amp;frameRate);<br/> <br/> will return S_FALSE for get_FrameRate<br/> <br/> <br/> In some ways I'm hoping this is a simple codec issue, but am wondering if it a win 7 specific issue that I'm unaware of. The closest I've come to a possible solution is <a href="http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/7490cfe2-0bf5-4a5a-be8a-b371fe56a3e6">this thread</a> but I've noticed that if I render the video in Graph Studio, then its VIDEOINFOHEADER2 information is also full of zeros. (It plays though)<br/> <br/> <br/> For what it's worth, I'm installed ffdshow, the Haali Media Splitter and DivX.<br/> <br/> Does anyone have some ideas, thanks.Thu, 12 Nov 2009 23:08:01 Z2009-11-17T04:59:03Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/c0908d39-10ee-49e8-b83a-fd3a2deb27a3http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/c0908d39-10ee-49e8-b83a-fd3a2deb27a3firozn khanhttp://social.msdn.microsoft.com/Profile/en-US/?user=firozn%20khanApply hue/saturation/contrast to video How can i apply hue/saturation/contrast to running video. i am display video using custom allocator on my device.Mon, 16 Nov 2009 11:22:36 Z2009-11-16T15:18:01Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/90674448-8d8b-4b7c-be0b-8a3d4b531e81http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/90674448-8d8b-4b7c-be0b-8a3d4b531e81joginder1http://social.msdn.microsoft.com/Profile/en-US/?user=joginder1Executable: iexplorer.exe Pid 1078 Tid 274. Module filter.ax,4 object left actice at line 317 of .\\dllentry.cpp<p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:12pt;color:black;line-height:115%;font-family:'Verdana','sans-serif'">I have registered my filter into &quot;Video Capture Sources&quot; Catagery bcz it Capture data form the Ip Camera,which I am publishing using Adobe Media Server.But when I test my Filter with Graph edit, it works fine ,But when it get call from .SWF file (to Publish at Adobe Media Server). My CreateInstance(LPUNKNOWN lpunk, HRESULT *phr) function get called 4 times. And when I close the the application it gives me error ie “Executable: iexplorer.exe Pid 1078 Tid 274. Module filter.ax,4 object left actice at line 317 of .\\dllentry.cpp” </span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:12pt;color:black;line-height:115%;font-family:'Verdana','sans-serif'">Please suggest where I am doing worng</span></p> <p class=MsoNormal style="margin:0cm 0cm 10pt"><span style="font-size:12pt;color:black;line-height:115%;font-family:'Verdana','sans-serif'">Thanks in advance</span><span style="font-size:small"><span style="font-family:Calibri"> <span style="font-size:12pt;color:black;line-height:115%;font-family:'Verdana','sans-serif'"></span></span></span></p>Sun, 15 Nov 2009 08:34:44 Z2009-11-16T15:18:45Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/dd661922-14d1-4d59-a9ff-229f854b4de5http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/dd661922-14d1-4d59-a9ff-229f854b4de5AdemarUhttp://social.msdn.microsoft.com/Profile/en-US/?user=AdemarUProblem with DES SetSmartRecompressFormatHi!<br/> <br/> I´m trying to use SmartRecompression in a timeline to cut two pieces<br/> of two files.<br/> for know, I´m using the timeline test sample in directshow c++, and<br/> just made some chanches to use smartrecompress.<br/> <br/> All work fine till the part that a make ConnectFrontEndm if I use<br/> smartrecompress the program abort, with the message:<br/> <br/> &quot;Windows has triggered a breakpoint in timelinetest.exe.<br/> This may be due to a corruption of the heap, which indicates a bug in<br/> timelinetest.exe or any of the DLLs it has loaded.<br/> This may also be due to the user pressing F12 while timelinetest.exe<br/> has focus.<br/> The output window may have more diagnostic information.&quot;<br/> <br/> in the output window just says: &quot;HEAP[timelinetest.exe]: Heap block at<br/> 0029D2C8 modified at 0029D4C4 past requested size of 1f4&quot;<br/> <br/> Samething if I use SetRecompFormatFromSource<br/> <br/> those somebody have a example code using SmartRecompress and<br/> SmartRender?!<br/> <br/> Thanks!Mon, 16 Nov 2009 11:43:11 Z2009-11-16T11:43:11Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/fdd18c23-c40b-42e3-a0e1-9b69bfda5117http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/fdd18c23-c40b-42e3-a0e1-9b69bfda5117Mister-Zorghttp://social.msdn.microsoft.com/Profile/en-US/?user=Mister-Zorgcatch an unhandled exception in sampleCBHello,<br/> <br/> I use MFC and C++.<br/> My graph looks like that: capture filter-&gt;sample grabber-&gt;renderer.<br/> I would like to catch an unhandled exception in the sampleCB.<br/> <br/> <br/> I do some image processing in the sampleCB function. By changing some value of (global) variable in the sampleCB through the dialog, some times unhandled exception (Acess violation writing location 0x056c173e) appears.<br/> I tried to catch the error with try{} and catch(...) but that doesn´t help. Why? I thought try{} and ctch{} will help in any case.<br/> Is there any chance to catch the error before it stops the whole appliction?<br/> I could stop the graph during the value change, but as the error appears very rarely, I prefere to keep it running! The reason is the effect on the screen is better while the graph is running.<br/> What options do I have?<br/> <br/> thanks<br/>Mon, 16 Nov 2009 00:34:23 Z2009-11-16T14:26:35Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/29e1f6d6-0219-4a11-8982-4280fa5aac26http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/29e1f6d6-0219-4a11-8982-4280fa5aac26Carl_Lhttp://social.msdn.microsoft.com/Profile/en-US/?user=Carl_LStreamBufferSource in Windows 7 crashesHi <div><br /></div> <div>I am building an application that is using the Stream Buffer Engine. I am currently on Windows 7 RTM x86, and the application was working fine on XP. My sink graph works fine, but whenever I try to play the dvr-ms file using either WMP or my own graph it crashes. I can play the file in VLC. Has anyone else had problems using the Stream Buffer Engine in Win7?</div>Mon, 05 Oct 2009 10:33:47 Z2009-11-16T01:22:32Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/6990d7c7-b47c-42c5-824b-75973d077bfdhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/6990d7c7-b47c-42c5-824b-75973d077bfdlilly_123http://social.msdn.microsoft.com/Profile/en-US/?user=lilly_123Problem while loading filename into IFileSourceFilter->load() during runtime<div>int len = strlen((char*)filename);//filename is Sample.mp4</div> <div><br/></div> <div>//i wanted to direct this to c:\\ since the SAmple.mp4 is present in c:\\</div> <div>char *a=NULL;</div> <div>int n=len+5;//so i am taking a character array of size length of the file name + directory path.Since file name will be know at runtime only</div> <div><br/></div> <div>a=new char[n];</div> <div>strcpy(a,&quot;c:\\&quot;);</div> <div>strcat(a,&quot;\\&quot;);</div> <div>strcat(a, &quot;Sample.mp4&quot;);</div> <div><br/></div> <div>hr = pAsyncReader-&gt;Load((LPCOLESTR)a ,NULL); </div> <div><br/></div> <div>The above line fails ..Am I doing anything wrong here.However the below line works fine</div> <div><br/></div> <div>hr = pAsyncReader-&gt;Load(L&quot;c:\\Sample.mp4&quot;,NULL); </div> <div><br/></div>Sun, 15 Nov 2009 03:08:30 Z2009-11-16T15:16:50Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/f77cf22a-8fcc-4e12-b291-2202bd6f55b6http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/f77cf22a-8fcc-4e12-b291-2202bd6f55b6mynameisnotcarloshttp://social.msdn.microsoft.com/Profile/en-US/?user=mynameisnotcarlosHow to setup CSourceStream::GetMediaType for MPEG2-PS?Hi everyone,<br/><br/>can someone tell me or link me to some information on how to check what is necessary to setup the media type for a MPEG2-PS?<br/>I thought about only setting the major- and subtype (MEDIATTYPE_Stream, MEDIASUBTYPE_MPEG2_PROGRAM) but leave everything else in their initialization status. So there wouldn't be any info about the format nor would I allocate any buffer for the format. Would that even work? Oh, of course I would have to set the sample size, buffer size in allocator. How big would that be in my case? Does it depend on the content of the program stream?<br/><br/>What I'm basicly up to is to write an UDP source filter which receives a network stream as an mpeg2 ps. All I want to do is to forward my received data downstream to the demux / mpeg splitter.<br/><br/>I hope you could follow me, otherwise I'll try to be more pricise if something's not clear.<br/><br/>Thank you!Thu, 05 Nov 2009 16:43:39 Z2009-11-14T18:19:18Z