Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th June 2021, 10:04   #1  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 135
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?
GAP is offline   Reply With Quote
Old 14th June 2021, 18:39   #2  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
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.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 14th June 2021, 19:20   #3  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 744
Read this, at least not to get such a large size of the video:

Here:
__________________
By law and justice!

GMJCZP's Arsenal
GMJCZP is offline   Reply With Quote
Old 18th June 2021, 04:53   #4  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 135
Quote:
Originally Posted by benwaggoner View Post
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.
GAP is offline   Reply With Quote
Old 18th June 2021, 10:09   #5  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 325
Quote:
Originally Posted by benwaggoner View Post
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.
Code:
--preset slower --profile high --level 4 --bitrate 10000 --min-keyint 60 --keyint 120

Last edited by excellentswordfight; 18th June 2021 at 10:30.
excellentswordfight is online now   Reply With Quote
Old 18th June 2021, 18:59   #6  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
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.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 20th June 2021, 03:45   #7  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 135
Does the Tuning and Preset effect the overall quality of the video?
GAP is offline   Reply With Quote
Old 21st June 2021, 22:34   #8  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by GAP View Post
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.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 23rd June 2021, 16:49   #9  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 135
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?

Last edited by GAP; 23rd June 2021 at 16:53.
GAP is offline   Reply With Quote
Old 23rd June 2021, 21:38   #10  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 325
Quote:
Originally Posted by GAP View Post
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.

Last edited by excellentswordfight; 23rd June 2021 at 21:42.
excellentswordfight is online now   Reply With Quote
Old 24th June 2021, 03:52   #11  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 135
Does it also matter what container that it is being kept in?
GAP is offline   Reply With Quote
Old 24th June 2021, 17:25   #12  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by GAP View Post
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.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 25th June 2021, 12:59   #13  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 135
Do you put that in the Commandline in x264? Or does it only work for a specific version of the encoder?
GAP is offline   Reply With Quote
Old 25th June 2021, 18:38   #14  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by GAP View Post
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.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 30th June 2021, 00:23   #15  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 135
Why are the Slow to Placebo profiles the fastest? And is it possible to do the lossless encodes on x264?
GAP is offline   Reply With Quote
Old 30th June 2021, 01:21   #16  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by GAP View Post
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.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 30th June 2021, 12:04   #17  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 135
What about the "Medium" setting? Is that the default setting?

Edit: Also, does the CRF play a role in making the video lossless?

Last edited by GAP; 30th June 2021 at 16:18.
GAP is offline   Reply With Quote
Old 30th June 2021, 21:12   #18  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by GAP View Post
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.

Quote:
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
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 3rd July 2021, 00:57   #19  |  Link
GAP
Registered User
 
Join Date: Sep 2020
Posts: 135
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?
GAP is offline   Reply With Quote
Old 4th July 2021, 02:27   #20  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by GAP View Post
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.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.