Pawan
Pawan

Reputation: 1523

How to add extra data frames into VNC communication?

Does anyone knows how to add extra data frame along with video frames in vnc communication. Both client and server will be handled by me. And also how to do encode and decode that extra data frame at both the sides.

Any help would be appreciated.

Upvotes: 1

Views: 401

Answers (2)

kanaka
kanaka

Reputation: 73119

The best reference I've found on the RFB (VNC) protocol is: http://tigervnc.org/cgi-bin/rfbproto

You have a couple of general directions.

If you don't mind extending the protocol, then you can just add new message types to your protocol (since you control both ends). See the clientcuttext and servercuttext as examples of existing messages for sending an arbitrary amount of data in either direction. The disadvantage is that if your client or server is connected to be a different client or server then this will cause a fatal error.

Another option is to extend an existing message in a backwards compatible way. For example, you could send client to server message by sending mouse events that are outside the viewport (and then sending a final mouse event that is back inside at the real location). You could send server to client messages by sending frame buffer updates that are outside the viewport. That won't be displayed by normal clients.

Upvotes: 0

apscience
apscience

Reputation: 7253

Use 'watermark's. You can set every Xth frame to have data. Every pixel would be used to store a bit of data. Record every pixel at every X-1th frame, and for every Xth frame ignore any actual change in the server's video feed but if you want the bit to be 1, make that pixel darker, and if you want it to be 0, keep the pixel the same. On a 1024 by 768 pixel display, you can potentially store 786kb of data every X frames with this method. Make sure to not compress the stream for the frames that will store data, through.

If you don't need 786kb, only do it for the top half of the screen, you'll save some bandwidth, and you'll get half of 786kb to use as data.

You should be able to implement most if not all encryption fine. You can do lots of obfuscation too. Maybe every 3rd bit is random and useless. Maybe if the 1st bit is 1, flip everything. Etc etc.

Upvotes: 1

Related Questions