Video stream is recorded in chunks of variable size and duration with resolution that's received from camera and default codec H264. There are two cases of video transfer:
1. Live streaming - client asks for live stream from Public Proxy which then routes request to the process responsible for that camera which respond with decoded frame from camera. Public Proxy sends request every time for each frame as long as client is watching. If the system detects that the client and the service that handles camera are in the same local network, it will try to connect client directly to the local streaming service to avoid going through the internet.
2. Video recording - when client asks to see recorded video clip, Public Proxy sends request to the service responsible for handling video footage. Only requested part of video is loaded from the location where it's stored and sent back to the Public Proxy. Public Proxy then caches that part of video (in case it's needed again somewhere in near future) and returns that part to the client where video player recognizes received part and starts playing it. Each request is handled by the video player automatically so the next part is loaded before the previous one ends which results in smooth video playing.