FVideoEncoder::CopyTexture

To account for how webrtc works (for PixelStreaming), encoding a frame is a two step process.

Windows
MacOS
Linux

References

Module

AVEncoder

Header

/Engine/Source/Runtime/AVEncoder/Public/AVEncoder.h

Include

#include "AVEncoder.h"

Syntax

bool CopyTexture
(
    FTexture2DRHIRef Texture,
    FTimespan CaptureTs,
    FTimespan Duration,
    FBufferId & OutBufferId,
    FIntPoint Resolution
)

Remarks

To account for how webrtc works (for PixelStreaming), encoding a frame is a two step process. 1st - CopyTexture initiates a copy if the texture to the internal buffers, and returns an Id the caller can use to reference that internal buffer. 2nd - Either a Drop or Encode is required for each CopyTexture call, otherwise the respective internal buffer will stay

Parameters

Parameter

Description

Texture

Texture to copy

CaptureTs

Capture timestamp

Duration

Delta time from the previous frame

OutBufferId

Buffer id on return

Resolution

If {0,0}, the copy will be the same size as the passed texture. If not {0,0}, it will use that specified resolution marked as used.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss