VideoFrame playback is extremely expensive to run for CPU

I was analyzing the performance of a game that makes use of videoframes and found that it took 6 milliseconds of CPU time every frame to play back a video. For some perspective, a game running at 60fps must have a CPU time of 16.66ms or under, so 6ms is basically accounting for 20fps. If you have a game that hovers at 60fps with little overhead, inserting a single videoframe could mean that you would drop performance to 40fps on said machine.

If VideoFrames are this expensive to run, I can’t imagine it being practical for many popular games that must support weak CPUs of mid-range laptops and mobile devices.

I suspect this is caused by some expensive decompression process that Roblox runs on the client. If this is the case, I would suggest running the decompression on the server and sending uncompressed (or minimally compressed) video to the client to significantly reduce CPU costs. This would come at the expense of more bandwidth, but preloading videos is a thing.

5 Likes

Is this a question? Or a PSA to not use VideoFrames? I’m not sure what your intention is.

VideoFrame is in development,but available. Thats why its not playing longer than 10s, because it eats your CPU

More of a PSA, also hoping to hear any experiences yall have had with VideoFrames so far.

1 Like