You will need to look in the DirectShow SDK.
H.264 coding directly is not possible, however there are commercial activex controls that can help you. But you need to understand a few things
DirectShow is an audio / video processing system, and you can use the graph editing tool to place your devices on a graph and test it. And you should write a similar code to build a graph, a graph is a chain of devices / objects that interact with each other to get the final result.
DirectShow can be used in .NET, you can use the GraphEditPlus tool to create a graph and use it in .NET. However, I doubt that .NET is better because it can lead to unknown errors, since DirectShow is closely related to COM. If you create an ActiveX control in native C ++ and use DirectShow for full recording, and you use ActiveX in WPF, it will be more stable, although it is difficult to program.
You will usually need a graph as follows:
Video Source => Demux -> Audio Stream + Video Stream -> MP4Muxer
x264 is free open source and has good MP4Muxer, but not legal, you must have patent licenses purchased to use H264 in your code.
Alternatives - you can go with a lot of commercial controls, Intel IPP is the best implementation of H264 so far, but it is a bit difficult to do live.
source share