5

I am trying to encode video from my webcam into a VP8 stream. Sending a WebRTC stream from my webcam using Chrome looks pretty good and doesn't use a lot of CPU power. When I try to transcode my webcam stream to VP8 (webm) using FFMPEG then it's very, very slow.

On OS X I use the following FFMPEG options to generate a VP8 webm file. The source is a 720p Facetime webcam. It drains my CPU usage (late 2011 core i7 MBP) and the quality isn't very good:

ffmpeg -f avfoundation -i 'default' -y -qmin 11 -qmax 45 -b:v 500k -cpu-used 0 -deadline realtime test.webm

Which protocol is used for WebRTC and how can Chrome be so fast? I was under the impression that VP8 cannot be done in hardware. Using modern Intel CPUs you could use QuickSync, but I guess that is H.264 only and not supported by FFMPEG.

Ramon de Klein
  • 5,172
  • 2
  • 41
  • 64
  • Chrome may be using Hardware accelerated encoding. Also, what are your VP8 encoding settings and framesize/rate? Your encoding settings and video quality could be effecting the speed(depending on your computer's hardware). – Benjamin Trent Dec 18 '14 at 20:27
  • I added my FFMPEG string. I don't think VP8 can be done in hardware. – Ramon de Klein Dec 18 '14 at 20:37
  • Chrome does do hardware accelerated encoding/decoding depending on your chrome version, OS, and underlying hardware. – Benjamin Trent Dec 18 '14 at 21:38
  • 2
    @RamondeKlein Modern Intel hardware does support VP8 in QuickSync. – Brad Sep 21 '17 at 19:54
  • Indeed, but that's definitively not a thing on Sandy Bridge. Let alone on OSX where the infinite wisdom of its maker doesn't even [recognize](https://developer.apple.com/documentation/coremedia/cmvideocodectype) VP codecs. Chrome should have [been](https://chromium.googlesource.com/external/webrtc/+/b8caf6a5042e4a8bf0230b8a202a0fbfc414fb59/webrtc/modules/video_coding/codecs/vp8/) just [using](https://chromium.googlesource.com/chromium/deps/libvpx/) normal libvpx then, so my educate guess is simply OP hasn't the right [parameters](https://www.webmproject.org/docs/encoder-parameters/). – mirh Nov 24 '19 at 14:07

1 Answers1

2

This is actually normal. Right now the WebM Project is still relatively small, with the only major adopter being Google's YouTube streaming service.

WebM encoding [using the VP8 codec] is extremely slow, but somehow the newer VP9 codec is even harder on consumer machines. It seems like it isn't too much of a problem for Google's massive servers, but the major benefit of WebM video [its highly effective compression] is its downfall for average users.

From the WebM Project site:

Encoding WebM videos seems really slow. What are you doing about that?

Today, encoding VP8 in "best quality" mode is the slowest configuration. >Using "good quality" mode with the speed parameter set between 0 and 5 will >provide a range of speeds. We believe that we can make substantial VP8 >speed improvements, especially with your help. We increased overall VP8 >decoder performance by ~28% in our October 2010 "Aylesbury" release and are >focusing on encoder speed improvements for our next named release.

Hope this helps!

HMSCelestia
  • 186
  • 1
  • 1
  • 13