Skip to content

Desuq Cafe

Documentation menu

Inputs & Media

Inputs are OBS’s sources (browser sources, text, media, capture devices, and so on). This guide covers creating and managing inputs, controlling media playback, editing input settings, and working with hardware capture-device properties.

Input Management (CRUD)

FunctionDescription
CreateInput(Scene, Name, Kind, Settings, Enabled)Create new input and add to scene
CreateInputFromString(Scene, Name, Kind, JsonSettings, Enabled)Blueprint-friendly version
RemoveInput(Name)Remove input (must not be in any scene!)
SetInputName(Name, NewName)Rename an input
GetInputKindList(bUnversioned)Fetch available input kinds (source types)
GetCachedInputKinds()Get locally cached input kinds

Common Input Kinds

KindDescription
browser_sourceWeb browser
text_gdiplus_v3Text (GDI+, Windows)
text_ft2_source_v2Text (FreeType2)
ffmpeg_sourceMedia Source
image_sourceImage
color_source_v3Solid Color
vlc_sourceVLC Video
window_captureWindow Capture
game_captureGame Capture
dshow_inputVideo Capture Device
wasapi_input_captureAudio Input
wasapi_output_captureAudio Output Capture

Notes:

  • CreateInput atomically creates the input and adds it to the specified scene.
  • RemoveInput will fail if the input is still referenced by any scene. Remove all scene items first.
  • Input names must be globally unique in OBS.
  • Use GetInputKindList(true) for unversioned names (simpler, recommended).

Media Playback

FunctionDescription
PlayMedia(Name)Start playback
PauseMedia(Name)Pause playback
StopMedia(Name)Stop playback
RestartMedia(Name)Restart from beginning
NextMedia(Name)Go to next item in playlist
PreviousMedia(Name)Go to previous item in playlist
SetMediaInputCursor(Name, Ms)Seek to position in milliseconds
OffsetMediaInputCursor(Name, OffsetMs)Seek relative to current position
SeekToPercent(Name, Percent)Seek to percentage of duration (0.0 to 1.0)
GetMediaInputStatus(Name)Fetch media status (state, duration, cursor)
GetCachedMediaInputStatus(Name)Get locally cached media status

Media Events

  • OnMediaInputPlaybackStarted(InputName): Media started playing
  • OnMediaInputPlaybackEnded(InputName): Media finished playing
  • OnMediaInputActionTriggered(InputName, Action): Media action was triggered
  • OnMediaInputStatusReceived(Status): Media status was fetched

Input Settings

FunctionDescription
GetInputSettings(Name)Fetch current settings for an input (async)
GetInputSettingsByUuid(Uuid)Fetch settings by input UUID
SetInputSettings(Name, Settings, Overlay)Set input settings (JSON object)
SetInputSettingsFromString(Name, JsonStr, Overlay)Set input settings (JSON string)
GetInputDefaultSettings(Kind)Get default settings for an input type
SetTextSourceText(Name, Text)Set text content for text sources
SetBrowserSourceUrl(Name, Url)Set URL for browser sources
SetImageSourceFile(Name, Path)Set file path for image sources
SetMediaSourceFile(Name, Path, Loop)Set file path for media sources
SetColorSourceColor(Name, Color)Set color (ABGR int64 format)
GetCachedInputSettings(Name)Get locally cached settings (JSON object)
GetCachedInputSettingsString(Name)Get locally cached settings (JSON string)
HasCachedSettings(Name)Check if settings are cached for an input

Supported Input Types

Input KindConvenience MethodSettings Key
text_gdiplus_v3SetTextSourceText()text
text_ft2_source_v2SetTextSourceText()text
browser_sourceSetBrowserSourceUrl()url
image_sourceSetImageSourceFile()file
ffmpeg_sourceSetMediaSourceFile()local_file, looping
color_source_v3SetColorSourceColor()color (ABGR)

Note: Use bOverlay=true (default) to merge with existing settings, or false to replace all settings.

Device Properties (Capture Devices)

For inputs backed by hardware (capture cards, webcams, audio devices), the InputSettings handler can enumerate a device-list property’s options and “press” a properties button. These are reached via GetClient()->GetInputSettings():

FunctionDescription
GetInputPropertiesListPropertyItems(Input, Property)Enumerate a list property’s items (e.g. video_device_id). Async: fires OnInputPropertyItemsReceived with FOBSPropertyItems
PressInputPropertiesButton(Input, Property)”Press” a properties button (e.g. an activate/refresh button), handy to recover a stalled capture device

Useful for building an in-engine device picker, or re-activating a capture device that dropped.

// Enumerate the available cameras for a video capture device input.
Subsystem->GetClient()->GetInputSettings()
    ->GetInputPropertiesListPropertyItems(TEXT("Webcam"), TEXT("video_device_id"));

// Re-activate a stalled capture device.
Subsystem->GetClient()->GetInputSettings()
    ->PressInputPropertiesButton(TEXT("Webcam"), TEXT("activate"));

See also