View Full Version : Questions on x264 Settings, Through MEGUI
HoodwILL
22nd December 2008, 07:57
Hi all, I finally completed my initial 5 day "wait-before-posting period" - woohoo! :)
Now, the good stuff. I am [somewhat] new to x264, but definitely not to video encoding. I have been using MEGUI to convert Bluray videos down to a small enough filesize to fit a single movie (2hr on avg.) on a DVD and be compatible with my X360 (I am aware of all playback restrictions). I output to 4 gig 4.1 AVC MP4 files, with 256 VBR AAC-LC audio downmixed to 2 channel ProLogic, and finally muxed using the one MEGUI has built-in.
I started out using the profile presets packaged with MEGUI (thanks, ST) and have been tweaking here and there to try and figure out what will yield the best results for me. Some of my encodes have looked grainier than others and I'm wondering how to best reduce noise without making things look smoothed over, and without using too many blurring effects. Basically I'm looking to make videos look as close as possible to the sources, with minimal blocking, minimal detail loss.
My Current Settings:
program --pass 2 --bitrate 1000 --stats ".stats" --level 4.1 --min-keyint 1 --ref 5 --mixed-refs --no-fast-pskip --bframes 3 --b-adapt 2 --b-pyramid --weightb --direct auto --subme 7 --trellis 2 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --chroma-qp-offset -2 --vbv-bufsize 24000 --vbv-maxrate 24000 --me umh --threads 16 --thread-input --cqmfile "C: ... \Prestige AVC Matrix.cfg" --progress --no-dct-decimate --no-psnr --no-ssim --output "output" "input"
I use MediaInfo to read video files' encode settings, and have come across some settings that I can't find when trying to customize my own profile... and sorry in advance if some of these questions are stupid, I'm still in the learning phase.
analyse=0x3:0x113 : What is this and where do I set it? What does it affect?
brdo or psy_rd? Any suggestions here?
rceq='blurCplx^(1-qComp)' : How would I get this setting?
aq=1:0.5:18.0 : How would my Adapt. Quant. get this setting? Right now mine is aq=1:1.00
Lastly, would my encodes look less noisy/blocky if I were to use a constant quantizer, or learn to encode using crf? I am mainly using 2pass because it gives me the right file size I'm looking for.
Thanks for the time guys, I appreciate it!
Dark Shikari
22nd December 2008, 08:03
analyse=0x3:0x113 : What is this and where do I set it? What does it affect?Analyse is an alias for --partitions.
brdo or psy_rd? Any suggestions here?b-rdo no longer exists; it was absorbed by subme. psy-rd is on by default.
rceq='blurCplx^(1-qComp)' : How would I get this setting?You don't. The ability to adjust rceq was removed (because nobody used it and ffmpeg's abuse of it was causing it to crash).
aq=1:0.5:18.0 : How would my Adapt. Quant. get this setting? Right now mine is aq=1:1.00This was from before AQ was actually committed, when it wasn't finalized yet. The old 0.5 was roughly equivalent to the new 1.0, so yours is about the same.
Lastly, would my encodes look less noisy/blocky if I were to use a constant quantizer, or learn to encode using crf? I am mainly using 2pass because it gives me the right file size I'm looking for.Constant quantizer should never be used for any purpose except testing. CRF is good and you should use it more often, but it isn't any better than 2pass at the same bitrate.
Also, there's generally no good reason to knock down chroma QP any more than it already is; psy-RD already adjusts it down by 2, so you're putting it at -4.
ajp_anton
22nd December 2008, 08:11
Just to be sure... you do know you're using --threads 16 right?
HoodwILL
22nd December 2008, 08:14
Thanks for the info DS.
- I don't really understand about the partitions, should I learn to play with this?
- Yea, I saw some people had a Chroma QP setting of -2 so that's what I set it to in MEGUI. I'll bump that back up to 0.
EDIT: -Threads 16, yes... no good? Should I go for auto? How significantly does this negatively affect my output quality?
Dark Shikari
22nd December 2008, 08:16
Thanks for the info DS.
- I don't really understand about the partitions, should I learn to play with this?No, the defaults are fine. --partitions all helps a bit at high bitrates, but that's about it.
- Yea, I saw some people had a Chroma QP setting of -2 so that's what I set it to in MEGUI. I'll bump that back up to 0.-2 is what's set automatically.
EDIT: -Threads 16, yes... no good? Should I go for auto? How significantly does this negatively affect my output quality?Yes, you should always use auto. More threads never helps quality (rarely hurts much though), and too many can hurt performance.
HoodwILL
22nd December 2008, 08:21
Ok, sounds good. My encodes usually stay in the 4000 - 6000 kbps br range, so I guess partitions won't really matter.
Forgot something else too, geez: I know turbo speeds up my coding time by blasting through the first pass, but am I losing quality by doing this?
and are PSNR or SSIM calculations any good?
nurbs
22nd December 2008, 10:31
turbo reduces quality, but not by much.
PSNR and SSIM are mathematical values for video quality. They are only useful for comparison if you turn of psy-rd and i think also aq.
LoRd_MuldeR
22nd December 2008, 11:58
PSNR and SSIM are mathematical values for video quality. They are only useful for comparison if you turn of psy-rd and i think also aq.
Note that with Psy-RD and AQ enabled, you will usually get worse results for PSNR and SSIM. However the perceived quality usually is significant better!
Ergo: Forget about the idea that metrics are suitable to judge the overall quality ;)
HoodwILL
23rd December 2008, 03:49
Thanks for all the help guys! Just curious... what exactly do I lose by running the first pass in Turbo?
LoRd_MuldeR
23rd December 2008, 03:53
Thanks for all the help guys! Just curious... what exactly do I lose by running the first pass in Turbo?
"Turbo mode" is not a feature of x264 itself! Some of the front-ends offer this options.
If enabled, it will lower certain settings for the first run of a 2-Pass encode, which can speed-up this first pass significantly.
The quality loss for the final file (created in the second run) is usually very small, if noticeably at all...
HoodwILL
23rd December 2008, 04:11
"Turbo mode" is not a feature of x264 itself! Some of the front-ends offer this options.
If enabled, it will lower certain settings for the first run of a 2-Pass encode, which can speed-up this first pass significantly.
The quality loss for the final file (created in the second run) is usually very small, if noticeably at all...
Right, I understand all of this, but you haven't answered my question. I am using meGUI, and currently have my profile set to run turbo. Do you know what is typically changed in the first pass that lowers its settings, thus making it faster? And what exactly is affected (what am I losing in the second pass) because of this?
EDIT: In other words, what EXACTLY is different about my final output using turbo, vs not using it? Obviously I know that turbo only affects the first pass, but the second pass also gets info from the first right? So how is my quality less on an encode that uses turbo on the first pass, versus an encode that uses NO turbo on the first pass?
LoRd_MuldeR
23rd December 2008, 04:17
As said before, only the first pass of a 2-Pass encode is effected by "Turbo Mode". I think it will lower the ME method to "Diamond" search, lower the number of refs to 1 and maybe lower other options too.
The second pass of the 2-Pass encode, which creates the final output file, is not effected by "Turbo Mode" directly. Only the "stats" file retrieved from the first pass will be less accurate.
From all that I know, the quality loss caused by "Turbo Mode" is very small. So you can use it safely, unless you don't care about encoding time...
kemuri-_9
23rd December 2008, 04:21
this was gone over some time before:
read over http://forum.doom9.org/showthread.php?t=141202
HoodwILL
23rd December 2008, 04:23
I appreciate the responses but maybe I should be more clear with how I'm asking the question.
I know that enabling turbo only affects the first pass. I know.
But what does it DO to the first pass? How will it (by in turn affecting the second pass) make the final output of my encode different than if I had used no turbo at all?
LoRd_MuldeR
23rd December 2008, 04:28
I appreciate the responses but maybe I should be more clear with how I'm asking the question.
I know that enabling turbo only affects the first pass. I know.
But what does it DO to the first pass? How will it (by in turn affecting the second pass) make the final output of my encode different than if I had used no turbo at all?
The first pass analyzes the video and creates a so-called "stats" file.
The second pass does the final encoding. It uses the "stats" file that was created during the first pass.
When using "Turbo Mode" the first pass uses lower (faster) settings and hence creates a less accurate "stats" file.
As far as I know "Turbo Mode" will lower the ME method "diamond" search and lower the references to 1. Maybe other options are lowered too.
This indirectly effects the second pass (as it uses the "stats" file from first pass), but the effect will be pretty small.
More info about how 2-Pass rate controls works can be found here:
http://git.videolan.org/gitweb.cgi?p=x264.git;a=blob_plain;f=doc/ratecontrol.txt
HoodwILL
23rd December 2008, 04:33
Gotcha. Thanks for the help guys, I'll keep reading up on the turbo setting.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.