STRENGTHS & LIMITATIONS OF SOFTWARE-BASED VIDEO ENCODING

Encoding software such as x265 contains a great many presets, allowing the user to customize settings and trade overall computing requirements for the end size of the video. For file-based videos, this technology can produce very high-quality results with the x265 ‘veryslow’ preset: the video can be encoded many times longer than real-time constraints allow, yielding the best compression, but with considerable cost of encoding resources. 

For live video, by contrast, software encoding is simply unable to achieve the maximum quality offered by the encoder technology. The necessary tradeoffs to satisfy computing requirements mean significant reductions in quality. Instead of running the encoder at a slow setting, which will produce the best end quality, sacrifices are necessary to achieve the target frame rate. The fundamental problem with software-based encoding for live videos is that the best compression—that is, the highest quality video for the lowest bit rate—and the finest end result in video quality are unattainable with the available compute level. By comparison, NGCodec’s encoder can achieve 80 FPS and surpass the quality of even the x265 ‘veryslow’ preset. 

FPGA ACCELERATION

With the slowing of Moore’s Law, cloud infrastructure providers have realized that a new type of accelerator is required. Initially, graphics processing units (GPUs) were tried. For some applications, like the training of neural networks, these provide more performance than CPUs, but they are more challenging to program. Unfortunately, many new applications require complex decision-making as well as number crunching; these have experienced limited gains with GPUs. 

The FPGA (field-programmable gate array) is a special type of chip that can be programmed by rewriting its circularity in the field. This is identical to how a traditional ASIC (application-specific integrated circuit) is designed, but unlike FPGAs, ASICs can not be changed in the field and typically take years to develop from the initial design to deployment. The graph below shows a comparison of different accelerators used in data centers.

Accelerator Comparison.png

Due to how FPGAs are programmed versus running software on CPUs and GPUs, FPGAs offer twenty times more performance and are around twenty times lower power than CPUs. The drawback is that they are more difficult to program and use.

BENEFITS OF HARDWARE ENCODING WITH F1 INSTANCES

For live video, the primary benefit to video encoding with FPGA F1 instances is that we can achieve a higher quality video at the same bit rate, and do it at a desirable 60 frames per second. A second benefit, relevant only in certain cases, is lower latency and reduced lag time between live stream source and end viewing. Third, the cost of encoding is significantly reduced. Amazon Web Services (AWS) will imminently release pricing for the FPGA F1 instance; we hope to present a more economical option to users as a result of the significantly lower power consumption required for FPGAs versus CPUs. Finally, we can support up to 32 independent encoded streams of video on a single F1 instance. 

In a practical sense, the gain is ultimately that NGCodec can enable customers to achieve a higher-quality video by taking advantage of the greater compute capability of an FPGA. We are able to reduce source video to 0.13 percent of its original value with virtually no perceived loss of quality. The still frame comparison below shows the difference in video quality between two x265 presets. Note the improved clarity of the runners’ bib numbers and the tree on the top left.

Video Quality Comparison.png