UMediaCapture

Abstract base class for media capture.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

MediaIOCore

Header

/Engine/Plugins/Media/MediaIOFramework/Source/MediaIOCore/Public/MediaCapture.h

Include

#include "MediaCapture.h"

Syntax

UCLASS (Abstract, EditInlineNew, BlueprintType, HideCategories=(Object))
class UMediaCapture : public UObject

Remarks

Abstract base class for media capture.

MediaCapture capture the texture of the Render target or the SceneViewport and sends it to an external media device. MediaCapture should be created by a MediaOutput.

Variables

Name Description

Protected variable UProperty Transient

UMediaOutput &#...

 

MediaOutput

Public variable UProperty Category BlueprintAssignable

FMediaCaptureSt ...

 

OnStateChanged

Called when the state of the capture changed.

Public variable

FMediaCaptureSt ...

 

OnStateChangedNative

Called when the state of the capture changed.

Constructors

Name Description

Public function

UMediaCapture

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Public function UFunction BlueprintCallable, Category

bool

 

CaptureActiveSceneViewport

(
    FMediaCaptureOptions CaptureOptions
)

Stop the current capture if there is one.

Protected function Virtual

bool

 

CaptureRenderTargetImpl

(
    UTextureRenderTarget2D * InRend...
)

Public function

bool

 

CaptureSceneViewport

(
    TSharedPtr < FSceneViewport >& Scen...,
    FMediaCaptureOptions CaptureOptions
)

Stop the actual capture if there is one.

Protected function Virtual

bool

 

CaptureSceneViewportImpl

(
    TSharedPtr < FSceneViewport >& InSc...
)

Public function UFunction BlueprintCallable, Category

bool

 

CaptureTextureRenderTarget2D

(
    UTextureRenderTarget2D * Render...,
    FMediaCaptureOptions CaptureOptions
)

Stop the actual capture if there is one.

Protected function Virtual

TSharedPtr < ...

 

GetCaptureFrameUserData_GameThread()

Capture the data that will pass along to the callback.

Protected function

TSharedPtr < ...

 

GetCapturingSceneViewport()

Protected function Const

EMediaCaptur ...

 

GetConversionOperation()

Protected function Virtual Const

EPixelFormat

 

GetCustomOutputPixelFormat

(
    const EPixelFormat & InPixelFormat
)

Get the pixel format of the buffer when the conversion operation is custom.

Protected function Virtual Const

FIntPoint

 

GetCustomOutputSize

(
    const FIntPoint & InSize
)

Get the size of the buffer when the conversion operation is custom.

Public function Const UFunction BlueprintCallable, Category

EPixelFormat

 

GetDesiredPixelFormat()

Get the desired pixel format of the current capture.

Public function Const UFunction BlueprintCallable, Category

FIntPoint

 

GetDesiredSize()

Get the desired size of the current capture.

Public function Virtual Const UFunction BlueprintCallable, Category

EMediaCaptur ...

 

GetState()

Get the current state of the capture.

Protected function

UTextureRend ...

 

GetTextureRenderTarget()

Public function Virtual Const

bool

 

HasFinishedProcessing()

Check whether this capture has any processing left to do.

Protected function Virtual

void

 

OnCustomCapture_RenderingThread

(
    FRHICommandListImmediate & RHICmdLi...,
    const FCaptureBaseData & InBaseData,
    TSharedPtr < FMediaCaptureUserData , ...,
    FTexture2DRHIRef InSourceTexture,
    FTextureRHIRef TargetableTexture,
    FResolveParams & ResolveParams,
    FVector2D CropU,
    FVector2D CropV
)

Callback when the buffer is ready to be copied on the GPU.

Protected function Virtual

void

 

OnFrameCaptured_RenderingThread

(
    const FCaptureBaseData & InBaseData,
    TSharedPtr < FMediaCaptureUserData , ...,
    void * InBuffer,
    int32 Width,
    int32 Height
)

Callback when the buffer was successfully copied to CPU ram.

Protected function Virtual

void

 

OnRHITextureCaptured_RenderingThread

(
    const FCaptureBaseData & InBaseData,
    TSharedPtr < FMediaCaptureUserData , ...,
    FTextureRHIRef InTexture
)

Callback when the buffer was successfully copied on the GPU ram.

Public function UFunction BlueprintCallable, Category

void

 

SetMediaOutput

(
    UMediaOutput * InMediaOutput
)

Set the media output. Can only be set when the capture is stopped.

Protected function

void

 

SetState

(
    EMediaCaptureState InNewState
)

Protected function Virtual Const

bool

 

ShouldCaptureRHITexture()

Should we call OnFrameCaptured_RenderingThread() with a RHI Texture or copy the memory to CPU ram and call OnFrameCaptured_RenderingThread() .

Public function UFunction BlueprintCallable, Category

void

 

StopCapture

(
    bool bAllowPendingFrameToBeProcess
)

Stop the previous requested capture.

Protected function Virtual

void

 

StopCaptureImpl

(
    bool bAllowPendingFrameToBeProcess
)

Protected function Virtual

bool

 

UpdateRenderTargetImpl

(
    UTextureRenderTarget2D * InRend...
)

Public function

bool

 

UpdateSceneViewport

(
    TSharedPtr < FSceneViewport >& Scen...
)

Update the current capture with a SceneViewport.

Protected function Virtual

bool

 

UpdateSceneViewportImpl

(
    TSharedPtr < FSceneViewport >& InSc...
)

Public function UFunction BlueprintCallable, Category

bool

 

UpdateTextureRenderTarget2D

(
    UTextureRenderTarget2D * Render...
)

Update the current capture with every frame for a TextureRenderTarget2D.

Protected function Virtual Const

bool

 

ValidateMediaOutput()

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

FString

 

GetDesc()

Return a one line description of an object for viewing in the thumbnail view of the generic browser

Classes

Name

Description

Protected struct

FCaptureBaseData

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback