Answers.Body: <blockquote>
    <blockquote>
      <p>Couldn't you just offload some of the software encoding tasks to CUDA or OpenCL to speed them up? </p>
    </blockquote>
  </blockquote>
  
  <p>No. Video encoding is very difficult to parallelize. And even in software adding threads has a quality impact. GPUs run small, simple programs. Their speed comes from being able to run thousands of copies of these small programs at the same time. All forms of compression work by reducing entropy from a stream. Meaning it needs to have knowledge of what data it has encountered in the past. If the past is running on another core, it must wait for it to finish (eliminating the benefits of multi core) or proceed without that information (hurting compression ratios)</p>
  
  <p>VAAPI uses intel QuickSync. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-07T01:21:02.860Z
Answers.LastActivityDate: 2020-01-07T01:21:02.860Z
Answers.UserDisplayName: SlimSCSI
Body: <p>I don't know if this is the place to ask, it's a bit of a hybrid video/IT/developer question, so my apologies if it is not.  I scoured the entire internet and can't find an answer to this question!</p>
  
  <p>I'm re-encoding a bunch of videos, and I don't want to lose too much quality, but I don't want it to take three years.  I'm avoiding traditional GPU “hardware encoding”, as that always has quality trade-offs for the purpose of being real-time for live streaming and such.  </p>
  
  <p>Then I got to thinking: “Couldn't you just offload some of the software encoding tasks to CUDA or OpenCL to speed them up?  But still not really be 'hardware encoding' per se?”, so I did some digging and ended up with a VAAPI encoder which is going 8x as fast as straight CPU encoding, which is great — my question though, is, is it doing the same traditional “hardware encoding” which is going to bring quality issues?  Or is it in fact doing what I describe above and just using the GPU as a co-processor of sorts?</p>
  
Tags: <encoding>
Title: Is VAAPI the same as hardware encoding?
UserDisplayName: Hyacin
ThreadText: # Is VAAPI the same as hardware encoding?
  
  (Asked by: username_0 on 2020-01-06)
  
  I don't know if this is the place to ask, it's a bit of a hybrid video/IT/developer question, so my apologies if it is not. I scoured the entire internet and can't find an answer to this question!
  
  I'm re-encoding a bunch of videos, and I don't want to lose too much quality, but I don't want it to take three years. I'm avoiding traditional GPU “hardware encoding”, as that always has quality trade-offs for the purpose of being real-time for live streaming and such.
  
  Then I got to thinking: “Couldn't you just offload some of the software encoding tasks to CUDA or OpenCL to speed them up? But still not really be 'hardware encoding' per se?”, so I did some digging and ended up with a VAAPI encoder which is going 8x as fast as straight CPU encoding, which is great — my question though, is, is it doing the same traditional “hardware encoding” which is going to bring quality issues? Or is it in fact doing what I describe above and just using the GPU as a co-processor of sorts?
  
  **Tags:** encoding
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-01-07. Score: 2 | Accepted answer
  
  > > Couldn't you just offload some of the software encoding tasks to CUDA or OpenCL to speed them up?
  
  No. Video encoding is very difficult to parallelize. And even in software adding threads has a quality impact. GPUs run small, simple programs. Their speed comes from being able to run thousands of copies of these small programs at the same time. All forms of compression work by reducing entropy from a stream. Meaning it needs to have knowledge of what data it has encountered in the past. If the past is running on another core, it must wait for it to finish (eliminating the benefits of multi core) or proceed without that information (hurting compression ratios)
  
  VAAPI uses intel QuickSync.
  
  
  ---
  
  