Mostly because the API itself belongs to ancient times when segmenting long recordings was not the most important feature, doing segmented writing with DirectShow is not easy. It is impossible with standard API provided by OS, and requires some effort with third party filters and/or development.
The fundamental problem you have are that media pipeline does not allow state transition of parts: you cannot have webcam active while written file is closed, finalized, reopened and segmented.
So you have to address the challenge in one of the two ways:
- You can replace multiplexer and writer filters with custom filter that segment recording internally, and finalize the current file starting new one without losing a frame.
As you are doing C# development, this option basically suggests that you possibly find ready to use third party filter that implement the necessary functionality.
You can build a two-graph design with one graph having webcam capture and optionally compression, then the other one having compression is the first one does not have it and actual recording into file. Then data is transferred between the graphs and when it comes to segmenting you stop second graph finalizing the file, then start new file there, and the first graph is always running without interruption supplying new video frames. The glue layer that connects to graphs can be custom developed or you can check out GMFBridge filters which are popular and are used by quite some users.
To my best knowledge you can use GMFBridge to build two-graph topologies with segmenting of output files, even though it might require that you check the source code to find out how the filters are consumed correctly and what it takes to make them work in this scenario of live video capture.