WebRTC Video Codecs performance evaluation
The standard and most popular codecs in WebRTC are VP8 and H.264 but those are not the only options we have. VP9 has been available for a while and some big services are using it and AV1 support has been recently added to Chrome.
When comparing codecs there are interesting considerations like interoperability and licensing but probably the most important factors are how good the codec is in terms of compression and how cheap the codec is in terms of cpu&memory usage.
The compression ratio is usually the first thing we look at and there are many comparisons available for that, but the resource consumption is equally important if we want to be able to use the codecs for real time use cases.
Given that AV1 is available in the Chrome Canary versions I decided to run some tests to get estimation of where we stand in terms of cpu usage for the 4 available codecs in WebRTC ecosystem. The idea of the test is to compare the whole video pipeline with those 4 codecs and not just the codecs in isolation.
Testing environment
The tests were done with a simple web page establishing a connection between 2 PeerConnections (one sending and the other receiving). The test page is here in case you want to run the tests yourself:
https://jsfiddle.net/tvo7czxs/
The tests with that page were performed changing 3 variables:
- Codec: VP8, VP9, H264, AV1
- Resolution: HD, VGA, QVGA
- Bitrate: 200Kbps, 800Kbps, 2Mbps
QVGA results
For QVGA resolution the results were as expected, with VP9 requiring a bit more CPU than VP8 and AV1 requiring almost 2x CPU as VP8. H.264 was the one requiring less CPU usage as it is using hardware acceleration for that.VGA results
HD (1280x720) results
Encoding vs Decoding cost
I did one more test to split the cost between encoding (Sender side) and decoding (Receiver side). That test was performed for VGA at 800 Kbps and the results were the next ones for the four codecs under consideration.Comparing just the decoding cost with different codecs it looks like AV1 is around 2x more expensive than the others. VP9 is slightly more expensive than VP8 and VP8 slightly more expensive than H264 but without big differences between those three.
Conclusions
Having new codecs is amazing and there is no doubt AV1 is the future of real-time video communications but it looks like we should wait a bit to be able to use it for general purpose videoconferencing applications. In the mean time we can probably use it for specific use cases like broadcasting, dedicated powerful devices or to encode the low resolution versions of the video streams when using simulcast.For other use cases VP8 and VP9 look like still the best options unless you don't worry that much about low bitrate cases or you are using high resolutions and battery/cpu consumption is a big concern and you can consider H264.
If you want to replicate the test and share your data I will update these tables/graphs with the average of the measurements. And as usual feedback is more than welcomed either here or in Twitter.
Thx a lot for the early feedback from @murillo, @elminiero, @dan_jenkins, @maniksach.
Excellent and very cool idea and great content of different kinds of the valuable information’s.
ReplyDeletehttps://www.kellytechno.com/Hyderabad/Course/amazon-web-services-training
This comment has been removed by the author.
ReplyDeleteBest Essay Writing Service Students Our company is among the leading UK custom essays services because we've already gained our clients' trust for many years.
ReplyDeleteHello, I would like to thank you for sharing this blog post with others. The info related to video codec performance is interesting, nevertheless, it's quite hard for me to understand. One of my friends who is actually works as a programmer told me about the source which can help to do my discussion board https://mid-terms.com/buy-discussion-board-post/ and he explained me the connection between the codec.
ReplyDeleteThanks for posting this info i feel same as like i read about your Buy Coursework post. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts.
ReplyDeleteDon’t follow your role model. Be the Role model person for others. But it's so simple by getting Hadoop training in Chennai. Because it is an assurance course to bounce back from a double salary. For joining call 7502633633.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThat's so nice! I like this car, but also I like this service for essay and homework! This guys really can assistance you, and you should try! Check this and write to them capstone papers and go for it! Excellent luck and have a kind day!
ReplyDeleteThat's amazing post. If you are need SaaS development company in USA? Thank tagline infotech is one of the best company.
ReplyDelete