title: Slow VP8 and VP9 encoding with ffmpeg
body: <p>I saw <a href="https://stackoverflow.com/questions/27554532/ffmpeg-slow-vp8-encoding">this</a> answer, but it's a little old. Maybe the situation has changed?</p>
  
  <p>I want to re-encode a stream from an IP camera to WebM (VP8 or VP9) format with ffmpeg. I need real time speed, but my CPU is a Core i5 (2017) and too busy (load avarage too more 100%).</p>
  
  <ul>
  <li><p>Can I buy hardware that is better suited for such an encoding task?</p></li>
  <li><p>What parametres for ffmpeg are recommended for transcoding in realtime?</p></li>
  </ul>
  
  <p>At the moment I'm using this command (with overlay chroma key):</p>
  
  <pre><code>./ffmpeg \
  -i \
  bg.jpg \
  -thread_queue_size 512 \
  -rtsp_transport tcp -i rtsp://ip_cam:port/stream \
  -codec:v libvpx -quality realtime -r 25 -crf 30 \
  -b:v 2M -qmin 10 -qmax 50 -maxrate 2.5M -bufsize 5M \
  -speed 1 \
  -b:v 2M \
  -cpu-used 0 -threads 4 \
  -auto-alt-ref 0 \
  -c:a libopus -b:a 96k \
  -filter_complex "[1:v]chromakey=0x70de77:0.1:0.0[ckout];[0:v][ckout]overlay[out]" \
  -map "[out]" \
  -f webm udp://ip_destination:1935/name/stream
  </code></pre>