View Full Version : What are some good x264/x264vfw settings for upscaling?
I was upscaling my games using Lagarith Lossless only to realize that the file size that I ended up with is too huge for five mintue clips. I want to upscale my games to 720p but I do not want to have a huge file size and it takes too long to upload to Youtube. I used to use XVID to solve the problem but as other post in this (and another forum) have pointed out, it is outdated and only good for ancient hardware. It isn't at though that I have most advanced hardware myself as my laptop is the most advanced hardware I have but I still want to keep to date. I heard that x264/x264vfw is good for animation, gaming, etc. but but the settings provided by sites like TASVideos sort of confuse me. I want to know what settings work for upscaling footage from games without losing the quality? And which version of x264/x264vfw is ideal for gaming footage?
benwaggoner
14th June 2021, 18:39
What is your goal in upscaling in the first place? Why not encode at native resolution with way more bits per pixel? Or just capture at higher resolution? I can't think of any non-Wii games in the last 15 years that couldn't do at least 720p.
Lagarith tends to ring around sharp edges, so may not be the best algorithm for games that have sharp text or HUD graphics.
GMJCZP
14th June 2021, 19:20
Read this, at least not to get such a large size of the video:
Here: (https://forum.doom9.org/showthread.php?p=1809931#post1809931)
What is your goal in upscaling in the first place? Why not encode at native resolution with way more bits per pixel? Or just capture at higher resolution? I can't think of any non-Wii games in the last 15 years that couldn't do at least 720p.
Lagarith tends to ring around sharp edges, so may not be the best algorithm for games that have sharp text or HUD graphics.
I guess I just wanted to make "HD" especially for "2D" games.
excellentswordfight
18th June 2021, 10:09
What is your goal in upscaling in the first place? Why not encode at native resolution with way more bits per pixel? Or just capture at higher resolution? I can't think of any non-Wii games in the last 15 years that couldn't do at least 720p.
Lagarith tends to ring around sharp edges, so may not be the best algorithm for games that have sharp text or HUD graphics.
Well TS intention seems to be to upload game fotage to youtube, and there upscaling makes a lot of sense as 240p for example (which is a common retro game resolution) gets relative speaking less bandwith then higher resolutions.
But what confuses me a bit is that it sounds like TS thinks that its the codec that does the upscaling ("I was upscaling my games using Lagarith Lossless"). First you change the resolution with an (up)scaler then you compress it with an encoder/codec (i.e. lagarith, x264 etc).
Anyway, TS what compression level are you expecting? What codec (and settings) is appropriate depends on if you are trying to achieve 1GB, 10GB, or 100GB per hour of content. But if you want something simple and rather compressed just for quick uploads to youtube I would just use x264 at a lower preset in abr mode at 10Mbps with a 1-2s GOP. So something like this for 720p60, it will probably be just fine as youtube will recompress it anyway, but if the bitrate is not enough just try to increase and go to level 4.1 it until you are happy.
--preset slower --profile high --level 4 --bitrate 10000 --min-keyint 60 --keyint 120
benwaggoner
18th June 2021, 18:59
Oh, ugh. Yeah, since YouTube bitstarves each resolution, sometimes the only way to get good quality is to upsample to force higher bitrates. But that's really social engineering around YouTube's technical constraints. Everyone would be better off if YouTube would just allow for higher bitrates at the source resolution, so we can get nice sharp 240p. Uploaders would have to do less work, and YouTube would deliver the same quality experience with less encoding and bandwidth costs.
Also, I'd probably use --crf 16 or maybe even 12 instead of setting --bitrate for an upload. The quality of the encode is the key factor, and any reasonable fixed bitrate will be too high for some content and too low for others.
I don't think YouTube does any Level checks, so VBV can go as high as suits the content.
Does the Tuning and Preset effect the overall quality of the video?
benwaggoner
21st June 2021, 22:34
Does the Tuning and Preset effect the overall quality of the video?
Absolutely. That's what they are there for.
--tune adapts to the content type. --tune animation can reduce bitrate of anime by a third or more while improving quality. --tune film preserves detail and grain a bit better than default settings.
--preset is the quality/speed tradeoff. I try to use at least --preset slower to reliably get good benefit from HEVC.
Is that why some people recommend the "Slow" preset for some videos? I had no idea that it would affect the speed and quality. What tuning is good for older video games? Or does it fall under animation?
excellentswordfight
23rd June 2021, 21:38
Is that why some people recommend the "Slow" preset for some videos? I had no idea that it would affect the speed and quality. What tuning is good for older video games? Or does it fall under animation?
Yes, imo preset slow is were x265 really starts to become great when not setting a bunch of compression relented custom commands, and on modern hardware it still offers somewhat usable speed. Going lower, even slower (even though it still give a reasonable tradeoff unlike veryslow/placebo) will probably start to become to slow for a lot of use cases when doing somewhat high resolutions.
For x264 @ 720p you can probably go lower, both slower and veryslow is reasonable fast on good hardware.
However, you should think about how important it is to try to compress it as much as you can, a lot of the time it makes more sense to tune for more speed and just have bigger files, especially when using it more like an digital intermediate for youtube upload.
I wouldnt use any of tune preset for gaming in general, maybe you can find some games that would benefit from tune animation, but I wouldn't use it as an general setting, I would guess that in most cases it will do more bad then good.. I have never tuned x264 or x265 for gaming content so unfortunately I dont have any recommendations on settings that might be good for that kind of content other then just going for the lowest preset you can while still getting usable speed for your workflow.
Does it also matter what container that it is being kept in?
benwaggoner
24th June 2021, 17:25
Does it also matter what container that it is being kept in?
It doesn't impact quality at all, just use one that YouTube supports.
I generally recommend .mp4 as it is the most straightforward and widely supported.
Also, for lossless game footage, I'd throw in --tskip which can really help quality with sharp edges and aliasing. If I were trying to make a super efficient distribution copy I'd probably try --cu-lossless, but you're making a mezzanine to be reencoded here, so probably not worth the effort.
Do you put that in the Commandline in x264? Or does it only work for a specific version of the encoder?
benwaggoner
25th June 2021, 18:38
Do you put that in the Commandline in x264? Or does it only work for a specific version of the encoder?
Sorry! I forgot this thread was in the H.264 forum. Those are HEVC features and x265 parameters.
x264 doesn't really have equivalent features; the closest being to use High Profile instead of Main. The good news is that it is WAY faster, so even --preset veryslow can be very fast for lots of content on recent hardware.
Why are the Slow to Placebo profiles the fastest? And is it possible to do the lossless encodes on x264?
benwaggoner
30th June 2021, 01:21
Why are the Slow to Placebo profiles the fastest? And is it possible to do the lossless encodes on x264?
Actually, placebo is the slowest, and they get faster from there.
x264 can do lossless encodes, but not all decoders support lossless H.264.
What about the "Medium" setting? Is that the default setting?
Edit: Also, does the CRF play a role in making the video lossless?
benwaggoner
30th June 2021, 21:12
What about the "Medium" setting? Is that the default setting?
It's the default. It's a reasonable speed/quality tradeoff for 10+ years ago, but with a modern AVX2 4+ core processor, most people will use something slower and better. Even veryslow can be almost real-time for 1080p24 on a beefy modern machine.
Edit: Also, does the CRF play a role in making the video lossless?
The lower the CRF, the closer it will get to being visually lossless. A CRF of 12 generally is indistinguishable from the source during playback, and 18 generally looks really good. Mathematically lossless you get by using -q 0. Note bitrates will be a lot higher and encoding quite a bit slower. There's no quality difference between ultrafast and placebo, by definition. But the slower the setting, the smaller the lossless output will be.
http://trac.ffmpeg.org/wiki/Encode/H.264#LosslessH.264
https://forum.doom9.org/showthread.php?t=106408
I am mostly use x264 8 bit for final encodes but I also learned from another forum that 10 bit preserves some things better. I know x264 is useful for compression but I wonder if there are any finer nuances and details between x264 8-Bit,10-Bit and vfw?
benwaggoner
4th July 2021, 02:27
I am mostly use x264 8 bit for final encodes but I also learned from another forum that 10 bit preserves some things better. I know x264 is useful for compression but I wonder if there are any finer nuances and details between x264 8-Bit,10-Bit and vfw?
VfW is just an OLD API that Microsoft has been trying to deprecate since the 90's.
10-bit x264 is more efficient, and can encode in 10-bits. But it is less compatible, as lots of decoders only support H.264 in 8-bit. There are even decoders that can do 10-bit HEVC but only 8-bit H.264.
I was planning on using 10 bit for my encodes as it might be it is might better for pixel art and preserving color from what I heard. I think I will stick with x264 8 bit in Virtualdub2 for my encodes. I was hoping to 10 Bit as it seemed better to me or so I had heard.
Edit: What about other options like Zero latency, fast decode, Rate control, etc.?
Edit 2: What is good way to preserve the color in pixel art in 8 bit?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.