You can now live-stream chroma-keyed video from OBS Studio to Unreal Engine meaning you can take advantage of the easy keyer in OBS for your Unreal Projects.
This works both in-Editor and at-Runtime and in packaged games!
You need three different plugins to use the full range of possibilities:
- The Spout plugin for OBS Studio (for zero-latency streaming on a single machine). Installation guide here.
- The NDI plugin for OBS Studio (for streaming between different machines). Installation guide here.
- The Live-Streaming Toolkit for Unreal Engine (for streaming Spout and NDI into and out of Unreal). Installation guide here.
- In Unreal, go to Edit>Project Settings, search 'Alpha' and select the 'Allow through Tonemapper' option:
- Now in OBS, select the Source that you want to chromakey and click 'Filters':
- In the pop-up window, click the '+' at the bottom left corner to add Filters to the Source. Add a Chromakey filter to remove the background and a Spout or NDI filter to create a sender for the Source to Unreal Engine:
- Adjust any settings required in your Chromakey filter:
- Name your Spout or NDI filter so that you can find it in Unreal Engine:
- Now follow the steps here to set up your input feed in Unreal Engine.
- Once you have followed those steps to set up your Material from your Render Target in Unreal, double click on it and in it's Details panel change the 'Blend Mode' to 'AlphaComposite'.
- In the main canvas of your Material connect the 'Alpha' node to 'Opacity':
- Now you can apply your Material from your Render Target onto a Plane or anywhere else in your Unreal level and it will automatically be chromakeyed:
- The Unreal anti-aliasing settings can interfere with video feeds. If this is an issue you can try changing to FXAA in Project Settings, using DLSS (which takes the place of Anti-Aliasing) or using Composure (which avoids anti-aliasing):