Hardware Encoding vs Software Encoding: Which Is Faster, and When?