Link Search Menu Expand Document

VideoSurface

A surface that allocates a video media track to use as texture Send frames like this

app:scheduleAction(0.02, true, function()
  if surface and surface.trackId then
    app.client.client:send_video(surface.trackId, pixeldata, width, height, [format=rgba8], [stride=width])
  end
end)

Methods

VideoSurface:setResolution (width, height)

Set the resolution of the video. This needs to match the width and height sent to sendFrame

Arguments

Name Type Description
width ???  
height ???  

Returns

Nothing


VideoSurface:sendFrame (string, width, height, format, stride)

Send a video frame to the server

Arguments

Name Type Description
string pixels String with pixel data according to format and stride
width int The number of pixels in width. Should match resolution width.
height int The number of pixels in height. Shold match resolution height.
format string The pixel format. For example “bgrx8”. Default: “rgba”
stride int The number of bytes for each row of pixels. Default: width*bpp

Returns

Nothing