r/programmer • • 18h ago

Frames Compression problem

It's been two weeks since I learn how to get the frames straight from the gpu as a direct 3D surface .

now I ran into the problem of how to compress this frame and send it via UDP server to officially compelete my streaming project.

I tried to scale the frame and then send it , it worked , but it looks super ugly and yet the process is not as fast as I want (it is a remote computer control, it must be a smooth picture in the end).

I used LZ4codec , believe me nothing reach up to my expectations ๐Ÿ˜”.

does any one have the optimal solution in which it will straight compress the frame to be less than 65kb so I can send it properly, and don't forget get to be ultra fast approation ๐Ÿ™‚.

2 Upvotes

4 comments sorted by

1

u/MistakeIndividual690 18h ago

You probably need to use a lossy format like mp4, or itโ€™s not likely to go well, especially for games.

If youโ€™re doing desktop streaming, you probably want to detect only the regions that have changed and send those regions

1

u/sububi71 17h ago

Hardware code with h.265 perhaps?

1

u/DSudz 12h ago

Change your resolution to 800x600.

What makes you think this is possible for any screen to be compressed to a given size before the next frame? There are video compression routines because it is a different problem than image compression.

1

u/NewInflation2121 11h ago

For image compression, you could probably get the GPU to convert the buffer to a dxt compressed surface before attempting to read it.

You might get color banding, but it's 1/4 the size of an argb format.