A little bit about me

Friday, August 31, 2018

How to Record in True 120FPS on PC


This is a comprehensive how to guide outlining how I managed to record native 120FPS footage from PC games. This guide will generally work at other framerates and resolutions but will obviously require different settings/hardware.

First you'll need a few tools.
You're going to need a graphics card that can both run games at 120FPS and has hardware encoding first and foremost.

GPU

Nvidia GPUs feature NVENC which encodes different formats at different levels of performance based on the generation of the chip. 
Wikipedia has a nice summary which says:

GTX 700 series cards support ~1080p 240FPS H264 YUV420 encoding.

GTX 900 cards support HEVC H265 encoding as well and supports 2160p 60FPS encoding.

GTX 1000 cards support 10-bit and HEVC 8k encoding and offers "doubles the encoding performance" of GTX 900 cards. 2160p 120FPS?

RTX 2000 Sixth generation NVENC implements HEVC 8K encoding at 30FPS

Intel integrated GPUs offer QuickSync accelerated encoding with the expected lower performance when compared with AMD/Nvidia solutions.

AMD GPUs feature VCE encoding which again varies based on model.
To quote AMD's Robert:
Tahiti/Pitcairn (HD 7000 Series):
  • 1080p60 h.264
Hawaii/Bonaire (R9 200 Series):
  • 1080p87 h.264
Fiji/Tonga (Fury/Fury X):
  • 4K60 h.264
  • 1440p120 h.264
  • 1080p240 h.264
Polaris (RX 400/500 Series):
  • 1440p60 h.264
  • 1080p120 h.264
  • 4K60 h.265
  • 1440p120 h.265
  • 1080p240 h.265
Vega (Vega 56/64):  
at 1080p
  •  H264 Speed: 219 fps
  •  H264 Speed: 180 fps
  •  H264 Speed: 101 fps
  •  H265 Speed: 243 fps
  •  H265 Balanced/Quality: 219 fps
at 1440p
  • H264 Speed: 129 fps
  • H264 Balanced: 107 fps
  • H264 Quality: 75 fps
  • H265 Speed: 137 fps
  • H265 Balanced/Quality: 124 fps
Navi supports 4k90 encoding or 1080p360 in H264.
It also supports 4k60 or 1080p360 in H265. 
https://gpureport.cz/info/Graphics_Architecture_06102019.pdf

Overhead

This will give you an overview of the sort of performance you can expect when encoding with GPU acceleration but you also have to consider that the hardware encoding is not entirely independent of the rest of the GPU and may suffer and drop frames if you're running at over 80% GPU usage.

Software

Next you'll need a few programs in order to record properly.
While Nvidia and AMD provide software in their drivers to record your screen, they have limited options and max out at 60FPS.

OBS (open broadcaster software) is a free and open source recording software that allows a lot of configuration when recording or streaming.

Handbrake (also free and open source) is a very popular transcoding software that allows you to re-encode the videos you record so that they can be distributed online and/or stored in a more efficient format.

MSI Afterburner + Rivatuner (free and proprietary) are hardware/software monitoring tools that allow you make sure your GPU usage is <80%, framerates are solid at 120FPS, and cap your framerate exactly at 120FPS

Finally you'll need whatever program or game you'll be recording.

Configuration

First make sure your game will run at 120FPS because many have hard or soft framerate caps at 60 or even 30FPS.

PCGamingWiki is a fantastic resource that will tell you what features a given game supports.

An example page of Battlefield 4 shows that by default the game is locked at 200FPS but can be unlocked entirely with a console command/config file edit.

Another example is Burnout Paradise Remastered which was released in August of 2018 yet lacks any support for framerates above 60FPS and has no known way to unlock it.

There are also comprehensive lists of games that can support 120FPS, support at least 60FPS, or do not support even 60FPS.

Once you get the right game, you're going to want to make sure you can record properly.

Configuring OBS can be a challenge and takes a bit of trial and error.

First install and open the program then open the settings menu (under the 'file' drop down menu). Click on the video tab then set the "Integer FPS Value" to what you want. In this case 120.

You should then set canvas resolution to the resolution of the display you'll be recording then the output resolution to what you want to record at (probably 1080p).

Then you'll want to switch to the "Output" tab and change the "output mode" drop down menu to "Advanced". Then click on the recording tab and set the values you'd like. The bitrate set below (25,000kbps) is on the low side and I'd recommend closer to 100,000kbps for good 1080p 120FPS HEVC video. Generally you want the peak bitrate to be the target +50%. When selecting the encoder make sure to use the hardware accelerated one.



Finally, make sure you've added the screen you want to record as a "source" in the main screen and preview the output to be sure. Then make a quick test and ensure there are no artifacts and the recording saves properly.


When you're ready to record. Open Afterburner. It will automatically start rivatuner which will be listed in the windows notification area. Just click it and it will open.


 Select the Framerate limit and set it to 120FPS.

Transcoding

Open handbrake and import the file you recorded.

Make sure you start with the VP8 1080p30 preset. Click on the 'Video' tab and change the Framerate from '30' to '120' or 'same as source'. Set the 'consistent quality' slider between 20 and 30.



You'll want to cut down your video in Handbrake in order to lessen the time it takes to transcode and upload. If you plan to share the clip online then make sure it's 60 seconds or shorter.

Allow the video to transcode. It may take up to an hour depending on your processor and your settings but 10 minutes is normal. The process often appears to hang at 99% but it often finishes successfully if you let it sit for a little while.

Sharing

So now we finally get to the hard part. Before this point everything can work well without significant limitations. This is the bottleneck and the largest hurdle to widespread 120FPS video adoption.
Unless you want to host your video on your site yourself then there only a couple video hosts that supports 120FPS. Gfycat supports 1440p (4k?) 120FPS video up to 60 seconds in length with audio (using an account). Twitch also supports unlimited 120FPS streaming but with low bitrate of 6000kbps.

I should add for the sake of comprehensiveness that technically it's possible to edit a 120FPS video to half speed locally then upload to youtube and select the 2x playback speed option but I do not recommend it at all. Audio is borked by this process, the viewer must make changes, and playback is not performant. I have also learned that twitch may be capable of 120FPS somehow but I have yet to find any real confirmation so I will update this after I test it.

For Gfycat, make sure you upload directly to https://gfycat.com/upload. The create tools butcher the video and make results like this: https://gfycat.com/gifs/detail/DecisiveUntimelyGypsymoth

You also want to make sure you cropped the very beginning of the video because it will stutter. This is what a raw recording uploaded to gfycat looks like: https://gfycat.com/gifs/detail/ThornyMeagerIcelandichorse

Uploading is as fast as your internet connection but processing is slow and unlike youtube you don't get a link you can share until it's done so make sure you can keep that tab open during that time.

When properly done you will end up with results like these: https://www.willse.org/p/120fps.html

With Twitch, just use normal OBS streaming settings and set the framerate to 120FPS. It will say that the quality setting is "1080p60" but it's actually 120FPS which can be confirmed by looking at the video stats or downloading the video. This is a sample I recorded of Half-Life Alyx with unrelated broken audio: https://www.twitch.tv/videos/596319612

If you decide to host an .mp4 version of your video yourself then you should be able to simply embed it into any standard webpage. An example video can be found here:
https://www.blurbusters.com/hfr-120fps-video-game-recording/

In this case you're clearly not limited by length, resolution, framerate, sound or bitrate anymore.

Edit: 

Gfycat has improved their video support substantially since I wrote this and they now support audio and 1440p high bitrate 120Hz video. The following video is an example of a very high bitrate video through the entire pipeline.


via Gfycat


Edit 2: Added new information about twitch streaming.