How to Record and Encode 4K Video?

Baasha

Golden Member
Jan 4, 2010
1,989
20
81
Here is the situation. I want to record gameplay at 4K resolution (4096x2160) and 30P (30 FPS).

I just downloaded Dxtory for the first time and also installed the x264 codec (64-bit and 32-bit since I'm running a 64-bit OS). The settings for the codec are a bit confusing since I haven't done this before.

I set the recording in Dxtory to "30 FPS" and set the "Scaling" to "Size" and '4096x2160'. If I set it to 100%, I would get 5160x2560 which is much higher than 4K and frankly unnecessary for 4K video.

I am recording to my SSD RAID-0 array which can write @ 2.7GB/S.

So what are the best settings for recording 4K gameplay using Dxtory and x264 codec and what are the best settings in Handbrake (for x264) to encode/render the video?

Thanks in advance.
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
If 5160x2560 is what you are playing at, that's what you should record at, if you are going to transcode it later, to use the minimum CPU and GPU time for the raw recording.

If you are using Intel motherboard RAID 0, make a point to enable write-back caching, for best performance. If WIndows software RAID (as available in Pro or Ultimate), just make sure you've got some spare RAM (either way, if you're not running with 12-16GB and a HT-enabled CPU, you're probably going to have issues with recording).

No clue about x264 settings.

P.S. 2.7GB/s? What do you use for an HBA, or RAID card? Or, what PCI-e SSDs? I just realized that that is pretty much impossible with Intel RAID, since it would take 6 top-of-the-line non-SF SSDs, and Intel's RAID never seems to give full bandwidth, with many drives.
 
Last edited:

JAG87

Diamond Member
Jan 3, 2006
3,921
3
76
5160x2560 (wtf kind of configuration is this?) is not going to re-size nicely to 4096x2160, even using the best re-sizing algorithms (which will take AGES to do this). Also that is not 4K display resolution, encoding to that resolution will ensure that NO ONE will watch your video without re-scaling it again. The resolution you want is 3840x2160, and that is still not a good re-size ratio. Like it's been said, record at native resolution, and you may want to consider cropping the original video to fit the proper 4K display resolution. That will maintain the most detail.

As far as encoding, there are too many settings to go through to improve your x264 encode and consume your CPU time. Here you go: http://mewiki.project357.com/wiki/X264_Settings

By far the fastest way to increase quality is to just pump the bit rate. If size is not an issue of course. For that resolution, I would start at a minimum of 50 Mbit, encode a sample, check, and work my way up. Of course it all depends how many ref frames your video need and what the content of the video is.
 

Phynaz

Lifer
Mar 13, 2006
10,140
819
126
I'd bet you can't do realtime frame capture on a PC at that resolution without dedicated capture hardware.
 

Dankk

Diamond Member
Jul 7, 2008
5,558
25
91
I'd bet you can't do realtime frame capture on a PC at that resolution without dedicated capture hardware.

This. Trying to record and encode footage in real-time with a resolution that huge is going to be messy. If getting high-quality footage is that big of a priority, you might as well buy a dedicated capture device.
 

Baasha

Golden Member
Jan 4, 2010
1,989
20
81
If 5160x2560 is what you are playing at, that's what you should record at, if you are going to transcode it later, to use the minimum CPU and GPU time for the raw recording.

Okay, I understand. It was mentioned that Dxtory allows you to capture at a different resolution than what you are playing at and that is why I set the capture "Size" to 4096x2160 (4K). The question really is whether playing at my native resolution (5160x2560) and recording at that resolution would tax the PC more than playing at the native resolution and recording the gameplay at 4K resolution. If that is indeed the case, wouldn't capturing at a different (smaller) resolution be better? I will give this a shot, however.

If you are using Intel motherboard RAID 0, make a point to enable write-back caching, for best performance. If WIndows software RAID (as available in Pro or Ultimate), just make sure you've got some spare RAM (either way, if you're not running with 12-16GB and a HT-enabled CPU, you're probably going to have issues with recording).

No clue about x264 settings.

P.S. 2.7GB/s? What do you use for an HBA, or RAID card? Or, what PCI-e SSDs? I just realized that that is pretty much impossible with Intel RAID, since it would take 6 top-of-the-line non-SF SSDs, and Intel's RAID never seems to give full bandwidth, with many drives.

Write-caching is enabled on my SSD RAID-0 Array (you are not talking about write buffer flushing right? - That's not checked --> It's OFF). It is a software RAID through Windows (have Ultimate) and the results are generally fantastic. I am also running 32GB @ 2133Mhz CAS-9 (9-9-9-24).

Regarding the read/write speed, I am running 8x Vertex 4 SSDs in RAID-0 using the on-board LSI 2308 controller on my motherboard (ASRock Extreme11).

This array is for my games/programs. I am also recording to this drive since my OS drive is just 2 ForceGT SSDs in RAID-0 with a much slower read/write speed.

Performance of the 8x SSD RAID-0 Array:
2820t4j.jpg
 

Baasha

Golden Member
Jan 4, 2010
1,989
20
81
5160x2560 (wtf kind of configuration is this?) is not going to re-size nicely to 4096x2160, even using the best re-sizing algorithms (which will take AGES to do this). Also that is not 4K display resolution, encoding to that resolution will ensure that NO ONE will watch your video without re-scaling it again. The resolution you want is 3840x2160, and that is still not a good re-size ratio. Like it's been said, record at native resolution, and you may want to consider cropping the original video to fit the proper 4K display resolution. That will maintain the most detail.

As far as encoding, there are too many settings to go through to improve your x264 encode and consume your CPU time. Here you go: http://mewiki.project357.com/wiki/X264_Settings

By far the fastest way to increase quality is to just pump the bit rate. If size is not an issue of course. For that resolution, I would start at a minimum of 50 Mbit, encode a sample, check, and work my way up. Of course it all depends how many ref frames your video need and what the content of the video is.

My resolution is 3 30" monitors in 3x1 Portrait Surround with bezel correction; that is why it is 5160x2560 (instead of the default 4800x2560).

Also, the resolution you have pointed out is UltraHD or UHD, NOT 4K! 4K is 4096x2160.
 

Baasha

Golden Member
Jan 4, 2010
1,989
20
81
I'd bet you can't do realtime frame capture on a PC at that resolution without dedicated capture hardware.

Actually, I can. The only problem is the FPS dips to <20 (15 - 20) when I'm recording @ 30FPS (setting in Dxtory).

The only other issue is, my SSD array can do 2.7GB/S. Using a lossless codec, it did about 10 seconds and was ~ 3 GB, so ~ 300MB/S. That's nowhere near the limit of the SSD array.

That's my problem; I want to be able to record gameplay at a constant 30FPS.
 

Baasha

Golden Member
Jan 4, 2010
1,989
20
81
Doesn't that just reinforce what he said?

Well, not technically. :) I can still record it; it's just 'slow'.

Also, the main issue is why is recording slow when the SSD RAID-0 array can read/write so fast? If at all there should be a bottleneck, it should be at the hardware level (usually hard-drive). I've eliminated this using the RAID-0 array.


Where are you expecting to show off this 4K footage?

A particular website. :whiste:
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
Regarding the read/write speed, I am running 8x Vertex 4 SSDs in RAID-0 using the on-board LSI 2308 controller on my motherboard (ASRock Extreme11).
Nice :thumbsup:. I was mostly curious, because it occurred to me that such speed would be almost, if not absolutely, impossible, with Intel, unless maybe the new 8-series boards actually give full bandwidth per port.

That's my problem; I want to be able to record gameplay at a constant 30FPS.
For that, you'll almost certainly need dedicated hardware that intercepts the monitor's signals. It's not your SSD that's the bottleneck, but either the OS scheduler, the CPU cache, the RAM itself (and no, faster RAM wouldn't help much, just a wee little bit), or GPU time, if the GPU waits for the frame to be fully copied before doing anything with the next. Moving that much data around involved the CPU's memory controller, and it's going to work by reading and copying many small buffers. Even using DMA, there's still CPU time, and CPU and GPU bandwidth, being used to make the copies. If you were saving to a single SSD, or a small array of Sandforce SSDs, the storage could be a bottleneck. You've done that right, however.

I wouldn't be surprised if future CPUs w/ DRAM caches could help this kind of thing out a lot, but even 1080P recording seems to benefit from many-core Xeons w/ 10+MB L3, and this is much more data. I'm not sure that it can't be done, but I would be greatly interested to know what hardware, and what performance tweaks, allowed it to be pulled off, if you ever got it going at >=30FPS all the time.
 

Baasha

Golden Member
Jan 4, 2010
1,989
20
81
Nice :thumbsup:. I was mostly curious, because it occurred to me that such speed would be almost, if not absolutely, impossible, with Intel, unless maybe the new 8-series boards actually give full bandwidth per port.

For that, you'll almost certainly need dedicated hardware that intercepts the monitor's signals. It's not your SSD that's the bottleneck, but either the OS scheduler, the CPU cache, the RAM itself (and no, faster RAM wouldn't help much, just a wee little bit), or GPU time, if the GPU waits for the frame to be fully copied before doing anything with the next. Moving that much data around involved the CPU's memory controller, and it's going to work by reading and copying many small buffers. Even using DMA, there's still CPU time, and CPU and GPU bandwidth, being used to make the copies. If you were saving to a single SSD, or a small array of Sandforce SSDs, the storage could be a bottleneck. You've done that right, however.

I wouldn't be surprised if future CPUs w/ DRAM caches could help this kind of thing out a lot, but even 1080P recording seems to benefit from many-core Xeons w/ 10+MB L3, and this is much more data. I'm not sure that it can't be done, but I would be greatly interested to know what hardware, and what performance tweaks, allowed it to be pulled off, if you ever got it going at >=30FPS all the time.

Well, FWIW, I just recorded a 5 minute video of BF3 (TDM Canals 64-player MP) using the x264 codec @ 4K (4096x2160) and the file is 3.66GB. It was mostly around 22 - 25 FPS which is not terrible but it was rather unplayable for me; I'm used to 85FPS average on my rig in BF3 and I couldn't even aim properly! :eek:

The video looks pretty good for 4K. The strange thing is that the first day I installed Dxtory (about 2 days ago), I downloaded the Lagarith Lossless Codec and recorded at native resolution (5160x2560) @ 60FPS! The amazing thing was that it held those frames pretty good and created a HUGE file (~ 3 minutes = ~ 20GB)! :D

However, I am not able to replicate that scenario no matter what I do now. Even 30FPS is a struggle.

Did you take a look at that clip I posted? That was with the x264 codec and used Handbrake to render it (no effects etc.).
 

Baasha

Golden Member
Jan 4, 2010
1,989
20
81
This. Trying to record and encode footage in real-time with a resolution that huge is going to be messy. If getting high-quality footage is that big of a priority, you might as well buy a dedicated capture device.

Can you suggest what capture device I could use? I don't have any PCI-E slots left in my motherboard due to my GPU setup (4-Way SLI).

I have a secondary computer (X58 w/ 990X @ 4.4Ghz and 1 GTX-680 Classified and 12GB 1600Mhz RAM). Is there any way I can hook that up to this (main) computer and have it 'act' like a capture device? Would like some advice/suggestions on this.

Thanks.
 

notty22

Diamond Member
Jan 1, 2010
3,375
0
0
Have you investigated if this new hardware feature Shadowplay is configurable enough to do what you want?

http://www.pcgamer.com/2013/05/28/shadowplay-like-sky-plus-for-pc-gamers/

That&#8217;s not a bad description given that it&#8217;s a future function in the GFE app that allows you to set ShadowPlay to continuously record anything up to the last 20 minutes of any gaming session. You can choose resolution and audio settings to suit and because it&#8217;s mainly a hardware based recorder it minimises the performance hit on your machine while it&#8217;s doing it.
Nvidia are estimating that it should only represent around a 3% performance hit depending on your settings, and supposedly doesn&#8217;t have any impact on frame times either.
ShadowPlay builds on the way SHIELD taps into GFE to stream content from your gaming rig by utilising the H.264 encoder built into the Kepler GPU. Sadly then that means only GTX 600 series cards and up will be able to use the feature
It&#8217;s really tapping into the burgeoning YouTube and Twitch TV gaming audience, making it easier for GeForce owners to record HD gaming and get it out there, as long as they have a Kepler GPU or above of course.
 

Baasha

Golden Member
Jan 4, 2010
1,989
20
81

Thanks for those links. However, I cannot use any PCI-E cards since I have no space left on my mobo - I am running 4x EVGA GTX-Titan SCs in 4-Way SLI (taking up 8 PCI-E slots since each card is 2x wide).

The other factor is I'm running 3x Dell U3011s in 3x1 Portrait Surround so I have 3 DP cables running from the GPUs to the monitors. There isn't "one" signal that sends 4K resolution (or in my case 5160x2560) to the monitor for me to be able to connect it to those cards above. Some of them have HDMI inputs which is strange since I thought HDMI still cannot do 4K(?).

The question is, how would I pass the video/audio signal (basically the videogame data) to the 4K capture card? And then from there, how would it connect to my SSD array to record in real-time?

The only possible option for me is to use my secondary system (X58 rig) where I have plenty of PCI-E slots open and use one of these cards and the system itself as a pass-through of some sort.

How would I go about doing this? Is there a specific way for me us a second computer to do the real-time capturing while I play the game at the resolution I'm using?

I tried "RawCap" today, an option in Dxtory, and was able to get around 25FPS rather consistently; I then used those RawCap files to build a single AVI file containing the 4K video (4096x2160). A 5:16 4K video encoded using x264 on a Level-20 Quantizer (option) put the file size around 3.8GB. Not bad, I would say.

Yet, I am really looking for a solution where I can play at whatever FPS I get (usually well over 60FPS) and record at a constant 30FPS (60 would be fantastic but I don't want to be avaricious) at 4K resolution.

I am willing to use my X58 rig, with a GTX-680 Classified (4GB VRAM) and a GTX-650 Ti SSC (PhysX) as well as an OC'd i7 990X @ 4.4Ghz as a 'pass-through' capture rig - if what I want can be achieved. Is this feasible? I am even willing to buy one of those 4K capture cards if needed.

I would appreciate some more advice on this.

Thanks.
 

Baasha

Golden Member
Jan 4, 2010
1,989
20
81
Have you investigated if this new hardware feature Shadowplay is configurable enough to do what you want?

http://www.pcgamer.com/2013/05/28/shadowplay-like-sky-plus-for-pc-gamers/

I heard about Shadowplay recently. I'm looking forward to trying it out but if I understand it correctly, most of the encoding is done by the GPU which will already be stressed out by the gameplay so I would wonder what kind of stuttering/bottleneck that could create.

I tried recording BF3 @ my resolution in Windowed mode and had Task Manager open to see what the CPU usage was during recording with Dxtory and x264 codec. It hovered around 18 - 20FPS and the CPU usage was not even around 50%. Something is fishy there(?). I have 32GB of RAM and hoped that that could be used to accomplish what I want here.