Jump to content

Video encoding - which is better? CPU or GPU?

zulh

I am a developer and I'm currently playing with ffmpeg and handbrake. I'm using my development machine at this moment to run my video encoding scripts and I have no issues. What I meant by 'encoding' here is, compressing all the videos I have so that the output file size is smaller than the input file size.

 

My target for this project is, I want to put this script in the cloud. But, I'm not sure whether I should go with CPU VPS or GPU VPS. From what I read online, many people said CPU is good enough for this kind of task and in fact, in most of the time, CPU will do the work (encoding) and it's best at it.

 

On the other hand, my limited understanding of CPU vs GPU mind sees GPU might help and potentially will speed up the video encoding process. But I'm not sure I'm right or wrong here and I need answers from experts here.

 

If you have any useful related articles or benchmark, please do share with me here.

Link to comment
Share on other sites

Link to post
Share on other sites

The faster the CPU, more power it has, and more cores the better for encoding needs. But if you intend on using a GPU, the more CUDA Cores/Stream Processes the better aswell, more VRAM may help in this case to but thats for a GPU. CPU is definitely a better option.

Link to comment
Share on other sites

Link to post
Share on other sites

Threadripper CPU if u can afford it but that's overkill 

My PC:

CPU: AMD Ryzen 5 2600X Processor (4.4Ghz), MOBO: GIGABYTE X470 AORUS Gaming 7 WiFi (AMD Ryzen AM4/ X470/ Intel Wave 2 WiFi/M.2), RAM: Corsair Vengeance LPX 16GB (2x8GB) DDR4 DRAM 3000MHz C15, GPU: Gigabyte nVidia GeForce GTX 1080 Windforce OC GV-N1080WF3OC-8GD Graphics Cards, STORAGE: 120GB CRUCIAL SSD, 1TB WD BLUE, COOLER: Cooler Master 212 EVO RGB Black Edition, FANS: 4 x MasterFan MF120R RGB (2 Front, 1 Back, 1 Top), 1 x Noctua NF-P12 Redux 1700 RPM(Back off Cooler), PC CASE: Cooler Master MB500 case, PSU: EVGA 750 BQ.

 

My Kids PC:

CPU: AMD Phenom II x4 955 (95watt @3.5Ghz @1.40V), MOBO: ASUS M2A-VM, RAM: Kingston 8GB (4x2GB) DDR2 800MHz, GPU: nVidia GT 710 2GB DDR3 (OC’ed Clock to 1300Mhz and Memory to 950Mhz), STORAGE: 250GB HDD, 500GB HDD, COOLER:  Cooler Master 212 EVO, PC CASE: Cooler Master Q300L , FANS: 3 x upHere RED LED Fans (2 Front, 1 Back), PSU: Generic 300 Watt PSU.

 

Console:  PS4 - vjizzle2384

Link to comment
Share on other sites

Link to post
Share on other sites

17 hours ago, vjizzle2384 said:

Threadripper CPU if u can afford it but that's overkill 

Thank you for the information.

Link to comment
Share on other sites

Link to post
Share on other sites

19 hours ago, UnboundGodz said:

The faster the CPU, more power it has, and more cores the better for encoding needs. But if you intend on using a GPU, the more CUDA Cores/Stream Processes the better aswell, more VRAM may help in this case to but thats for a GPU. CPU is definitely a better option.

Just curious to know, why you said CPU is better?

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, zulh said:

Just curious to know, why you said CPU is better?

Personal experience and most encoding software are CPU preferred. A higher and more powerful CPU will always be best, thats if it relies more on the CPU over the GPU. There is software designed for CUDA Cores or Stream Processes only, which in that case would be GPU intensive. So it really depends on what your developing. Eitherway though, a higher end CPU or GPU would and should work well while encoding.

 

If you were able to develop it to rely on both CPU and GPU at the same time instead of one over the other then you would probably kill it in the encoding area. Ive always done 2-pass aswell to get the most out of the bitrate. Although it takes longer it gets the job done in a decent amount of time and with decent quality and file size depending of course on the format/codec its encoded to.

 

Another thing to consider is quality over speed, CPU: Quality | GPU: Speed. This is another reason most prefer CPU if theirs can handle it that is or they will choose GPU over CPU if the CPU is occupied, although some still run into issues since they do 1-pass and end up having choppy footage afterwards. I personally prefer h.264 or h.265 for final codec aswell for better results, ive seen h.265 to provide better results overall when it comes to file size and quality though.

 

Link to comment
Share on other sites

Link to post
Share on other sites

21 hours ago, UnboundGodz said:

Personal experience and most encoding software are CPU preferred. A higher and more powerful CPU will always be best, thats if it relies more on the CPU over the GPU. There is software designed for CUDA Cores or Stream Processes only, which in that case would be GPU intensive. So it really depends on what your developing. Eitherway though, a higher end CPU or GPU would and should work well while encoding.

 

If you were able to develop it to rely on both CPU and GPU at the same time instead of one over the other then you would probably kill it in the encoding area. Ive always done 2-pass aswell to get the most out of the bitrate. Although it takes longer it gets the job done in a decent amount of time and with decent quality and file size depending of course on the format/codec its encoded to.

 

Another thing to consider is quality over speed, CPU: Quality | GPU: Speed. This is another reason most prefer CPU if theirs can handle it that is or they will choose GPU over CPU if the CPU is occupied, although some still run into issues since they do 1-pass and end up having choppy footage afterwards. I personally prefer h.264 or h.265 for final codec aswell for better results, ive seen h.265 to provide better results overall when it comes to file size and quality though.

 

Thank you for that answer. I really appreciate it.

 

I have detour request here - do you still have your favourite ffmpeg/handbrake scripts to encode videos to h.265 with smallest size (in MP4 format) at best quality? Do you mind to share it here?

 

Thank you.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, zulh said:

Thank you for that answer. I really appreciate it.

 

I have detour request here - do you still have your favourite ffmpeg/handbrake scripts to encode videos to h.265 with smallest size (in MP4 format) at best quality? Do you mind to share it here?

 

Thank you.

No problem, and sadly I dont. All that was on my last PC before resetting to sell. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×