I\'m trying to stream the desktop(DirectX surface in NV12 format) as H264 video over RTP stream using Live555 & Windows media foundation\'s hardware encoder on Windows10
Soonts give you all necessary things to solve your problem.
The first thing you need to do, is format conversion between DXGI_FORMAT_B8G8R8A8_UNORM and MFVideoFormat_NV12 :
format conversion information
I think it's better to use shader to do format conversion, because all textures will stay in GPU (better for performance).
It's the first step you need to do. You will have others to improve your program.