Sends frames to a OBS Virtual Camera from .NET
Step 1: Install libyuv
.\vcpkg install libyuv
Bitmap image = new Bitmap(640, 480);
Random rnd = new Random();
VirtualOutput virtualOutput = new VirtualOutput(image.Width, image.Height, 20, FourCC.FOURCC_24BG);
ImageConverter converter = new ImageConverter();
while (true)
{
for (var x = 0; x < image.Width; x++)
{
for (var y = 0; y < image.Height; y++)
{
Color randomColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256));
image.SetPixel(x, y, randomColor);
}
}
byte[] imageBytes = (byte[])converter.ConvertTo(image, typeof(byte[]));
virtualOutput.Send(imageBytes);
}
For more examples check out the Examples folder