IOS gamekit / bluetooth data stream

I have a written program using gamekit / bluetooth to transfer low quality video using compressed jpegs from one iOS device to another. I already understand that for this purpose you can’t use geyket / bluetooth (for small pieces of data), but it really works well, broadcasting 15 compressed jpegs / second with low quality without the slightest delay.

The question I have is when I increase either the quality or the frame rate from the sender of the iOS device to the iOS receiver, there will be a delay or a delay and will no longer be in real time. If there is a delay, I would like to somehow make the sending iOS device drop frames so that the recipient can catch or ignore the lag queue for the recipient.

In GameKit, I set the session mode to use GKSendDataUnreliable to find out if it can help, but to no avail.

If delays occur, what is the best solution and the right approach to jpegs so that the iOS receiver can return to real time again? Will the sender have to stop transmitting within a certain period of time or is there something the receiving client can do to cancel the cumulative queue.

I also used NSStream, and when using wifi it allows to increase the bandwidth, the same problem will still occur in terms of delays if too much data is transmitted.

Thank you in advance for your help.

+4
source share
1 answer

Could you attach a timestamp to each jpg (possibly time from an era), so that the receiving client will ignore all images that are not in the given timeframe.

You could also return the receiving client with simple confirmation packages indicating that jpg was received. If the sending client has not received a confirmation packet within a specified period of time, it discards all the images that it intends to send and starts from scratch.

In this decision, if the receiving client falls by X seconds after the sender, it will stop sending confirmation packets and discard all incoming data until the sender discards everything in its queue and sends live frames again.

+1
source

Source: https://habr.com/ru/post/1494442/


All Articles