Answers.Body: <p>There is a special NVIDIA API that allows you to encode to h264/h265 called NVENC. It's now integrated into ffmpeg so using it is quite easy.</p>
  
  <p>But before buying an NVIDIA card you should do/know the following:</p>
  
  <ol>
  <li>Check the NVENC hardware capabilities table from the <a href="http://developer.download.nvidia.com/designworks/video-codec-sdk/secure/7.0/NVENC_VideoEncoder_API_ProgGuide.pdf?autho=1477937979_be46b40bcac45bc52b84d68ee7335ccc&amp;file=NVENC_VideoEncoder_API_ProgGuide.pdf" rel="nofollow noreferrer">NVIDIA VIDEO CODEC SDK APPLICATION NOTE - ENCODER</a> cause h265 support is limited in Maxwell V2 card you've mentioned. You can also find average encoding speed (fps) there.</li>
  <li>There is an artificial limit of two for parallel encoding processes for GeForce cards (check the previous link for more details). If you want more (actually around 30 simulanious encoding streams) you should buy Quadro or, according to this beautiful <a href="https://video.stackexchange.com/a/17943/17061">answer</a>, one can hack GeForce (hardware in fact is the same as in Quadro) which is, of course, illegal.</li>
  <li>With any hardware encoder you'll never get the same quality/size as you can get from x264.</li>
  <li>Also there is Intel QuickSync hardware encoder integrated in some of Intel's processors (not in your Xeon unfortunately) which I know nothing about, so you have to research this part yourself.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-31T18:39:48.613Z
Answers.LastActivityDate: 2016-10-31T18:45:20.783Z
Answers.LastEditDate: 2017-04-13T12:46:08.110Z
Answers.UserDisplayName: Sergey
Body: <p>I am trying to figure out the sweet spot of maximizing FPS of encoding videos into h264/h265. I will be running some videos through Georges Vid.Stab library (<a href="https://github.com/georgmartius/vid.stab" rel="nofollow">https://github.com/georgmartius/vid.stab</a>) to stabilize things like drone of GoPro footage, and others just re-encoding to h265 to reduce filesize / bandwidth used.</p>
  
  <p>I stumbled across the DVE (<a href="https://github.com/Sonic-Y3k/dve" rel="nofollow">https://github.com/Sonic-Y3k/dve</a>) project, which is nice except it won't work with stabilizing videos as the process will divide up the original video into many subsets and ask multiple computers to encode them. While they would do the job, when the videos are stitched back together they lose the advantage of the stabilization at the stitching points as they don't have the info needed to say where the start frame "should" be compared to the other servers calculations.</p>
  
  <p>I have also looked at the NVidia Grid, Intel Phi as coprocessors, which would be an option, but I haven't seen anywhere that they are actually supported by ffmpeg at this time. </p>
  
  <p>A GeForce GTX 980 with Maxwell V2 seems like a good option, but I haven't seen any numbers that show the encoding of a file with the GPU accelerator vs without, nor do I know if that is a "good" card or if it is overpriced for what I need, or not enough.</p>
  
  <p>I am currently running a Dell R720xd with 160GB RAM (1333MHz), dual Xeon E5-2690 processors on a RAID 1 with 20TB of storage. I have room for 2 full height / length PCI-E cards, and some half height as well.</p>
  
  <p>I don't mind spending up around $1000 provided the benefits are real.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-31T18:05:18.353Z
Comments.Text: There are two stages here: applying the stabilization and encoding to H.265. You can run the vidstab analysis on the whole file and then in the 2nd command apply it and segment the processed result. This can be rawvideo or more likely a intermediate codec like DnXHD or ProRes..etc. These segmented files can then be encoded in parallel and stitched together.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-01T15:24:47.440Z
Comments.Text: Thanks, I had considered that but worried that it wouldn't be able to segment the vidstab configuration file so the servers wouldn't know what to do with a 30 minute configuration file when only having access to 2-3 minutes of video.
Comments.UserDisplayName: Alan
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-01T17:09:57.483Z
Comments.Text: You would be segmenting the file *after* the vidstab is applied.
Comments.UserDisplayName: Gyan
Tags: <ffmpeg><encoding>
Title: Maximizing FPS of ffmpeg encoding
UserDisplayName: Alan
ThreadText: # Maximizing FPS of ffmpeg encoding
  
  (Asked by: username_0 on 2016-10-31)
  
  I am trying to figure out the sweet spot of maximizing FPS of encoding videos into h264/h265. I will be running some videos through Georges Vid.Stab library (<https://github.com/georgmartius/vid.stab>) to stabilize things like drone of GoPro footage, and others just re-encoding to h265 to reduce filesize / bandwidth used.
  
  I stumbled across the DVE (<https://github.com/Sonic-Y3k/dve>) project, which is nice except it won't work with stabilizing videos as the process will divide up the original video into many subsets and ask multiple computers to encode them. While they would do the job, when the videos are stitched back together they lose the advantage of the stabilization at the stitching points as they don't have the info needed to say where the start frame "should" be compared to the other servers calculations.
  
  I have also looked at the NVidia Grid, Intel Phi as coprocessors, which would be an option, but I haven't seen anywhere that they are actually supported by ffmpeg at this time.
  
  A GeForce GTX 980 with Maxwell V2 seems like a good option, but I haven't seen any numbers that show the encoding of a file with the GPU accelerator vs without, nor do I know if that is a "good" card or if it is overpriced for what I need, or not enough.
  
  I am currently running a Dell R720xd with 160GB RAM (1333MHz), dual Xeon E5-2690 processors on a RAID 1 with 20TB of storage. I have room for 2 full height / length PCI-E cards, and some half height as well.
  
  I don't mind spending up around $1000 provided the benefits are real.
  
  **Tags:** ffmpeg, encoding
  
  > **Comments:**
  > **username_1**: There are two stages here: applying the stabilization and encoding to H.265. You can run the vidstab analysis on the whole file and then in the 2nd command apply it and segment the processed result. This can be rawvideo or more likely a intermediate codec like DnXHD or ProRes..etc. These segmented files can then be encoded in parallel and stitched together.  
  > **username_0**: Thanks, I had considered that but worried that it wouldn't be able to segment the vidstab configuration file so the servers wouldn't know what to do with a 30 minute configuration file when only having access to 2-3 minutes of video.  
  > **username_1**: You would be segmenting the file *after* the vidstab is applied.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-10-31. Score: 4
  
  There is a special NVIDIA API that allows you to encode to h264/h265 called NVENC. It's now integrated into ffmpeg so using it is quite easy.
  
  But before buying an NVIDIA card you should do/know the following:
  
  1. Check the NVENC hardware capabilities table from the [NVIDIA VIDEO CODEC SDK APPLICATION NOTE - ENCODER](http://developer.download.nvidia.com/designworks/video-codec-sdk/secure/7.0/NVENC_VideoEncoder_API_ProgGuide.pdf?autho=1477937979_be46b40bcac45bc52b84d68ee7335ccc&file=NVENC_VideoEncoder_API_ProgGuide.pdf) cause h265 support is limited in Maxwell V2 card you've mentioned. You can also find average encoding speed (fps) there.
  2. There is an artificial limit of two for parallel encoding processes for GeForce cards (check the previous link for more details). If you want more (actually around 30 simulanious encoding streams) you should buy Quadro or, according to this beautiful [answer](https://video.stackexchange.com/a/17943/17061), one can hack GeForce (hardware in fact is the same as in Quadro) which is, of course, illegal.
  3. With any hardware encoder you'll never get the same quality/size as you can get from x264.
  4. Also there is Intel QuickSync hardware encoder integrated in some of Intel's processors (not in your Xeon unfortunately) which I know nothing about, so you have to research this part yourself.
  
  
  ---
  
  