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 > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th October 2019, 18:17   #1  |  Link
iz-Moff
Registered User
 
Join Date: May 2014
Posts: 3
x265: a good compromise between "slow" and "slower" presets?

Hi.

I wanted to do some encoding using x265 (ver 3.0), but i can't quite decide on the settings. Preset "slow" has pretty good encoding speed, enough that i wouldn't mind sacrificing some to get a bit higher quality encodes, but the next available preset is like 3-4x slower, which is way too slow for me.

I want to tune "slow" preset to be a bit closer to "slower", and i've looked up the parameters they use, but i'm not sure which of them would offer a good tradeoff between speed and quality. I tried reading docs, but they're too technical for me to understand and don't really offer any advice.

So i was wondering if anyone could give me a rough outline of which parameters would have what effect on quality/encoding speed?
Thanks.

Here's the list of parameters that are different between the two presets:
Code:
				slow	slower
bframes				4	8
rc-lookahead			25	40
lookahead-slices		4	1
ref				4	5
limit-refs			3	1
subme				3	4
amp				0	1
max-merge			3	4
recursion-skip			1	0
b-intra				0	1
weightb				0	1
rdLevel				4	6
tu-intra			1	3
tu-inter			1	3
limit-tu			0	4

Last edited by iz-Moff; 12th October 2019 at 18:45.
iz-Moff is offline   Reply With Quote
Old 12th October 2019, 20:09   #2  |  Link
Tadanobu
Registered User
 
Join Date: Sep 2019
Posts: 37
I'll suggest the following command line :

Quote:
--preset slow --limit-refs 1 --tu-intra-depth 3 --tu-inter-depth 3 --limit-tu 4 --merange 64 --bframes 8 --no-sao
Here is what I personally use as my main profile. I always make a test encode with these settings and then tweak them. It's a bitter faster than slower (but not that much) :
Quote:
--preset slow --output-depth 10 --limit-refs 1 --limit-tu 4 --tu-intra-depth 3 --tu-inter-depth 3 --psy-rdoq 1.1 --aq-mode 3 --subme 5 --merange 64 --max-merge 5 --bframes 8 --rc-lookahead 120 --lookahead-slices 1 --ref 6 --deblock -3:-3 --no-sao --psy-rd 2.1
Tadanobu is offline   Reply With Quote
Old 13th October 2019, 02:45   #3  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,988
I find SAO to very much be worth it today in all cases. Maybe if you're doing high bitrate encoding you can turn it off, but it really helps in motion. It does soften a bit in single frame comparison sometimes.
Blue_MiSfit is offline   Reply With Quote
Old 13th October 2019, 03:55   #4  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
I also find SAO to be worth it now, even when I encode to really high bitrates. The smoothing is so minor with current versions that there really is no need to turn it off anymore.

If you think x265 smooths too much with SAO on, and SAO does not help much because the bitrate is so high, then you might want to use x264 instead.
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 13th October 2019, 21:27   #5  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Try Slower with --limit-refs 3 --no-amp --rd 4. It will be a much faster and not affect much to quality.

Quote:
Originally Posted by Blue_MiSfit View Post
I find SAO to very much be worth it today in all cases. Maybe if you're doing high bitrate encoding you can turn it off, but it really helps in motion. It does soften a bit in single frame comparison sometimes.
FullHD 16-17mb and UHD 20-22mb is high bitrate? I always use --no-sao, but maybe I should think about it

Last edited by redbtn; 13th October 2019 at 21:36.
redbtn is offline   Reply With Quote
Old 13th October 2019, 22:20   #6  |  Link
iz-Moff
Registered User
 
Join Date: May 2014
Posts: 3
Quote:
Originally Posted by Tadanobu View Post
I'll suggest the following command line :
Is "--limit-refs 1" worth it? I've run some test encodes on a sample, and among the settings that are different between the two presets, "--rd 6", "--limit-refs 1" and "-no-rskip" reduce encoding speed the most. Also, only placebo preset uses --merange above 57, and 57 doesn't sound like a number that would be selected arbitrarily...

Anyway, i guess for now i'll try using pretty much the "slower" preset without "--rd 6", "--limit-refs 1" and "-no-rskip":
Quote:
--preset slow --profile main10 --bframes 8 --b-intra --weightb --subme 4 --rc-lookahead 40 --tu-intra 3 --tu-inter 3 --limit-tu 4 --amp --ref 5 --lookahead-slices 1 --max-merge 4
These settings result in only about 10-20% slower encoding speed, and, hopefully, will benefit the quality a bit.

Quote:
Originally Posted by redbtn View Post
Try Slower with --limit-refs 3 --no-amp --rd 4. It will be a much faster and not affect much to quality.
Thanks, yeah, that seems like a good tradeoff. Though "--amp" doesn't seem to reduce the speed a lot, at least not with the samples i tried, so i guess i'll use it.

Last edited by iz-Moff; 13th October 2019 at 22:35.
iz-Moff is offline   Reply With Quote
Old 13th October 2019, 22:50   #7  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
If I remember correctly --amp can slow down by 20% at least for me. So, maybe it depends of the source. What you want to encode? If you are interested, I can show all my settings based my tests for 1080p and 4k hrd.
It took a long time, but I'm happy with the result.

Ps: I'm pretty sure that for now (version 3.2) --no-rskip used only preset placebo, so I don't really understand why your Slower use it.

Last edited by redbtn; 13th October 2019 at 22:56.
redbtn is offline   Reply With Quote
Old 13th October 2019, 23:38   #8  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,988
Quote:
Originally Posted by redbtn View Post
T
FullHD 16-17mb and UHD 20-22mb is high bitrate? I always use --no-sao, but maybe I should think about it
Those are definitely high, especially the 1080p number.

Common HEVC bitrates would be like 3-5 Mbps for 1080p and maybe 10-12 Mbps for UHD.

At least, that's what's commonly seen in the premium OTT streaming case. Approx 8 for FHD and 25 for UHD are the highest used in large scale streaming services.

I think this is enough for very good quality with most content with slow settings, but some challenging content really does need 30+ to look really good, especially grainy content. There's a reason UHD BluRay has the bitrates it does I guess

Anyway, I guess to sum things up, maybe for UHD BluRay level bitrates SAO doesn't make sense, but for anything practical for streaming you definitely want it turned on these days.

IMO.
Blue_MiSfit is offline   Reply With Quote
Old 14th October 2019, 15:31   #9  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 851
Hi,
And what about --repeat-headers, --aud and --hrd options ? Is there a quality impact when using these options ?
Thank you.
Nico8583 is offline   Reply With Quote
Old 14th October 2019, 17:51   #10  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by Nico8583 View Post
Hi,
And what about --repeat-headers, --aud and --hrd options ? Is there a quality impact when using these options ?
Thank you.
No, those are mainly metadata; shouldn't impact encoding at all. At VERY low bitrates the extra bits might have an impact, but it's << 1 Kbps.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 14th October 2019, 20:29   #11  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 851
Quote:
Originally Posted by benwaggoner View Post
No, those are mainly metadata; shouldn't impact encoding at all. At VERY low bitrates the extra bits might have an impact, but it's << 1 Kbps.
Thank you, just to close this point : are these options useless ? Or is it necessary to use it when we encode to x265 and remux to MKV ? Thank you.
Nico8583 is offline   Reply With Quote
Old 14th October 2019, 20:36   #12  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Quote:
Originally Posted by Nico8583 View Post
Thank you, just to close this point : are these options useless ? Or is it necessary to use it when we encode to x265 and remux to MKV ? Thank you.
--repeat-headers --aud and --hrd are need for HDR encode.

Last edited by redbtn; 21st October 2019 at 11:26.
redbtn is offline   Reply With Quote
Old 14th October 2019, 23:11   #13  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 851
Thank you.
I would like to encode my HD and UHD BluRay collection to x265 so I have the same question. Slower is very low, slow has a good speed but I would like to keep the best ratio between speed and quality.
Could you give 2 command line exemples, one for FHD and one for UHD with slow and/or slower preset ?
Thank you !
Nico8583 is offline   Reply With Quote
Old 14th October 2019, 23:25   #14  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Quote:
Originally Posted by Nico8583 View Post
Thank you.
I would like to encode my HD and UHD BluRay collection to x265 so I have the same question. Slower is very low, slow has a good speed but I would like to keep the best ratio between speed and quality.
Could you give 2 command line exemples, one for FHD and one for UHD with slow and/or slower preset ?
Thank you !
I tried to encode 2160p, but with my settings and CRF 20 it gives me on some BD's 24mb+ bitrate. In my case there is only one way to lower the bitrate, use cutree and turn off psy-rdoq. I don't want to do it. I have 6 core 9400f, so my speed is 1.4fps for 2160p. Just now I did some comparison, native UHD vs resized with spline64 2160p>1080p>2160p and I realized that loss in detail not worth it. So I decided to encode UHD>FHD. My settings are something between slow and slower with some tweaks. I can't give it to you right now, but tomorrow I will.

Last edited by redbtn; 14th October 2019 at 23:40.
redbtn is offline   Reply With Quote
Old 15th October 2019, 04:36   #15  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Quote:
Originally Posted by redbtn View Post
Just now I did some comparison, native UHD vs resized with spline64 2160p>1080p>2160p and I realized that loss in detail not worth it. So I decided to encode UHD>FHD.
I downsize my encodes all the time, and I strongly recommend using Zopti to find out the optimal parameters for Bicubic resizing to compensate the loss of sharpness and detail as much as possible.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 15th October 2019, 07:17   #16  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 851
Thank you.
You downsize your encodes to reduce filesize, reduce encoding time or both ?
I already tried to downsize but the result was not so good than UHD encode... Perhaps my filter was not so good.
Nico8583 is offline   Reply With Quote
Old 15th October 2019, 08:34   #17  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
I downsize just to save some space, also you can easily see that a lot of material really doesn't have any details to lose if you go from 1080p to 720p, or 2160p to 1080p (of course the relative change is bigger in the latter). Quite a lot is already an upscale from 2K to 4K.
Downsizing with Bicubic with specific tuned parameters can compensate quite a lot, especially the loss of sharpness. My viewing distance to my 65" TV is about 3.5 metres, so downsizing also has a lower impact what comes to details so your situation may be quite different.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 15th October 2019, 12:31   #18  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Quote:
Originally Posted by Boulder View Post
I downsize my encodes all the time, and I strongly recommend using Zopti to find out the optimal parameters for Bicubic resizing to compensate the loss of sharpness and detail as much as possible.
Thank you for advice! Can you share your script for Zopti comparison? I just looked Zopti topic, but it's a little complicated for me.
---------
Nico8583 There are my settings below. No need to set Preset or you can choose Preset Medium cuz it is use defaults.

For HDR
Quote:
--level-idc 51 --sar 1:1 --colorprim 9 --colormatrix 9 --transfer 16 --range limited --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)" --max-cll "0,0" --hdr --hdr-opt --hrd --chromaloc 2 --repeat-headers --min-luma 0 --max-luma 1023 --no-cutree --no-sao --no-open-gop --no-strong-intra-smoothing --vbv-bufsize 160000 --vbv-maxrate 160000 --min-keyint 5 --keyint 240 --ipratio 1.35 --pbratio 1.25 --deblock -3:-3 --qcomp 0.7 --aq-mode 1 --aq-strength 0.9 --ctu 64 --merange 57 --me star --limit-refs 3 --no-early-skip --weightb --b-intra --rd 4 --rdoq-level 2 --rc-lookahead 72 --psy-rd 2 --psy-rdoq 1.2 --max-merge 4 --lookahead-slices 0 --bframes 8 --ref 4 --subme 4 --tu-intra-depth 4 --tu-inter-depth 4 --limit-tu 1 --rect --no-amp --limit-modes
For SDR
Quote:
--level-idc 51 --sar 1:1 --colorprim 1 --colormatrix 1 --transfer 1 --range limited --chromaloc 0 --no-cutree --no-sao --no-open-gop --no-strong-intra-smoothing --vbv-bufsize 90000 --vbv-maxrate 90000 --min-keyint 5 --keyint 240 --ipratio 1.35 --pbratio 1.25 --deblock -3:-3 --qcomp 0.7 --aq-mode 3 --aq-strength 0.8 --ctu 64 --merange 57 --me star --limit-refs 3 --no-early-skip --weightb --b-intra --rd 4 --rdoq-level 2 --rc-lookahead 72 --psy-rd 2 --psy-rdoq 1.2 --max-merge 4 --lookahead-slices 0 --bframes 8 --ref 4 --subme 4 --tu-intra-depth 4 --tu-inter-depth 4 --limit-tu 1 --rect --no-amp --limit-modes
And I did some tests yesterday:
Quote:
--tu-intra-depth 4 --tu-inter-depth 4 --limit-tu 4 (2.10fps = 215.8mb)
--tu-intra-depth 4 --tu-inter-depth 4 --limit-tu 3 (2.11fps = 215.7mb)
--tu-intra-depth 4 --tu-inter-depth 4 --limit-tu 2 (1.93fps = 214.2mb)
--tu-intra-depth 4 --tu-inter-depth 4 --limit-tu 1 (1.91fps = 200.0mb) best speed / compression IMO
--tu-intra-depth 4 --tu-inter-depth 4 --limit-tu 0 (1.73fps = 194.4mb)
--tu-intra-depth 1 --tu-inter-depth 1 --limit-tu 0 (2.28fps = 217.3mb) best speed
--tu-intra-depth 3 --tu-inter-depth 3 --limit-tu 1 (1.83fps = 209.8mb)
--tu-intra-depth 2 --tu-inter-depth 2 --limit-tu 0 (1.57fps = 220.6mb)

Last edited by redbtn; 15th October 2019 at 12:50.
redbtn is offline   Reply With Quote
Old 15th October 2019, 13:02   #19  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 322
Quote:
Originally Posted by redbtn View Post
Thank you for advice! Can you share your script for Zopti comparison? I just looked Zopti topic, but it's a little complicated for me.
---------
Nico8583 There are my settings below. No need to set Preset or you can choose Preset Medium cuz it is use defaults.

For HDR


For SDR


And I did some tests yesterday:
Have you done any tests with and without no-strong-intra-smoothing? All test I've done with it shows that disabling it (using no-strong-intra-smoothing) only gave negative effects, worse compression and blocking and gave negligible improvement for sharpness/detail retention.
excellentswordfight is offline   Reply With Quote
Old 15th October 2019, 14:58   #20  |  Link
redbtn
Registered User
 
redbtn's Avatar
 
Join Date: Jan 2019
Location: Russia
Posts: 105
Quote:
Originally Posted by excellentswordfight View Post
Have you done any tests with and without no-strong-intra-smoothing? All test I've done with it shows that disabling it (using no-strong-intra-smoothing) only gave negative effects, worse compression and blocking and gave negligible improvement for sharpness/detail retention.
I did test just now and there is no difference in file size, just minor, few KB's. And I don't know how compare it for visual quality. Probably I have to use --strong-intra-smoothing and don't care about it.

Last edited by redbtn; 15th October 2019 at 15:00.
redbtn is offline   Reply With Quote
Reply

Tags
parameters, presets, settings, x265

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 12:39.


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