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.
 
Intel's PresentMon is a free and open source hardware/software monitoring tool that allows you make sure your GPU usage is <80% and framerates are solid 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, make sure you've capped your framerate using Nvidia control panel or some other tool.

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.



Edit 2: Added new information about twitch streaming.

Edit 3: Gfycat links are broken. Unfortunately, I'm not aware of any good alternatives at the moment.

Monday, June 6, 2016

On Core i5 bottlenecking


Sure, a good Core i5 is going to be more than you'll ever need for regular gaming.

That is until you actually decide to play one of a huge variety of surprisingly CPU intensive games.


For reference, I have a relatively high end Core i5-4690 paired with a GTX 970 with a 144 Hz monitor and according to post after post online I should never run into any CPU bottlenecks because single core performance doesn't get much better and games don't really use that many threads. Right?

Anandtech's benchmarks say that my processor is the best CPU based on the Haswell architecture or earlier to run a game like Battlefield 4 with a similar GPU to mine.

Tom's hardware remarks:

"Top-end CPUs offer rapidly diminishing returns when it comes to gaming performance. As such, we have a hard time recommending anything more expensive than the Core i5-6600K"

TechSpot benchmarks show no significant difference in Battlefield 4 performance with a 290X between a core i3-3220 and a core i7-4960X.

Logical Increments still recommends a similar caliber CPU to mine (Core i5-6600) for GPUs a decent bit more powerful than mine such as a R9 Fury.

And /r/buildapc notes in their wiki:

"[i5s] are currently the most popular CPU for high end gaming as the performance benefit of an i7 is negligible and not worth the price increase for many people."


After reading these comments from a large variety of very reputable sources in the PC building community one might be inclined to purchase a $200-$250 Core i5 rather than dishing out another $100 for a "negligible" performance improvement in "high end gaming".

The problem is that in everything I've tested in extremely popular games such as Battlefield 4, Rainbow Six Siege, Grand Theft Auto V, and Civilization V prove that my processor is woefully inadequate for the task.


Some anecdotes from my experience include Battlefield 4 running at roughly the same frame-rate (within 5%) running at the minimum preset verses the high preset. Looking at the Rivatuner overlay I see that on minimum settings my GPU is running at <60% usage the entire time. This is the clear marker of a CPU bottleneck.

Playing Rainbow Six Siege results in similar trends. I am unable to push the frame-rate of the game above about 125 Fps at 1080p regardless of the settings I choose. Another notable symptom is the fact that all four cores of my Core i5-4690 are pinned at 100% CPU usage the entire time I'm playing the game.

Civilization V takes its sweet time to process the AI once you get a few turns into a game.

Also, Grand Theft Auto V which was released initially in 2011 refuses to run over 100 Fps on my computer no matter what I've tried.

God forbid I try to download something in Steam when I play Battlefield 4 because instead of 100-150 Fps, I'm suddenly running a stutter filled mess at less than 45 Fps.


I've attached some screenshots in Rainbow Six Siege below with a RivaTuner overlay.


I also have reports from others like /u/UN1203who remarks that:

"Hey so the results are in and I have to say I was wrong, and you might be on to something. I was seeing FPS scaling all the way up to my max overclock of 4.8ghz on a 6600k. Here are the pics for you.
2.5ghz
3.5ghz
4.8ghz

I could not get back to the same spot for screenshot 3 because the map had changed, but I picked the spot on the map where my sustained fps was the lowest.
Ultimately I don't really remember what it was like to play BF4 at anything under 4.4-4.5ghz and I didn't figure it would scale at all after the 3.9ghz your chip puts out but it certainly does. So it looks like it's upgrade time for you my friend. Get more cores or get to overclocking... If cost is not a major concern for you as you say, wait for the broadwell-e to drop, put that bitch under water, and let her stretch her legs at 4.5ghz+, that will be an absolute monster. And with BF5 coming out soon you will want all the firepower you can get."

I'm stuck with this huge disparity between the information I'm given and the results I'm experiencing and finding the solution for this beyond my knowledge. I see massive stagnation in the high end enthusiast processor market with Broadwell-E failing to improve the performance per dollar rate over Haswell-E and even failing to improve maximum performance when overclocking according to a decent number of reports.

I guess I'll try upgrading to a core i7-5820k and hope that does the trick and I'll let you guys now how that turns out.

Thanks for reading.

Edit:
Some people are asking for a full spec. list so here it is:

Intel Core i5-4690
GTX 970
Windows 10
16GB 1866MHz DDR3

Edit 2:

I've read comments talking about how clearly I'm an idiot and there must be some other program in the background ruining my performance, Windows 10 is the spawn of Satan and idles the processor, and that I should just be happy getting around 100 Fps and just give up on expecting a locked 144 Fps on new games. I love how people love to condescend and spout "user error" on anything that makes them consider some other person's reality.

My response is simple, I'm not content with "good enough". I want and expect great performance with great hardware and I value smooth and responsive game-play above all else.


I understand that adaptive-sync will help but 100 Fps is 100 Fps. I want 144 Hz or higher.

I'd also like to clarify that BF4 stuttering while downloading from Steam is entirely due to CPU usage. I'm downloading to a different drive, my internet is fast enough, and I have more than enough RAM.