Need help with video streaming system

I made a system which streams video from a server I made in Python. The way it works is by essentially making a Lua table of all the RGB values in a frame, which is then retrieved via HTTPService and converted into a table instance via loadstring.

The Roblox server instance will then store a certain amount of these frames in memory and play them. While they’re being played, more frames are downloaded and the cycle continues. This system sounds good on paper, but the frames take so long to retrieve that it often “runs out” of frames and has to buffer. Right now it takes roughly a minute to load 200 frames, resulting in a blazing speed of roughly 3.33 frames per second to ensure that no buffering occurs.

How can I make this process faster? Should I change my video format into something more compact? Right now it looks something like this: “{{182, 180, 194}, {184, 183, 197}… }” (Each sub-array represents the color of one pixel). I understand this is most likely not the best way to do this, but I can’t think of an alternative. Any help would be appreciated

You can encode a rgb value into a simple integer, lowering data needed from 3 things in a table or tuple to one number in the interval of [0,16777216]

def rgbToNum(r,g,b):
    return (65536*r)+(256*g)+b
2 Likes

This helped! Frames download a little quicker now. Thank you :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.