When it comes to fitness app development, innovation is key. At [Company Name], we're committed to creating cutting-edge solutions that help people achieve their fitness goals. In this series of posts, we'll be exploring the world of video conferencing and how our team approached developing a custom solution.
Conventions & Caveats
As we dive into the world of video conferencing, it's essential to establish some conventions and caveats. Throughout this series, we'll be referencing a 640x480 24-bit color 24fps video stream. We'll also spell out "bits" vs. "bytes" in most cases to avoid confusion, and when abbreviating, we'll use "Mb" (lowercase) for bits and "MB" (uppercase) for bytes.
Basic Update Algorithm
Our fitness app development journey began with a basic algorithm that simulated video conferencing without network communication. We used dear imgui for the UI and videoinput for webcam capture. This prototype allowed us to test our concept and lay the groundwork for future development.
To improve performance, we divided images into 16x16 macroblocks and calculated the error for each block by taking the root mean square (RMS) of the client frame's RGB values vs. the local frame's RGB values. We prioritized blocks with high error and transferred as many as possible every packet. This self-correcting system allowed us to minimize differences between what the client sees and the current state of the video feed.
Compressing Video
To make our fitness app development more feasible, we needed to reduce bandwidth by a factor of 30 for real-world use. To achieve this, we explored compression techniques using miniz and minilzo. While these lossless algorithms didn't affect image quality, they did impact macroblock update size.
At level 9, zlib achieved 23.8 bits per pixel, while lzo achieved 28.9 bits per pixel – not as impressive as we had hoped. The main reason for this is that both algorithms struggle with short blocks of data and have a "startup" phase where they can't efficiently compress until a history is built up.
Next Steps
In our next installment, we'll continue exploring the world of video conferencing and fitness app development. We'll discuss how to improve compression and handle data corrupted or dropped by the network. Stay tuned for more insights from our team!