Video Port Pins in File Capture
[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
If the capture device has a video port, the video port pin must be connected to a video renderer, even if you only want to capture to a file.
If you call ICaptureGraphBuilder2::RenderStream with the value PIN_CATEGORY_CAPTURE and the device has a video port pin, the Capture Graph Builder automatically connects the video port pin to the Overlay Mixer filter and connects the Overlay Mixer to the Video Renderer. The Capture Graph Builder hides the video window by calling IVideoWindow::put_AutoShow with the value OAFALSE. If the application later calls RenderStream with PIN_CATEGORY_PREVIEW, the Capture Graph Builder calls put_AutoShow with the value OATRUE, in order to show the video window.
After you call RenderStream with PIN_CATEGORY_CAPTURE, you can check whether it has added the Video Renderer by querying the Filter Graph Manager for the IVideoWindow interface.
Related topics