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. |
![]() |
#1 | Link |
Registered User
Join Date: Aug 2017
Posts: 58
|
x264 Settings for Video Games footage
Hi,
I've got several (realistic) video games footages to encode (PS2/GC/Xbox Era), I will not keep the lossless source files and I would like to have some settings recommandations. I think video game footages should be in a very good quality (to better appreciate the technical showcase), but I don't want a too high bitrate. I assume using more ReFrames would help, but for the rest I don't really know. Maybe aq and psy since image is generally clean and fidelity is important for these sources ? Also, a side question : Would it be possible to eventually implement some x265 settings to x264 ? The kind of settings which only affects the encoding but not the decoding (speed, cpu load) nor compatibility - like subme and me. Thanks Last edited by andiandi; 1st October 2023 at 22:11. |
![]() |
![]() |
![]() |
#2 | Link |
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 4,653
|
Does it need to be AVC? HEVC has some really good tools (SAO, transform skip, lossless CU, much more flexibility in block/TU size) that can get a HEVC <<50% the bitrate of a AVC of a similar quality with this kind of game footage. That era of games had TONS of aliasing, and those sharp edges are very hard on frequency transforms, which HEVC can bypass.
--preset animation may be a good start with x264, and you could tweak from there. You shouldn't have any noise (unless the game has a film grain effect; turn off if possible!), and frame-to-frame matches can be really good, so animation is the closest analog in the presets. How are you capturing? If via a HDMI capture system, you should set the console to output the native resolution in progressive scan and capture that, without any upsampling. GC was always 480, Xbox original had some 720p (Halo: CE, IIRC), and I never played on a PS2. Getting the native pixels will make encoding easier and faster. |
![]() |
![]() |
![]() |
#3 | Link | |
Registered User
Join Date: Aug 2017
Posts: 58
|
Quote:
OK, I precisely planned something quite close to animation tune, at least : - More Refs - aq-strength 0.6 (Edges tending to be sharp + UI and I think lowering aq-strengh can be fine for SD since edges have less pixels anyway) - psy-rd 0.5 (Not quite sure there, but I believe psy-rd distortions and artifacts are more noticeable for SD in general and I assume it could be more bothering for video game footages) - deblock -1,-1 instead of 1:1 or 0:0 I chose to capture with emulators since they're very very accurate for these consoles nowadays and also because progressive scan require component cables whose output is not necessarily very good quality while forcing 4:2:2 colorspace as well. Emulators, on an other hand allows RGB capture (so 4:2:0 conversion from RGB will be better than from 4:2:2). There're other things that consoles don't always do very well like scaling to correct aspect-ratio (sometimes too blurry). And yeah I will encode in SD (especially as hardware upscaling is improving further and further) and since internal resolutions of these consoles are often unusual (640x448, 512x448 etc) I wondered if it was better to change the display aspect-ratio or the pixel aspect-ratio (but not sure that Lanczos is the most appropriate in this case). |
|
![]() |
![]() |
![]() |
#4 | Link | ||||
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 4,653
|
Quote:
Quote:
Quote:
Quote:
|
||||
![]() |
![]() |
![]() |
#5 | Link | |||
Registered User
Join Date: Aug 2017
Posts: 58
|
Quote:
Regarding compatibility, does it necessarily requires a modern hardware or can we use it on older hardwares as long as they're not too weak, I ask because I remember that sometimes on older phones for example, AVC was decoded smoothly but with some visual flaws (Btw I always keep an old smartphone for benchmark purposes just in case). Quote:
Quote:
Alright, that's good. |
|||
![]() |
![]() |
![]() |
#6 | Link | |||
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 4,653
|
Quote:
Either x264 and x265 should be faster than real time with these low resolutions on a CPU that supports AVX2. Quote:
Quote:
If you can share a couple of minutes of your uncompressed captures, we can offer some more specific tuning advice. Encoding to lossless H.264 or HEVC would be a compact way to transport them, but with these low resolutions, even a .y4m in 7z LZMA2 Ultra should be quite compact. |
|||
![]() |
![]() |
![]() |
#7 | Link | |||
Registered User
Join Date: Aug 2017
Posts: 58
|
Quote:
Quote:
It's compatible with less recent hardwares than I thought, even though I prefer to stick to AVC as much as possible. But it's a good point for HEVC (even though I consider using it mostly for videos at 1080p and higher). Also hardwares are replaced quite quickly. Quote:
https://mega.nz/file/9rADlRZC#0HhRBJ...rA_KRUbRwX2ReI https://mega.nz/file/BzRwGBJD#VIulP9...z7anxyium_weus https://mega.nz/file/IzRzABqA#p3zDBx...E1LEmrz9xDaqgM |
|||
![]() |
![]() |
![]() |
#8 | Link | ||
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 4,653
|
Quote:
Quote:
I will check them out! |
||
![]() |
![]() |
![]() |
#9 | Link | |
Registered User
Join Date: Aug 2017
Posts: 58
|
Quote:
That's a good thing, it'll probably depend of the best I can get with AVC without having an excessive bitrate, but now I'm much more interested by HEVC (quality is more important to me for this particular case). Thanks ! |
|
![]() |
![]() |
![]() |
#10 | Link | |
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 4,653
|
Quote:
I ran a bunch of x265 tests over the weekend, and whew, those are challenging clips. A huge amount of big differences in adjoining pixels. I'd underestimated the difficulty badly. The solution is presumably in combining recursion down to 4x4 TUs plus using assymetric motion partitions to get as small a transform as possible. Plus using rskip to skip frequency transform entirely as needed, and potentially enabling --cu-lossless if there are blocks where lossless encoding is actually more efficient. Even with all that thrown at it, I'm still getting >4 Mbps at crf 23 for these sub-SD sources. This is Sol Levante level difficulty! A very chewy encoding challenge. Thanks for sharing! I've found setting --aspect 4:3 in ffmpeg before piping into the encoder will calculate the correct SAR irrespective of the actual rendered pixels. |
|
![]() |
![]() |
![]() |
#11 | Link |
Registered User
Join Date: Aug 2017
Posts: 58
|
Yeah, from what I tested, it was barely watchable even at really high bitrates. I also tried 720p upscaling thinking it could be a better tradeoff after all but in CRF 22 with AVC it gives about 8000 kbps (even though it's 60 fps, it's still a lot)
|
![]() |
![]() |
![]() |
#12 | Link |
Big Bit Savings Now !
Join Date: Feb 2007
Location: close to the wall
Posts: 1,475
|
SC3 PS2: I would guess that emulator add-generated a scanline-look which might not have been there in the original game output, making it harder to encode.
The other clips have their fair amount of resize flicker too. Not that much to save bitrate-wise I guess too, concurring.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain) "Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..." |
![]() |
![]() |
![]() |
#13 | Link | |
Registered User
Join Date: Aug 2017
Posts: 58
|
Quote:
|
|
![]() |
![]() |
![]() |
#14 | Link |
Registered User
Join Date: Aug 2017
Posts: 58
|
Also, there's something I forgot for upscaling regarding YUV 4:2:0 colors converted from RGB : they're better preserved in HD than in SD. That's a good argument in favor of upscaling but given the complexity of the sources, it's not easy.
|
![]() |
![]() |
![]() |
#15 | Link | |
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 4,653
|
Quote:
H.264 wasn't any better. I suspect a well-tuned AV1 encode could be a lot better. AV1 Main has a lot of screen encoding tools built-in that could really help. The HEVC screen encoding extensions would probably help a lot too, but I don't know of any practical encoders for it. All the old screen recording codecs were optimized before GUIs were full of transparencies and anti-aliasing, so wouldn't be much help. Maybe something meant for video games like Bink could do well? |
|
![]() |
![]() |
![]() |
#16 | Link | |
Registered User
Join Date: Aug 2017
Posts: 58
|
Quote:
Yes, I thought that other codecs could have more suitable tools for these kind of sources. For AV1 I assume we'll need to rely more on software decoders. Btw, I also wonder if software decoders are necessarily slower than hardware decoders, even if they are more recent? (especially on mobile devices) ? In any case, I think the best thing to do is to encode with multiple codecs since I don't keep the lossless sources (fortunately, most of my captures are short), I would say: In x265 in SD with the settings you recommended, then in x264 upscaled (to mitigate perceived quality loss) with a CRF of about 21-22 (8-10 Mbps, which is still less than Blu-ray, and I believe this kind of source have to be in very high quality by definition), and potentially in another codec to achieve the best possible compression before deleting the sources. Since x264 is the less efficient, I should try maxing it out and tweaking/tricking it as much as possible (maybe adjusting qpmin/qpmax? More rc-lookahead for mbtree ? Lowering psy-rd to prevent it allocating too much bits in aliased areas?). Last edited by andiandi; 12th October 2023 at 15:22. |
|
![]() |
![]() |
![]() |
#17 | Link | |||
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 4,653
|
Quote:
Note VMAF entirely ignores chroma, so isn't of any use for that kind of testing,. Quote:
Quote:
A lossless HEVC RGB 444 might be somewhat smaller thanks to intraframe and interframe prediction and better entropy coding. I'd be hesitant to delete any sources without having nailed a transparent quality archival format. |
|||
![]() |
![]() |
![]() |
#18 | Link | ||
Registered User
Join Date: Aug 2017
Posts: 58
|
Quote:
Quote:
Yeah, I think I'm going to keep the Lossless sources after all. I did several other tests, and it seems almost impossible to do better with these sources (even with x265) and I guess there're no filters that can help a bit either. I think the real solution will probably come from newer codecs and tools (unless current and older codecs keep getting improved significantly, even through forks). Last edited by andiandi; 13th October 2023 at 22:56. |
||
![]() |
![]() |
![]() |
#19 | Link | |
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 4,653
|
Quote:
|
|
![]() |
![]() |
![]() |
#20 | Link | |
Registered User
Join Date: Aug 2017
Posts: 58
|
Quote:
As for lossy encodings (for watching) I think I'll just stick to x264 with a CRF around 16-18, as my sources are short overall (the longest ones are more or less 5 min) and with the most appropriate settings. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|