The problem was with NVidia drivers. The following code snippet caused the error:
VMR9NormalizedRect r1 = new VMR9NormalizedRect(0, 0, 0.5f, 1);
VMR9NormalizedRect r2 = new VMR9NormalizedRect(0.5f, 0, 1, 1);
hr = (HRESULT)mix.SetOutputRect(0, ref r1);
hr = (HRESULT)mix.SetOutputRect(1, ref r2);
If a VMR9NormalizedRect gets initialized with any parameters apart from 0, 0, 1, 1 it will only display a black screen. The code runs perfect on any ATI card I tried.
It seems like that NVidia couldn't fix this error since 2006: https://forums.geforce.com/default/topic/358347/.