Reassemble chunks of data in a frame to stream a video

177 Views Asked by At

I am currently trying to learn about Network.Framework that was published by Apple in WWDC 2018, where they stream real-time video from phone to computer using UDP. So I am currently trying to replicate their demo, to learn the framework and I have successfully created the UDP connection between two devices. I am able to capture the video from the phone and split each frame in chunks of 40 kB to send over UDP, however, once I receive the chunks in the computer I am not sure how to reassemble them back together.

At first, I thought of creating set amount of chunks and then ask the server to wait for that amount, but that wouldn't work as UDP loses packages as well. So I am currently trying to find a way how to stitch the chunks in a single frame, even if one chunk is lost during the stream.

I am new to iOS development and I am not a networking expert, but if there is a solution that explains the basic idea of how the algorithm works I will most likely understand.

0

There are 0 best solutions below