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
| Function | Description |
|---|---|
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:
| Function | Description |
|---|---|
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
| Format | Type | Quality Setting |
|---|---|---|
png | Lossless | Ignored |
jpg | Lossy | 0 to 100 |
webp | Lossy | 0 to 100 |
bmp | Lossless | Ignored |
Sequencer Integration
| Action | Description |
|---|---|
SaveSourceScreenshot | Save 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).
SaveSourceScreenshotsaves 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);