Question / Help Custom resolution downscaling

kamild_

Member
Hello,
I'm using OBS for capturing the most recent 10 minutes of Team Fortress 2 gameplay (by replay buffering). It servers great but I would like to optimize it a little bit so the output file will be smaller.
I'm playing on 1680x1050 resolution but after uploading the video on Youtube it's being downscaled to 1152x720. To reduce the file size, I'd like to make use of the "Resolution downscaling" option which is supposed to reduce output resolution but increase quality (it's bitrate related, isn't it?) and most probably reduce the file size. Sadly the "Resolution downscaling" option doesn't allow me to set the resolution to 1152x720, the closest one is 1260x786.
Is there any way to set the resolution downscaling to that exact resolution - 1152x720? I'm using OBS v0.65b (the AMD VCE branch one).
 

Boildown

Active Member
I think the way you've been doing it before will result in a higher quality YouTube video than your proposed new way. If you really want to increase the YouTube quality, you'd have to re-render the file so that its 1080 in the vertical dimension so that YouTube won't render it down to 720. That's probably not worth the effort though.

I believe you can manually set the base resolution to whatever you want, and then not use a downscale at all. This method is typically a lower quality solution though. That said, nothing beats finding it out for yourself experimentally.
 

kamild_

Member
I think the way you've been doing it before will result in a higher quality YouTube video than your proposed new way. If you really want to increase the YouTube quality, you'd have to re-render the file so that its 1080 in the vertical dimension so that YouTube won't render it down to 720. That's probably not worth the effort though.

I believe you can manually set the base resolution to whatever you want, and then not use a downscale at all. This method is typically a lower quality solution though. That said, nothing beats finding it out for yourself experimentally.
I'd like to try though because main problem with video quality right now is the bitrate - at 60 fps, 10Mbit/s doesn't seem to be enough since there's still pixelation happening (the overall quality is fine though). And I'd like to keep away from rerendering/reencoding the output file :)

There's a "base resolution" option but it doesn't work as expected - instead of changing the output resolution, it actually trims the video.

EDIT: I did some experiments and I'm really satisfied how does the output video looks like. Well, it's not the prettiest but it's definitely not as painful for my eyes as it was before :) Settings:
- Encoding: AMD VCE (of course), CBR with padding, 10 Mbit/s
- x264 CPU Preset: faster (it seemed to have reduced the pixelation)
- Resolution downscale: 1.33 (1280x786), filter: Lanczos
Now if only there was a way to set the resolution downscaling to the exact value that YouTube uses... Still waiting for suggestions :)

EDIT2: Video with these settings: http://youtu.be/BxB3vvL-_fo - it's more blurry most probably because of double resolution downscaling.
 
Last edited:

Sapiens

Forum Moderator
Base resolution doesn't "trim the video," it changes the dimensions of your scene. Sources aren't rearranged or scaled for you, so if the base resolution is reduced some sources will fall partially or entirely outside of the new scene dimensions.

Why don't you just record at your native resolution using https://obsproject.com/forum/resources/how-to-make-high-quality-local-recordings.16/ and then re-encode to whatever resolution and size you want using a program like Handbrake?
 

kamild_

Member
Why don't you just record at your native resolution using https://obsproject.com/forum/resources/how-to-make-high-quality-local-recordings.16/ and then re-encode to whatever resolution and size you want using a program like Handbrake?
I'll try these parameters, thanks!
I really like the fact that output files from OBS can be uploaded to YouTube without the necessity of converting/re-encoding/rendering them (which I hated doing when using programs like FRAPS or Mirilis Action) because it saves time. Unless re-encoding will be able to be done very quickly and the output file will be significantly smaller without too much of quality loss, I'd really like to not do it :)

EDIT: I'm trying these settings but for some odd reason I can't apply them - every time I disable CBR and apply settings, it automatically switches back on. And this is probably the reason why is video quality so terrible right now :/ Solved, just had to turn off the "Use custom parameters" in AMD VCE options. Now the quality is excellent but file size is enormous (376MB for a video that is ~60 second long). I assume that I need to experiment with "crf=20" option a little bit more? :)

EDIT2: I'm actually going to try Handbrake. I found these parameters, what do you think about them? The results are really good IMO (22 seconds of footage took 18MB) but maybe there's something more that could be done about it?
 
Last edited:

Sapiens

Forum Moderator
Other than the weird resolution numbers in the first picture (looks like he's trying to upscale?) those settings are about what I would use for a 60 FPS video. Youtube asks for the keyframe interval/keyint to be half of the video's frame rate, so for a 30 FPS upload you'd use keyint=15 instead. The slower preset can take a long time to work, so if you still don't want to wait long you might do some test runs comparing file size between medium/slow/slower to see if the extra time spent encoding is worth it to you.
 

kamild_

Member
Other than the weird resolution numbers in the first picture (looks like he's trying to upscale?) those settings are about what I would use for a 60 FPS video. Youtube asks for the keyframe interval/keyint to be half of the video's frame rate, so for a 30 FPS upload you'd use keyint=15 instead. The slower preset can take a long time to work, so if you still don't want to wait long you might do some test runs comparing file size between medium/slow/slower to see if the extra time spent encoding is worth it to you.
OBS is set to capture in 60 FPS so perhaps the keyint value is fine :) Also I did test two presets - "very fast" and "slower". I literally couldn't see any quality difference between these two (and almost no difference in file size) so I'm staying with "very fast" because it's... well, faster!
Thank you for help, I might upload an encoded 10min recording to YouTube to see how it looks, and then show it to you :)
 

Sapiens

Forum Moderator
No, the quality should be more or less identical. Using crf means you're targeting a specific quality level, and in this case without any bitrate limits either. The difference will be in the file sizes. If you're testing using very small or short files then keep in mind that for larger ones the extra compression of the slower preset can make more of a difference.
 

Boildown

Active Member
Also I did test two presets - "very fast" and "slower". I literally couldn't see any quality difference between these two (and almost no difference in file size) so I'm staying with "very fast" because it's... well, faster!

Haha. Next time someone comes here and asks if its "worth it" to buy a dual-socket Xeon for multiple thousands of dollars to drop their preset down a couple notches, we should link them to this post.
 

kamild_

Member
The difference will be in the file sizes. If you're testing using very small or short files then keep in mind that for larger ones the extra compression of the slower preset can make more of a difference.
Thanks for the information. I tested the presets on a very short material indeed (22 seconds) but now I finished testing these on a longer one (10 minutes).

File size:
  • veryfast: 384 MB
  • slower: 390 MB
Encoding time:
  • veryfast: ~8 minutes (I converted it yesterday so I didn't measure it more precisely)
  • slower: 37 minutes, 52 seconds
And still I can't see the differences in quality between these two (played both videos simultaneously, then compared a few frames). So yeah, the "slower" preset doesn't just make the file slightly bigger but gives no visible quality improvement and takes over 4 times more time to encode. Maybe the "slower" encoding could make more sense in other type of material. Anyway, this is not worth it :D

Haha. Next time someone comes here and asks if its "worth it" to buy a dual-socket Xeon for multiple thousands of dollars to drop their preset down a couple notches, we should link them to this post.
Have someone on these forums really wanted a second CPU just for that?
 

Sapiens

Forum Moderator
Again, it would be the same quality between ultrafast preset and placebo too. With the settings you're using, preset affects output file size, NOT quality, because the encoder is allowed to use any bitrate it needs. Youtube's heinous keyint requirements also bloat the file size and probably play a hand in the slower preset being less effective.
 

Boildown

Active Member
There was one just a few weeks ago: https://obsproject.com/forum/threads/cpu-core-count-vs-clock-speed.28049 :)

Again, it would be the same quality between ultrafast preset and placebo too.

If you google "CRF vs preset" you will see that at a given CRF, one preset is not guaranteed to result in a higher or lesser quality result than another. Only the quality per bitrate should be improved or decreased when moving between presets, not necessarily the end quality.

So the proper procedure is to adjust your preset first to one your computer can handle (for live streaming) or one that takes an acceptable amount of time to encode (for off-line encoding, like with Handbrake), and then adjust the CRF to one that results in the quality you want.

This thread I believe sums it up accurately: http://forum.doom9.org/showthread.php?t=157779
 

Sapiens

Forum Moderator
When encoding with CRF as your rate control method and no bitrate limit the encoder will produce videos that are of negligible quality difference but different file sizes due to compression. No it's not identical but that sort of thing ventures into encoding pedantry territory for the OP's purposes.
 
Top