Get webrtc-like latency with ffmpeg?

Solution 1:

The problem is mostly from the fact that you are using software transcoding, instead of hardware transcoding.

As a rule of thumb, if the conversion uses the hardware acceleration, the latency will be of less-than-a-second order (usually milliseconds). If it is done in software, then the latency will be of more-than-a-second order.

FFmpeg supports hardware acceleration, but it is usually tricky to make it work for you.

https://trac.ffmpeg.org/wiki/HWAccelIntro

On the other hand, Google Chrome supports VP8 and H264 (where it is available) hardware encoding/decoding, both on your computer and your Android phone:

http://code.google.com/p/chromium/issues/detail?id=428223