2 ms·
Disclaimer: I work on WebRTC somewhere in the codec stack. Certainly not the most knowledgeable in that field but here are a few reasons. Software encoders wil
by Orphis 6y ago
Disclaimer: I work on WebRTC somewhere in the codec stack. Certainly not the most knowledgeable in that field but here are a few reasons.
Software encoders will always have more features than hardware encoders, which are prone to bugs.
A bug in a HW encoder needs either a new driver or new silicone. You can't work with those and sometimes you can't even detect which version it is.
So if you want to ship a reliable application, you can either use a software codec (which you control) or hope the HW encoder which is totally random works as intended.
HW encoder bugs show in many forms. Sometimes the stream is just broken and can't be decoded, sometimes it won't listen to encoding parameter updates you send it (eg max bitrate or quality settings), sometimes it just generates a valid but bad stream (too many I frames, breaking the max bitrate setting), sometimes they have a TERRIBLE latency.
Sometimes, they just plainly lack features, for example can't encode temporal layers, don't have any denoising (useful for VP8), have a limited amount of instances limiting simulcast opportunities, have extreme frame size limitations (can't do screensharing with it)...
And that's just what I could come up with in a few minutes of thinking, I'm sure people who have worked on it for a much longer time would be able to say much more.
- j1elo 6y agoWe could argue that those issues would apply exactly the same for both H.264 and VP8 hardware-based encoders, so these aren't reasons for lacking VP8 encoders in phones and other devices... otherwise we wouldn't have H.264 hardware either. I agree in spirit with the parent comment (although judging from my post it would seem the contrary). Ideally, both codecs would have hardware encoders. The difference in performance and battery savings are huge. I just understand that the industry players felt that it was necessary to provide a royalty-free option among the proposed codecs... either that or it was just Google pushing their own thing, which also sounds very likely.
- Orphis 6y agoThey do apply to all codecs, absolutely. Some just have historically more usage, so the encoders might behave better. There are still bugs though, I do remember hearing about some device producing an H264 stream that another device couldn't decode in HW. It's still not perfect. Also, as many people have pointed out, VP8 is a more complex codec than H264, so harder to test coverage of all features, especially as most applications (especially on desktop) are not really doing RTC, which is quite a specific use case. And phones DO have VP8 encoders. It's just that iPhones for historical reason don't have one. Pure speculation from my part, but I'm guessing they'll do AV1 someday as Apple is working on the spec. But in general, even though HW encoders would be awesome for all codecs if they were working well in all situations, the reality is they don't always work, you usually need to build lists of HW that is supposedly behaving well with your use case. All advanced features (eg spatial layering) are tricky to implement in HW and are usually not configurable, so SW codecs will still have quite a lot of usage for the sake of quality.