obs_scene_item_add
Add an existing source into a scene as a new scene item, reusing one camera or overlay across multiple scenes. New item lands on top of the z-order, so check the returned index.
Instructions
Add an EXISTING source to a scene, as a new scene item. This is the missing half of obs_create_input: that one makes a brand new source, this one places a source you already have into another scene. Reusing a source is almost always what you want - one camera placed in six scenes is one device opened once, while six separate inputs on the same webcam will fight over the device and most will fail to start.
A scene can be added to another scene this way, which is how layer scenes work: on the reference machine the HUD scene holds every overlay and is added as a SINGLE item into each scene, so editing HUD once changes all of them. Do not rebuild overlays per scene.
The new item lands at the TOP of the z-order and covers whatever it overlaps. If you are adding a background it has to be moved down to index 0 afterwards with obs_scene_item_order. The response reports the index it actually received, so check it rather than assuming.
sceneItemEnabled defaults to true. Note that a source can be enabled but sitting off-canvas: see obs_scene_item_transform for why that is not the same as hidden.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enabled | No | Start visible. Default true. | |
| sceneName | Yes | Scene to add the source to. | |
| sourceName | Yes | Name of an existing input or scene (obs_list_inputs / obs_list_scenes). |