Question / Help Optimizing stream and archival quality footage for Twitch in OBS?

Compdude

New Member
Hi Guys, I bulleted my question.
  • Introduction:
    • My question regards how to maintain optimal streaming quality on Twitch while also retaining a high-quality but optimized file size of recordings for archival footage purposes.
    • I apologize, I am learning the lingo, so if I make terminology mistakes, my bad. Also, my question is lengthy because I was trying to think of most of the pertinent variables, and there is a LOT to take in in OBS’s settings.
  • My setup currently:
    • My videos are broadcasted on Twitch, and also locally recorded to disk. My resolution is 720p60fps. I chose this because I do mostly first person shooters and Poker, where frame rate is important but 720p is sufficient resolution.
    • For the stream, I encode at x264/software/cpu (henceforth called x264) and 2500-3500 bitrate, CBR. Encoder setting veryfast.
    • For local recordings of same stream, I encode at h264/hardware/NVENC (henceforth called h264). Indistinguishable quality size, format mkv.
    • My desire is to provide the lowest practical bitrate but highest quality for streamers, while also retaining a high-quality copy where file size is initially unimportant. I would also like to not be taxing my CPU at 100% constantly if possible.
    • My hardware: i7-7700k overclocked to 5.0 ghz with a 240mm watercooler, GTX 1080, 16 gb ram (never saturated), 6 mbps upload speed, an NVME running my OS and games, and a fast SSD overkill for dumping raw footage too, later transferred to an on-network Network Attached Storage (NAS) for long term storage.
  • My concerns:
    • Even for a nearly 10-year-old game such as Left 4 dead 2 for example, at these settings I max out my CPU at 100% and the game runs, at max in-game settings, at about ~55 fps with heavy action.
    • H264 files have very high bitrates and ergo file size. At this quality we’re talking 18000 kbps bitrate, which I understand is not astronomical, but it still makes a 2 hour gae video approximately 13 gigabytes, which in long term will be untenable on my storage solution. I want to find a way to reduce this file size AFTER the fact.
  • My questions:
    • Am I correct in my encoder choices as I described? I was told by researching other threads to stream x264, and record h264. Does this setup maximize:
      • x264 gives client stream god quality at minimal bitrate d/l cost to them?
      • h264 gives Low-loss recording on-the-fly to disk for my local files?
    • If I’m already sending the stream an encoded x264 filestream to Twitch, wouldn’t it be “trivial” for OBS to simply save the exact same filestream to my local disk at the same time?
      • I think this is why OBS has the “same as stream” option, correct? Is this good enough?
      • Is h264 still a good option then?
    • OK, so then _if_ h264 is the way to save to disk, then:
      • First, I want the raw video file I save to be as high-quality as possible. What should I set my encoder to, to have a good quality raw footage? High quality, or say indistinguishable?
      • And should I use .mp4, .mkv, or some other container format to have the most “play” with the file?
      • Second, I would want to do “post-processing” on these H264 files after the stream is over, to convert them presumably to x264 files, and have them essentially be properly optimized and compressed. Because of course by this point, what matters is not fast encoding, but archival size and compression efficiency.
        • Does anyone recommend optimal ways to do this post-processing on my H264 local copies?
        • If so, what video editing software specifically? I hear Handbrake is excellent for this, and I did recently download and found it extremely customizable at first glance.

Thanks,
Compdude
 

koala

Active Member
  • recording with nvenc on indistinguishable quality is fine. It's supposed to be used this way. The huge file size is expected and no surprise. If you want a really high quality version of your stream, choose this. Use mkv as format. In case some postprocessing software doesn't support this format, use File->Remux Recordings to convert to a different format. This function does a remux, that means only container conversion with no quality loss, since the video frames will not be recompressed.
  • using bitrate 2500-3500 for 720p60 streaming is at the lower quality end. Twitch recommends 3500-5000.
  • using x264 for (stream) encoding is using much cpu resources, and if this is too much for your setup, your options are to switch to hardware encoder (much less cpu usage) or switching to a less demanding x264 preset (a bit less cpu usage and lower quality). Since you are streaming x264 with veryfast preset, you can just switch to nvenc for streaming as well, because nvenc is about the same quality as x264 veryfast. Nvenc uses only a fraction of the cpu x264 requires. Switching to a faster x264 preset such as superfast or ultrafast results in worse quality than nvenc, so it makes no sense to do this.
  • if you use "same as stream" as recording encoder, you're saving the stream data exactly as it goes out. This will save you the second encoding process, but the quality is much worse than indistinguishable quality you chose for recording already. You can do this, but you don't achieve the goal of keeping a high quality version of your stream locally. Downloading the vod from Twitch after streaming would give you exactly the same as recording with "same as stream".
  • If you want to compress the recorded raw footage afterwards, do this. A standard tool for this is Handbrake. You're losing quality by this second compression step, though. A rule of thumb is that if you choose x264 within handbrake, crf as rate control, and a crf value that results in about half of of the filesize of your raw footage, you will get about the same quality as the raw footage. Only high motion parts suffer quality loss, but since it's high motion, the eye will not detect this. I'm sorry that I cannot tell you the exact crf value you should use, because it's long ago I did this. These days, I always keep the raw footage 1:1, because hard disk space has become so cheap, it doesn't matter. And since I sometimes reget that I did recompress some of my raw footage in the past, I will not do it again.
 
Top