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.

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