Saturday, May 23, 2015

vectorized video compression


Not every type of video needs high resolution and frame rates to look good. For music videos, 4K at 60fps is overkill, and a waste of bandwidth and power. Traditional video compression operates only on pixels, and removes detail in low contrast areas, leading to blocky artifacts.

My compression technique is optimized for a stylized output, and a much smaller data stream. It mixes SVG vector graphics with super compressed low resolution video. The video stream is resized to 240 pixels wide, and frame rate dropped to 8fps, this makes the file 10X smaller than the original compressed version. The backend pre-computes the SVG each frame using Potrace. Each SVG file is recompressed with SVGO, which can reduce the file size by another ten percent or more. As the video plays it triggers reloading of the SVG overlay frame, to compensate for the delay, the server is hardcoded to return two frames ahead of the requested frame.

You can view the live demo at heroku. Note this is a free and limited account, so if the site gets busy try again later. http://vectorvideo.herokuapp.com note: heroku is limiting my connection rate, so svg playback is limited to 4fps