Skip to content

Desuq Cafe

Documentation menu

Screenshots

Capture a screenshot of any OBS source (a scene or an input) either to base64 image data in memory (which you can convert into a UTexture2D for use in Unreal) or directly to a file on the OBS machine’s filesystem.

Functions

FunctionDescription
GetSourceScreenshot(Name, Format)Capture screenshot to base64 memory
GetSourceScreenshotByUuid(Uuid, Format)Capture by source UUID
GetSourceScreenshotScaled(Name, Format, W, H, Quality)Capture with scaling options
GetSourceScreenshotWithOptions(Request)Full control via request struct
SaveSourceScreenshot(Name, Path, Format)Save screenshot directly to OBS machine filesystem
SaveSourceScreenshotByUuid(Uuid, Path, Format)Save by source UUID
SaveSourceScreenshotScaled(Name, Path, Format, W, H, Quality)Save with scaling options
SaveSourceScreenshotWithOptions(Request)Full control via request struct
GetLastScreenshotResult()Get last captured screenshot result
GetLastSavedResult()Get last saved screenshot result
IsCapturePending()Check if capture is in progress

Static Texture Utilities

Convert captured base64 image data into an Unreal texture for display in-engine:

FunctionDescription
CreateTextureFromBase64(Base64Data)Convert base64 image to UTexture2D
CreateTextureFromScreenshotResult(Result)Convert screenshot result to texture
DecodeBase64ImageData(Base64, OutBytes, OutFormat)Decode base64 to raw bytes
CreateTextureFromBytes(ImageBytes)Create texture from raw image data

Image Formats

FormatTypeQuality Setting
pngLosslessIgnored
jpgLossy0 to 100
webpLossy0 to 100
bmpLosslessIgnored

Sequencer Integration

ActionDescription
SaveSourceScreenshotSave screenshot at a specific timeline moment (requires TargetName + FilePath)

See Sequencer for more on timeline-driven OBS actions.

Events

Screenshot events are handler-level. The Component binds them directly. If you are using the Subsystem alone, access them via GetClient()->GetScreenshots().

  • OnScreenshotCaptured(Result): Screenshot captured to memory (contains base64 data)
  • OnScreenshotSaved(SourceName, FilePath): Screenshot saved to file on the OBS machine

Notes

  • Screenshots work on both scenes and inputs (any OBS source).
  • SaveSourceScreenshot saves to the OBS machine’s filesystem, not the UE client.
  • Use GetSourceScreenshot + a local save if you need the file on the UE machine.
  • Base64 data can be very large for high-resolution images, so consider using scaled captures for previews.
  • WebP format is supported by OBS, but texture conversion only supports PNG, JPEG, and BMP.

Example

// Capture the current program scene and turn it into a texture.
Subsystem->GetSourceScreenshotScaled(TEXT("Gameplay"), TEXT("png"), 640, 360, -1);

// In your OnScreenshotCaptured handler:
UTexture2D* Texture =
    UInhyeongOBSSubsystem::CreateTextureFromScreenshotResult(Result);

See also