Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How do you actually record smooth gameplay at 1080p60fps or any resolution/framerate? [SOLVED]

Discussion in 'General Discussion' started by TwiiK, Dec 2, 2015.

  1. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    I've tried both OBS and Shadowplay so far and they are both too choppy for my liking. Shadowplay looks the smoothest, but even at the highest quality setting the compression look a bit S*** in my opinion. OBS lets me save uncompressed video, but it chops like a bastard. :p It's choppy no matter what settings I use for that matter.

    I don't get where the choppiness is coming from. Either application is barely using my CPU when recording. My GPU is a 680 GTX. I'm not really sure how to see if it's working overtime or not, but it usually starts making noise when it is and it's quiet now. :p

    I've also tried recording to different harddrives, including standard drives and SSD's. This makes no difference at all from what I can tell. And whether or not I'm recording to the same drive as the game is on doesn't seem to matter either.

    Lowering the resolution and framerate helps, but it's never smooth like it is ingame.

    The game is just a simple scene and it's running at thousands of frames per second.

    My goal here is just to learn how to create solid looking gifs/gifvs and Youtube videos. So far I'm failing completely. I haven't even gotten to the gifs yet. I thought recording smooth video was a solved problem by now. I want something I can quickly use to record gameplay so recording out individual frames and compositing them in post is out of the question. That would also mean I lose my game audio.

    Big Youtubers probably use dedicated hardware to record their gameplay, but is it impossible to do with software alone? Or is there a bottleneck in my system?

    I will also try recording other games or just my desktop as well to see if Unity is the problem. Getting Unity to work with Shadowplay was kind of a pain in the ass as well and it seems to stop working if you alt-tab.

    Edit: I think I've solved this. Information in the later posts.
     
    Last edited: Dec 3, 2015
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Video capture card. Even a cutting edge pc will chug on windows.
     
    Martin_H likes this.
  3. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    why 60fps?

    never had a problem with 30.
     
  4. MaxieQ

    MaxieQ

    Joined:
    Nov 1, 2012
    Posts:
    295
    There are two versions of OBS. One multi-platform which doesn't, as far as I can tell, use your hardware (if you have an NVidia card) and one exclusively for Windows which does. Since you mention Shadowplay, I assume you are on Windows. If you have an NVidia card, get the other, older one. Not the multiplatform one. Then you can set OBS to record using NVidia encoding. Ie the hardware.

    But, like others have already mentioned, why use 60fps? You're making a video, not playing a game. If you're going to upload to youtube, the site will 'downgrade' your video to 30fps anyway.
     
  5. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,015
    In my current game, I get over 400 fps at 1080p using ShadowPlay with a GTX780. ShadowPlay does cut the frame rate a little bit, but only a very tiny amount. I have spent quite a bit of time optimizing my game to get the high frame rate.

    One thing I have noticed is that the video I make with ShadowPlay is smoother than the 1080p60fps video after YouTube processes it. It still looks smooth on YouTube, but never as smooth as the original video.
     
  6. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,015
    I strongly prefer watching video at 60 fps instead of 30 fps. Gameplay videos at 30 fps often look slightly jerky to me, like things are suddenly jumping to a different location instead of moving smoothly.
     
    spajus likes this.
  7. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    if its jerky/jumpy I doubt its the video at fault. That jump/jerk will be in the vid.
     
    theANMATOR2b likes this.
  8. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    60fps is pretty much the standard for gameplay footage these days and Youtube doesn't downgrade it. It has supported 60fps for a long time.

    But why? What is the bottleneck? I'm barely using 10% CPU. Is the GPU the bottleneck?

    Turning on Vsync in Unity actually helped a ton. I think there's hope. Perhaps rendering thousands of fps wasn't the smartest. :p

    I will check to see if I can find a different version of OBS as well.
     
  9. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    bottle neck is most likely the constant disk writing.

    Its not done in virtual memory since a takes a very small time for a video to become very large. Especially @60fps 1080 res
     
  10. Eliotz

    Eliotz

    Joined:
    Jul 18, 2015
    Posts:
    81
    No its not the videos fault. Youtube will make the video look a bit laggy if its at 30 fps.

    Also I dont see any problem with shadowplay. Just crank up the the bitrate slider (which is under Quality > custom) and crank it up to 130. Should give you a good enough quality. At least for Youtube because the youtube compression is way worse than you get on those settings in shadowplay. People wont notice the difference. Shadowplay can definetly dish out good enough quality for youtube. Im on GTX 960 and at least for me I can get good and smooth quality out of it.
     
  11. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    @JamesLeeNZ Recording lossless which writes nearly hundreds of megabytes per second or recording highly compressed video seemed to make no difference in how choppy it was. It would be weird if that was the bottleneck in both situations, I feel. And this was to my SSD which is a separate disk from the one the game is running from.

    @Eliotz Ok, I need to check it again then. When I switched to custom in Shadowplay it was at 50 bitrate and it looked like that was max. But recording in Shadowplay required me to set specific, not recommended, build settings inside Unity which was a hassle and I couldn't get it to work at all if my game was running in windowed mode. OBS just worked perfectly in any situation. And it has great settings for hiding the mouse cursor etc.

    I realize I already have the dedicated Windows version of OBS, but I didn't try the Nvidia encoding. There's a lot of videos and guides on how to record 1080p60fps footage using OBS and some of them are years old so I feel it should be possible for me to do it with what was considered state of the art hardware years ago. :p

    Guess I need to fiddle some more with it. Thanks for all the input.
     
  12. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Christ. I think the problem is with VLC. I thought I made sure VLC handled 1080p60fps videos just fine by downloading a couple of videos and samples before I started and testing them in VLC to make sure they both looked good and so I knew what I was aiming for, but perhaps my recorded videos are encoded using codecs VLC is not happy with or something? I went back and looked at my videos with Media Player Classic and they are all smooth. Friggin' hell. :p

    At least I now know where to go from here. I thought it was weird how it was so choppy when nothing on my system seemed to be stressed.
     
  13. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    I can't believe it. Another problem seemed to be that I lied. I was always recording at 1920x1200 because I'm one of the old farts who still has a 16x10 monitor. I didn't think that would make any difference and that it was something I could sort out later, but when I changed it to record at 1920x1080 it seemed to make a massive difference. I can now record basically lossless video in realtime at 1080p60fps and it's perfectly smooth. It looks like it does ingame.

    This is amazing.

    And after updating my VLC to the latest version (because it was *cough* very old) it now plays the video just as well as Media Player Classic does.

    Guess I'm marking this as closed. Let's just hope it still works when I get home from work tomorrow. :p I've practically spent the entire day on this.

    To summarize for anyone else stumbling in here:
    1. Vsync didn't seem to make a difference regarding performance after all, but it's of course nice to not have tearing in your recorded video.
    2. The less compression I put on the video the smoother it became. Leading me to believe compressing the video is a lot harder for the software than actually saving it to disk.
    3. Make sure you have the latest video player if you want to preview your 60fps video. :p
    4. Record at a standard format like 1080p and not 1200p. :p
    5. I could not get the Nvidia NVENC encoding to work inside OBS so I recorded using the default x264 instead, but it seems to be working perfectly now, finally.
    I use mostly the same settings as this guy, although I use a much higher bitrate which is contrary to what he says about stuttering apparently:


    Here's my initital result on Youtube:


    I think it looks pretty good. I'm sure I can tweak it to look better after some trial and error.
     
    Kiwasi and JamesLeeNZ like this.
  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    I've been uploading several gaming videos myself to youtube over the last couple of years, and I made countless experiments on compression, bitrate, resolution, framerate, etc. The conclusion I came to is that youtube just destroys your video no matter what you do. I even tried uploading totally uncompressed video (almost 50 GB for a minute of 1440p60fps video) directly, but the quality that ended up on the video was just as bad as uploading a video with 20 mbps bitrate. Unless you're going to keep the originals (which I doubt you'll have space for uncompressed), the quality of shadowplay capture should be more than enough to upload to youtube and don't see a difference between that and uncompressed capture.

    Oh, and btw, shadowplay allows me to up the recording bitrate to 130 mbps - doesn't it let you do that?
     
    Aiursrage2k likes this.
  15. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    @Tautvydas Zilys Thanks for the insight. I'll try some various settings in both applications and see how they look on Youtube.

    But yeah, I'm unable to choose 130mbps in Shadowplay. I double checked after Eliotz said the same thing, but 50 is max for me. But like you say it may be enough, but I also can't stand Nvidia software. :p Shadowplay was about the worst application I've had to fiddle with in recent memory. There's basically no settings, it's all custom styled and not using the default Windows look, and it's all extremely sluggish to interact with. And it keeps running after you close it. The ability to hide the mouse pointer like in OBS would have been nice for example.

    But the main problem was that it didn't actually work properly with Unity. How do you circumvent this? Or are you using it to record gaming videos from other games? :) It can't record games played in windowed mode and only if I set the player settings in my game before I build it to fullscreen exclusive mode, force single instance and some other not recommended settings would it record my game in fullscreen mode. And only until I alt-tabbed, after that it would stop working completely. I'm pretty sure windowed mode is what I'll be using the most for my games. Preferably I would like to record them straight in the editor if I'm able to make that work. This is just going to be used for quick showcases of what I'm currently working on etc., but at the same time I'm a bit obsessive and I want them to look as good as they can. :p

    My main goal here is smooth 60fps video. The quality isn't the top priority, but like I said it seemed like using a higher quality led to a smoother video in OBS. And from my experience double compressing a jpg leads to a worse result than compressing it once. I have no experience with video compression, but my initial assumption was that starting with an uncompressed video also led to a better result than if you used an already compressed one. I could be completely wrong of course. :p The above video was recorded at about 100mbps. I'll try a lot of different variations today after work.
     
  16. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    I definitely never recorded Unity :).

    You should be able to enable windowed mode recording in shadowplay settings:

     
  17. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    That option is completely disabled for me. I found a registry hack you could do to enable it, but it seemed not to work. I guess my Shadowplay is broken. :p I'll investigate that at the same time I experiment with quality settings.
     
  18. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    What OS are you on?
     
  19. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Windows 7 64-bit. Can't remember the version. Home premium or Ultimate, I guess.
     
  20. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    I wonder if it's Windows 8+ feature. I had it working on Windows 8.1 and 10. Haven't used Windows 7 for a few years...
     
  21. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,951
  22. tango209

    tango209

    Joined:
    Feb 23, 2011
    Posts:
    379
  23. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Yeah, Aero is disabled.

    Re-downloaded Geforce Experience and Shadowplay is still broken. Seeing as it was so hard to use with Unity anyway I'm skipping it for now and sticking with OBS. But I'm putting all this on hold until it becomes time for me to actually render my video. Then I will probably experiment some more with various settings etc.. At the moment I'm still struggling inside Unity. :p
     
  24. rorakin3

    rorakin3

    Joined:
    Jan 2, 2013
    Posts:
    464
    I recorded quite a few gameplay youtube vids back in the day, and I always used bandicam. It's performance for me was just better than the alternatives such as fraps. You can use it record desktop instead of just games now as well. I would recommend giving it a try, the free version has a watermark in the top center.
     
  25. Games-Foundry

    Games-Foundry

    Joined:
    May 19, 2011
    Posts:
    632
    I know this topic has been marked as solved, but I thought it worth sharing my own experience. We did quite a lot of research to support 1080p60 live streaming, and the same technique can be applied to recording footage for editing.

    For a while we were capturing on the same PC as playing Folk Tale. There's a CPU overhead in doing so, and sometimes it would drop below 60FPS on max settings with vsync (machine was CPU bound). So I looked into it, and found that using an external capture card on a different PC was the way to go. Feasible for us as we had a second machine available.

    I use an Elgato Game Capture HD60 USB 3.0 plugged into a second PC running XSplit (OBS should work just fine too). The HDMI output from the gaming PC runs into the HD60, then out into my play monitor. Using this setup we're able to broadcast to YouTube and Twitch simultaneously (using FTTC fibre broadband). Alternatively, we could record a local copy at much higher quality, and use that for editing into videos.

    Here's a sample of one of the live streams. Bear in mind this is broadcasting to YouTube at around 10Mbps, so the quality is much lower than if you are recording locally (where you'd want 50-100Mbps):



    Here's a similar video over on Twitch. We broadcast at something like 3Mbps, and the final quality is still better than YouTube for post-stream viewing:

    http://www.twitch.tv/gamesfoundry/v/27627201?t=24m09s

    Echoing Tautvydas Zilys' post above, tinkering with lots of settings I'm still left with the opinion that YouTube simply wrecks your video no matter what the source video quality is. The quality on vimeo is better, but the service isn't as popular (and discoverability is important!). For streaming, the quality of post-stream videos on Twitch is better than YouTube, but YouTube for live streaming has fewer buffering dropouts and you don't have to be a partner for viewers to get the QoS settings.

    The next step is to research how to achieve 4K60 either using DP or HDMI 2.0. It's still way out of reach for most folks, but it's good to be ahead of the curve when it comes to marketing assets. At the moment I think the cost will be prohibitive so we may not make the jump. We'd probably need 15K RPM SATA drives for recording rather than SSD (which are optimized for reads and slower for writes), dual if not triple 980 Ti GPUs, and a new capture card.
     
    Last edited: Dec 13, 2015
  26. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Thanks for the detailed reply.

    I'm still not finished with the project I wanted to record, but I've also realized that having a dark "realistic" project where the camera is constantly rotating is pretty much the worst possible scenario for video compression. But I've experimented a bit trying to record gameplay from simple colorful games similar to what you're showing here, where there's not constant movement and I feel like I'm getting there. It's looking crisp and smooth. One issue I still haven't solved is color saturation. My recording is less saturated than the actual game. I've compared my recording to other people who have recorded the same game on Youtube and they have correct colors. My colors are too desaturated. Not by much, but I'm extremely anal about everything like that so this isn't completely solved yet. If I'm not able to do it as well as someone else then I'm not giving up. :D I will experiment with video drivers and different recording software to see if that makes a difference in color saturation.

    I'm not going to invest in a video capture card or anything like that yet. This is just to capture simple gameplay clips from the projects I work on etc. so quality isn't actually that important, it's just that I want to learn how to have a somewhat optimal setup before I start doing it. I enjoy that sort of tweaking. :p

    It's possible to get super crisp videos on Youtube in my opinion, but it depends on how compression friendly your source material is, I guess. This is from a gun channel I follow:


    After they got their new camera their videos have been some of the sharpest I've seen on Youtube. Shooting slow moving footage outside in daylight is probably ideal, but the result is at least really nice. I feel it's hard to see any noticeable compression in that video.

    That channel is also easily one of the best references for making any games involving realistic gunplay, if you don't have access to guns yourself. :p
     
    theANMATOR2b likes this.
  27. Games-Foundry

    Games-Foundry

    Joined:
    May 19, 2011
    Posts:
    632
    Last edited: Dec 14, 2015
  28. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    @Games Foundry I haven't learned anything more about the saturation issue, but for me it is barely noticeable so if you say the videos are much lighter and less saturated then it has to be something else. I only notice my issue in a direct comparison. For that reason I haven't spent more time on it, I'm afraid, it's just such a tiny issue. :p

    Anyway, I ended up spending so much time on this that I decided to write an article detailing my efforts. You can check it out here:
    http://twiik.net/articles/recording-high-quality-videos-with-open-broadcaster-software

    The article is about recording 1080p60fps videos for Youtube and also how to create gifs (that are not actually gifs) from those videos using gfycat. This was all I wanted to achieve as I now have the tools necessary to showcase whatever I'm working on in Unity. I'm hoping this can benefit others as well.

    Over the last couple of weeks I've probably uploaded hundreds of videos and dozens of gigabytes to Youtube trying out different settings and setups, but I'm fairly happy with the end results.
     
    eses likes this.
  29. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    That's massive! That's a bitrate of 130-140mbit. Youtube only recommends 7.5mbit for 720fps @ 60fps You even use over twice what they recommend for 4k resolution @ 60fps. :p

    If it works for you and you have no problem uploading 2GB files then by all means keep at it, but I'm sure you can get away with a fraction of that and still have the exact same video quality on Youtube.

    I use a variable bitrate so a 2 minute 1080p60fps video for me can be anything from a couple dozen megabytes to a couple hundred megabytes depending on what I'm recording. But I think my max bitrate with the settings I described in my article is around 50mbit so that's almost one third of what you're using and that's for 1080p.

    On a side note, I haven't tried recording anything cpu intensive yet. Anything I make in Unity probably won't be, but if I were to record something like a AAA game I probably will have to drop down to 720p or 30fps. We'll see.
     
  30. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Even if you have a higher bitrate, youtube will compress it, but its also better to upload a 720p video @60fps then 30fps (even for 30 fps footage), higher frame rate makes youtube play at a higher bitrate.
     
  31. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    Well obviously, but bitrate is measured in bits per second and fps is measured in frames per second. With an uncompressed video if you double your framerate you would need to double the bitrate for the video quality to remain the same. The way video compression works means this isn't true though. What the guy in your video shows is pretty much what Youtube lists in their help files:
    https://support.google.com/youtube/answer/1722171?hl=en

    I.e they give you about a 50% increase in bitrate if you increase the framerate from 30fps to 60fps. Whether or not that results in a higher video quality depends entirely on the video in my opinion. If your video compresses very badly from frame to frame then the 30fps version with 50% less bitrate might look better than the 60fps version.

    But anyway, I'm used to 60fps so 30fps will automatically looks worse for me.
     
  32. woodsynzl

    woodsynzl

    Joined:
    Apr 8, 2015
    Posts:
    156
    Well I think I record in raw usually, I don't tend to compress my videos. A bad habit that I'll struggle to shake. But to be honest, with ultra fast fibre optic, uploading a 2GB file only takes around 7-15 minutes.