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. |
30th May 2018, 16:19 | #1 | Link |
Registered User
Join Date: Nov 2005
Location: California
Posts: 81
|
Setting suggestions for 2-pass encodes
Hi, been a while!
I've combed through the threads for tuning settings for x265 and most of what I've found seems to be related to the CQ settings. I'm looking to re-encode a large number of movies (200+) to play on my entertainment system and the bitrates are too high for my NAS to handle so I'm recoding them down to 3500-4000 kbps and the audio down to 640kbps so that they'll play consistently. I tried the default settings and they were too smooth. The grain tune seems to work pretty well but are there any other settings that will improve the quality further? I read that the --no -sao parameter will reduce excess smoothing and it seems to work with the action films I'm encoding. Any other parameters or threads to look at to learn more? |
1st June 2018, 05:19 | #2 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,771
|
Quote:
It's useful to know how much buffering there is on the NAS. If it's a fair amount, raising --vbv-bufsize can help quality some. Things like --no-sao can improve quality at high bitrates (although not nearly as much in more recent x265 builds) but can hurt quality at lower bitrates. |
|
1st June 2018, 20:23 | #3 | Link |
Registered User
Join Date: May 2018
Posts: 9
|
crf 22-26 - adjust to taste
qcomp=0.85 - 0.7-0.85 depending on the the level of motion in the film. In my testing the difference between 0.5 and 0.85 is about a 20-30% bitrate increase. keyint= 72 - nice mix of seeking and smaller file size (3x fps) bframes=12 - lower if your playing hardware doesn't support this. ref=6 - max inside spec no-sao - to taste but sao will allow for lower bitrates to look 'ok'. slower/veryslow - preset As above vbv will help with setting a max rate and excessing bloating on high motion scenes. (which need bitrate but not as much quality as static) 2 pass is pointless unless you need a target average bitrate just use crf. I would set up the encode as above BUT with the ultrafast preset, let it run and see the rough target bitrate, adjusting crf relative (ie increase if too big, descrease if too small) then do a final pass with slower/veryslow. Noting the ultrafast preset will tend to make a file 10-20% more bloaty than the final encode. Eg ultrafast with crf 24, if bitrate too low, crf 23 etc etc brain dump offlined. |
1st June 2018, 21:50 | #4 | Link |
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,407
|
I recommend not using VBV to control excessive bloating on high motion scenes, it is better to increase qcomp (and crf number if needed). VBV is meant to keep it steamable and will generate lower quality video than normal rate control would if it has to cap the bitrate during a specific scene. VBV doesn't move bits around intelligently, it is a simple cap to avoid a buffer underrun so it can cause qp spikes.
__________________
madVR options explained |
2nd June 2018, 01:46 | #5 | Link |
Registered User
Join Date: Nov 2005
Location: California
Posts: 81
|
Hi all, thanks for the replies! Yes, almost all of the shows I'm encoding are 1080p/24. I don't know what buffering my NAS has but it's throuput for simple file transfers is around 22Mbps. It's an old Buffalo one with a Raid-5 array in it. I just have it set up as a network drive on my media pc. Anything with a bitrate over about 10Mbps and it starts to pause and stutter.
Starting to wonder if I'm being too picky or if it'll end up taking too much encoding time. I have a little distributed encoding setup with ripbot and a few i5 computers that handle most of it. Together they about match my main computer for encoding speed but it ends up taking 9-11 hours per movie doing the 2-pass with the grain and slow presets. I think I'll give the one-pass a try and see if I'm happy with the results. One question with the -sao setting. What is considered a "low" bitrate these days? I'm about 6 years removed from spending hours upon hours playing with avisynth scripts and feeling rusty... |
4th June 2018, 19:50 | #7 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
|
SAO becomes debatable around 2Mbps @ 1080p24 in my opinion, which is roughly crf 23, although there are always outliers. Below that, I always enable it, above that, I always disable it, but that's about the point where it's hard to pick one way or the other. 4Mbps with VBV restrictions might still benefit, try a 10min test either way.
Your NAS situation is great; it's exactly the network bottleneck that VBV made for, without the network. 99% of the time, it won't matter, but that one scene that otherwise would stutter will work. --vbv-maxrate is pretty obvious, set it to what your NAS can transfer (taking into account periods of congestion), but --vbv-bufsize is not easy to measure if you don't have real hardware constraints; double the maxrate is usually the default, but either you have control over your player's buffers, or you just have to take a wild guess. You might try a couple settings and induce a load on your NAS to make sure it still streams smoothly, or else see if it has some kind of QoS to service TV requests before anything else. If all else fails, you could get a Pi with Kodi to cache video on, taking the TV's buffer out of the equation. |
4th June 2018, 20:23 | #8 | Link |
Registered User
Join Date: Apr 2008
Posts: 418
|
These should help prevent blurring. I mostly use crf 21 or 22. You might want to reduce the psy settings if it doesn't look pleasant on lower bit rates e.g. jerkiness in motion or blotchy unstable grain.
--deblock=-2:-3 --psy-rd=1.75 --psy-rdoq=5.00 --no-strong-intra-smoothing --rdoq-level 1 or 2 depending on your speed preset. I wonder what exactly the qcomp setting does? Last edited by Gser; 4th June 2018 at 21:24. |
5th June 2018, 02:57 | #9 | Link |
Helenium(Easter)
Join Date: Aug 2017
Location: Hsinchu, Taiwan
Posts: 99
|
Taken from www.mplayerhq.hu/DOCS/HTML/en/menc-feat-x264.html
qcomp trades off the number of bits allocated to "expensive" high-motion versus "cheap" low-motion frames. At one extreme, qcomp=0 aims for true constant bitrate (CBR). Typically this would make high-motion scenes look completely awful, while low-motion scenes would probably look absolutely perfect, but would also use many times more bitrate than they would need in order to look merely excellent. At the other extreme, qcomp=1 achieves nearly constant quantization parameter (CQP). Constant QP does not look bad, but most people think it is more reasonable to shave some bitrate off of the extremely expensive scenes (where the loss of quality is not as noticeable) and reallocate it to the scenes that are easier to encode at excellent quality. qcomp is set to 0.6 by default, which may be slightly low for many peoples' taste (0.7-0.8 are also commonly used).
__________________
Monochrome Anomaly Last edited by Wolfberry; 5th June 2018 at 06:37. |
5th June 2018, 10:01 | #10 | Link |
Registered User
Join Date: May 2018
Posts: 9
|
In terms of qcomp, lower values 'spread' out the Q of I/Q/B frames more than a higher value. IE closer to 1 head towards constant Q.
The best way to see this in action is to pick a high CRF (35 is a good place to start) then encode a section at different qcomp settings to see how it works. You'll notice that at a lower qcomp (0.5) the I frames have a higher quality but motion is terrible, but at 0.9 qcomp the I frames will be of lower quality but the motion better. Once you start to increase CRF it is harder to notice the differences as it's masked by a better overall 'quality'. Also a lower qcomp will lead to a greater efficiency in more static content while a higher one is better for motion. I use qcomp 0.85 with a crf of 28-30 for kids shows but 0.75 for standard film content at crf 25. |
5th June 2018, 17:33 | #12 | Link | |
Registered User
Join Date: May 2018
Posts: 9
|
Quote:
At lower bitrates (<256kbps) I switch off all psy options as they cause more harm than good and make panning look like the cameraman has parkinsons. |
|
5th August 2018, 11:40 | #14 | Link | ||
Herr
Join Date: Apr 2009
Location: North Europe
Posts: 556
|
Quote:
B.Waggoner wrote: Quote:
EDIT: Never mind, I misunderstood foxyshadis! Last edited by Forteen88; 6th August 2018 at 07:33. |
||
5th August 2018, 23:12 | #15 | Link |
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,407
|
I am quite sure foxyshadis meant below 2Mbps they always enable SAO (do not use --no-sao) while above 2Mbps they always disable SAO (use --no-sao).
Personally I use SAO at even higher bitrates, it has improved a lot since its initial testing. But I also agree with the general consensus that at high bitrates --no-sao can improve quality. At bitrates where x264 would look very good --no-sao is almost always beneficial.
__________________
madVR options explained |
6th August 2018, 07:32 | #16 | Link | |
Herr
Join Date: Apr 2009
Location: North Europe
Posts: 556
|
Quote:
And yeah, I did a SSIM-test on a very short cartoon, SAO got slightly higher SSIM-score than --no-sao. Last edited by Forteen88; 6th August 2018 at 07:38. |
|
|
|