View Full Version : Suggestion for x265's --tune film
avr1910
24th November 2016, 10:15
So, here are our suggestions for x265 --tune film:
--ctu 32 --max-tu-size 16 --qcomp 0.8 --aq-mode 1 --aq-strength 1.0 --psy-rd 1.8 --psy-rdoq 5.0 --rdoq-level 1 --deblock -2:-2 --qg-size 16 --no-sao --me_range 44 --no-rect --no-amp
Hey littlepox,
have a question regarding this recomendation.
I have in plan to encode some of my BD collection to x265.
Im using latest Handbrake nightly with only settings used being speed slow and CR18.
I just run over this thread today and tried entering those quoted settings into the "extra options" field under x265 codec settings.
Problem is i don't see any difference on laptop monitor so will play with it over weekend at home where i can check on my plasma tv.
As there was some time that past between that recommendation post and now are there any changes in your opinion regarding those settings?
Movies i would like to encode are typical male ones :) Transformers 1-4, Oblivion, Serenity....that sort of stuff.
Also is there a better tool for x265 encodes than Handbrake or i can keep using it? I'm would like to have quality encodes but im not a Hawkeye. Tv set i have is 46inch 1080p panel, so no 4K or larger sizes in the near future.
Thx
dipje
24th November 2016, 12:20
Maybe littlepox should say something about this himself, but the first post recommendations are for an older version and there has been (notably) very much improvement in the default settings for --tune grain and detail retention.
If you use --preset slow or --preset slower and --tune grain, I'm very happy with the results these days. I also use a lot of encodes without --tune grain, and I just add '--no-sao' and '--ctu 32' although I don't think if that's really needed these days. SAO is still nicknames 'smooth all objects' I believe :).
Just finetune the CRF you're using. I have a CRF value I'm happy with x264. I do a test encode on some parts to see what bitrate x264 ends up using. Then I try test-encodes on that same part with x265 until I have a CRF value where the bitrate is lower than x264 but the quality is still (just as) nice. (I) don't believe the 50% bitrate-of-h264 marketing speak (marketing people always seem to forget how good x264 is vs the commercial encoders :P). But if I end up with +/- 75% bitrate compared to a x264 'benchmark encode' and the quality is still pleasant, I'm happy and done.
Working with 1080p here btw. And doing test encodes is a bit easier for me since I work with lot of camera clips here, not whole movies.
Since everyone has different ideas if the quality 'is good enough' when looking at it, you'll have to pick your CRF values yourself :P.
sephirotic
19th December 2016, 04:26
I have been testing the applicability of HEVC for my personal projects and separated 3 different source types for comparing x264 with HEVC. I have tried these settings with some changes and indeed they significantly improved from the default tune. With a 5 minute Star War clips with mixed action and slow dark scenes, this tune actually made at CRF 20 the resulting x265 encode slightly better than my custom film x264 settings, but just marginally and at an abismal speed of 0.5fps, while with x264 with my settings I get 2.5fps. (resulting bitrate was 5000kbps)
However, I find CRF 20 pretty low and unnaceptable, most of the grain still is smudged away so I see no much point in trying to keep the grain at this level of quality, migh as well degrain and/or go with 720. I then tested the same clip with twice the bitrate (10mbps) both with x265 and x264 with these settings, but even with the improved quality from these settings, at 10mbps (around CRF 16), x265 still looks slightly worst and with less grain and dark detail retention than x264. Maybe tweaking with PSY and AQ settings I could further improve the quality, but considering how 0.5 fps the speed is abismal I see no point in trying to desperately fine tune the x265 encoder to get a marginal benefit comparing with x264. I decide to still go on with x264.
However, the later version of HEVC with some of these settings actually improved the quality for Digital Animation too which is now looking promissing and I can get marginally better results than x264 even at higher settings (around CRF 16), but the encode speed, is still abismal, It takes more than 12 hours to encode a single 23 minutes episode in 1080p, completely impractical.
Regarding these particular settings, for FILM I agree that it is better to not go with 8 b frames, 5 or 6 should be better. I also prefer to mess with I:p and I:B ratios instead of QCOMP, usually that gives a more homogeneous quality, I don't know how much wasted bits a higher QCOMP may give. I also have my doubts with -2 deblock for lower CRF settings, might stick with the default at around CRF 20. And finally, only with very low quality that "GOP pulsing" really becomes an issue with a small keyint, I prefer to have those extra I frames for reducing B+P frame degradation and improving seekability myself, specially because many of the files I encode I end up reusing them for edition.
Dclose
19th December 2016, 06:30
Regarding these particular settings, for FILM I agree that it is better to not go with 8 b frames, 5 or 6 should be better.
I also have my doubts with -2 deblock for lower CRF settings, might stick with the default at around CRF 20.
I had a video with a crowd in the background and a few people walking from left to right. The more B frames I threw at it, up to 12 maybe more, the more detailed their walking was. Maybe that's only a 1-2% difference, but I did notice it.
I vary deblock a lot depending on source quality and what final filesize I'm trying to hit. Good blurays, I'll often do -6/-6 at CRF 25, (though -5/-6 might be better). The more bitrate the less it uses deblock anyway.
Even -2/-2 deblock can put what seems like a veil over the video. Like looking through a window instead of looking out an open window. Too much Max Merge Candidates can do similar.
If you haven't already, turn off SAO, IntraSmoothing, and try Max Merge at 1. More Psy helps, even settings of 1.00/2.00 or 2.00/1.00 instead of the default 1.00/1.00.
I think the default x265 presets put off a lot of people since, as you said, lowering CRF a lot can still make things blurry. Once I started messing with the settings, I now think x265 is very impressive in both video quality and smaller filesizes compared to my x264 encodes of preset Very Slow. But that result does require a big drop in speed over x264.
dipje
19th December 2016, 15:09
just a FYI, psy-rd = 2, rdoq = 2 psy-rdoq = 1 is my default when not using a tuning.
The built-in 'tune grain' sets psy-rd = 4.00, rdoq = 2, psy-rdoq = 10.0.
You're saying the default is 1.00/1.00. Are you talking about something else or is your information about what is default just outdated?
Dclose
19th December 2016, 16:15
You're saying the default is 1.00/1.00. Are you talking about something else or is your information about what is default just outdated?
I can't check it right now, but I mostly use Hybrid, and I'm pretty sure it defaults to 1.00/1.00 with no preset or tune. Not that it matters since the point is to use more than 1.00/1.00 if you want more detail. Grain setting is excessive of course, but that's why it's called Grain and not Film.
If Sephirotic hasn't been turning off SAO and intrasmooth, I think those are more important to get rid of the blur than more Psy is. I tried x265 in the past but gave up due to so much blur, then I happened to uncheck SAO and was shocked at the difference.
dipje
19th December 2016, 16:37
That's why it's nicknames 'smooth all objects' I believe :P.
I do think that if you make the distinction between 'film tuning' and 'grain tuning' that turning off sao / intrasmooth and a --ctu 32 will get you _a lot of the way_ there with a recent x265 build (and use something around --preset medium or (preferred) a bit slower. Like --preset slow or --preset slower). Next step is probably the deblocking filter switches.
That's my 2 cents, but let's be clear that everyone has a different way of what the find 'ok' and 'good' or 'impressive' :). So please don't just take my advise as 'the given thing' or anything.
But the need for the big command lines is pretty much gone these days. If you really want extreme small detail retention you go back to '--tune grain'. And since they have a special 'grain bitrate mode' (--rc grain) the grain tuning has been way more effective.
There are a lot of options for trading speed and quality, and like --no-rect and --no-amp these might be worth it or not. But they don't change x265's small-detail retention
sephirotic
19th December 2016, 23:21
Yes, of course I've turned SAO and Intra-smoothing off, like I said, I used most of the tune suggestions from this thread, the encode settings were:
--ctu 32 --max-tu-size 16 --tu-intra-depth 2 --tu-inter-depth 2 --rdpenalty 2 --me 3 --subme 4 --merange 44 --b-intra --no-amp --ref 5 --weightb --keyint 120 --min-keyint 1 --bframes 6 --aq-mode 1 --aq-strength 1.2 --rd 5 --psy-rd 0.8 --psy-rdoq 5.0 --rdoq-level 1 --no-sao --no-open-gop --rc-lookahead 80 --scenecut 80 --max-merge 4 --qcomp 0.6 --no-strong-intra-smoothing --deblock -2:-2 --qg-size 16 --ipratio 1.3 --pbratio 1.2
I had a video with a crowd in the background and a few people walking from left to right. The more B frames I threw at it, up to 12 maybe more, the more detailed their walking was. Maybe that's only a 1-2% difference, but I did notice it.
Weere you ecoding with CRF? Was it a grainy source or low ISO good lighting digital camera? Those scenarios change a lot of how you should tune b frames for your own encode.
Anyway. With x264, I've tested 5 vs 12 b frames from a 16mm Animated TV series that had a good sinigificant amount of grain (Evangelion), as well as 1600 ISO raw footage from my HACKED GH2, I've read before that going beyond 9 b frames on x264 actually hurt the SSIM, this is why placebo only goes as far as 8 AFAIK. I also realize B frames don't work the same on HEVC so I did test back in version 1.9 of HEVC 5 vs 8 b frames for a moderate grainy source and found out that 5 actually worked better than 8, albeit giving a slightly higher filesize.
I'll test your suggestions for RDOQ and Psy RD this night, I'll leave the file encoding.
Of course a single picture is not ideal for comparing different encode tests, I can upload the files somewhere if you want, but the level of difference often gets as big as this example: (Use 1 2 and 3 on the keyboard to change the pictures)
http://diff.pics/BJNUbuFj3gTj/1
Those are both middle-B frames inside a GOP group, (if I got the number right for the HEVC), sometimes the difference for this sample get much closer to the point of even pixel peeping being difficult, of course switch tabing in play is almost impossible to distinguish the two files for most of the part (which again kinda of beats the purpose of HEVC), but often the x265 file had less grain and more smooth.
By the way, I've also found that subme 5 and 6 gets a lot of good efficiency boost when dealing with digital animation, over 10% of savings easily, but the speed loss is ridiculous, any point in going higher than 3 for 35mm film?
Good blurays, I'll often do -6/-6 at CRF 25,
With my tests I've found out that CRF 24 quality is so low for film content in 1080p, that if you take the resulting bitrate from the HEVC encode and do a 720p x264 encode with the same bitrate, the 720p x264 will look better. Try doing that once for yourself. I find CRF 24 unacceptable for piratically anything besides a HD screen smartphone.
EDIT2:
So I made two more test files using these settings
--ctu 32 --max-tu-size 16 --tu-intra-depth 2 --tu-inter-depth 2 --rdpenalty 2 --me 3 --subme 4 --merange 44 --b-intra --no-amp --ref 5 --weightb --keyint 120 --min-keyint 1 --bframes 6 --aq-mode 1 --aq-strength 1.2 --rd 5 --psy-rd 2.0 --psy-rdoq 5.0 --rdoq-level 2 --no-sao --no-open-gop --rc-lookahead 80 --scenecut 80 --max-merge 4 --qcomp 0.6 --no-strong-intra-smoothing --deblock -6:-6 --qg-size 16 --ipratio 1.3 --pbratio 1.2
And a second one just changing to deblock -1:-1
Both 2 pass 10mbps.
I tried the -6 suggestion for deblock from Dclose thinking that the high bitrate would not produce visible blocking but I was mistaken. The blocking was noticeable in some fast panning scenes. Then I retried with -1:-1 settings, with all the other settings remaining equal.
I got surprised by the result. The -1 setting seems to preserve MORE grain than the -6 setting, getting close to x264 level maybe even slightly better in some frames (tough I'd have to check if both are B frames, which is a pain to check in the x265 file) but the problem is that it had much more of the nasty "onion/banding lines" around contrast edges with often put me off from HEVC.
The -6 setting didn't have those edge artifacts but overall grain and detail retention was much WORSE than the -1 and AVC.
Maybe I should try tweaking QCOMP to try and Improve detail retention in slow scenes for the -6 setting while trying to live with the blocking in fast pan scenes, or maybe a middle ground -3 deblock setting, but after 5 different test encodes I'm already getting tired of "trying to extract blood from a stone".
Here are the results:
http://diff.pics/b6ipooP9fwNJ/3
albt
28th March 2017, 14:49
any update for this with new hevc version, what about settings for 2160p?
benwaggoner
28th March 2017, 17:45
I would suggest that we do comparisons in 2-pass VBR mode so that we aren't varying quality and file size at the same time. It gets really hard to understand how to weigh an individual parameter when it impacts both.
Sent from my iPhone using Tapatalk
xmixahlx
2nd September 2019, 18:25
wondering if there are updated recommendations for --tune film?
i'm assuming the topic has evolved since 2017, and also assume that these tunings have been incorporated into x265-yuuki mod with the littlepox tune. (but i haven't found a good english reference for mod changes, tune parameters, and usage recommendations, etc.)
i have been testing x265 10b crf20 none/littlepox slow using handbrake-git and x265-yuuki-git on linux with some success and looking for better understanding. (comparably, with x264 i use 8b crf18 tune film slow and weaken crf to lower bitrate with grainy sources with satisfaction.) currently my sources are my dvd collection ripped with makemkv, and will turn to bluray next.
i gather that tune littlepox is for film and tune vcbs is for anime. wondering about recommended adjustments for older cartoons, 3D/CGI, and grainy sources.
thank you for your consideration!
later
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.