Matt Ivester and Josh Beal are the founders of Reveal, a video-sharing app with a unique twist: users of their platform are given “Reveal Coin” (RVL) for their participation. This digital currency gives Revealers a role in the social network's future advertising marketplace, sharing the company's success with its users. Matt and Josh hope its addition will help solve some of the problems associated with social network's as they grow, giving content creators a reward for their investment in the platform, and placing data sharing controls in the hands of the users themselves.

Including RVL in their platform makes Reveal interesting in the long run, but the founders don't believe the cryptocurrency is their main selling point—more importantly, the app is fun to use *today.* Over the course of our work with them, we've seen a community heavily invested in their network, with Revealers constantly asking each other interesting questions and sharing their creative responses.

The Project

Last May, Matt and Josh reached out to us for help improving the quality of video recording and streaming within Reveal. Users had remarked about the app's “blurry camera” on the network, and the founders knew improvements could be made to push the app's video quality up to compete with platforms like Vine and Instagram. They were also concerned that the current system might be wasting device resources, such as battery life and disk space, and asked us to make sure things were being done as efficiently as possible.

We immediately dove into Reveal's code to see how things worked, analyzing processor and memory usage along the way. Reveal's existing system was pretty standard: record a video, upload it to the cloud, download it, and play. Videos were recorded at 640x480 resolution, stored as raw data in the cloud, and downloaded in full before beginning playback. While our search for memory leaks and wasted battery life turned up nothing (kudos to Reveal!) we knew exactly what changes to make to improve the system as a whole.

For video streaming applications, Apple recommends using a protocol called “HTTP Live Streaming” (HLS). This protocol allows users to stream video at several different quality levels based on the capabilities of their device and the quality of their current internet connection. It also splits video files into discrete “segments,” so that playback can begin before the entire video has finished downloading. We knew that switching Reveal's system to HLS would allow us to simultaneously increase video quality while decreasing the time a user would have to wait for their videos to begin playing.

Our first step was to build an upload and transcoding pipeline that would enable us to take the raw videos created by Reveal's users and convert them into HLS-ready streams. For this we used Amazon's AWS platform: the app uploads videos to S3, triggers new conversion jobs via Lambda, converts the raw videos into HLS streams with Elastic Transcoder, places the final streams in S3, uses Lambda to let the database know the video is ready, and then distributes the content across the globe using CloudFront. This set of products allows Reveal to scale up their user base without having to manually manage servers—everything runs only as long as it needs to with no additional developer input required.

With the pipeline complete, we set to work updating Reveal's iOS app to make use of the more efficient system. We modified the recording system to upload videos in the background, swapped out the download-and-play system for a URL-based one pointed at the HLS streams we created via Amazon. As a little cherry on top, we built a caching and queueing system that would prepare the next video for playback before Reveal's users needed it, reducing the wait between hitting “play” and the video's start.

Our Results

Reveal's new system increased video quality from 640x480 to 1280x720, while significantly reducing user wait-times for both sharing and playing videos. Additionally, the multi-level stream system of HLS allows users on 3G networks to still view Reveals almost instantly by reducing the size and quality of the stream to match the speed of their connection. Users were treated with improved quality, reduced usage of battery, network, and disk space, and an overall smoother experience.

Technical notes aside, working on Reveal has been a blast—Matt and Josh are great guys and the work they've done so far has been inspiring. We're incredibly lucky they chose to share this experience with us, and we look forward to working with them more as they continue to grow.