Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Idea] x264 BD compliant "perfect" settings - faster version
#1
I propose here to switch from veryslow preset to medium, retaining 99.7% of its quality and cut in half the encoding time (according to this page); I took previous settings found here, and added only --ref 4 to maintain BD compliance, and --direct auto to improve quality.

Of course, 0.3% of quality loss and encoding time cut in half would apply only to plain presets (i.e. without messing with other settings); if the encoding time will be only slightly reduced, there will be no need to use these settings; so, some tests are needed - volunteers are welcome! Wink


SETTINGS:

Code:
x264.exe --pass 1 --preset medium --tune film --bluray-compat --level 4.1 --ref 4 --direct auto --keyint 24 --slices 4 --b-pyramid none --weightp 0 --sar 1:1 --colorprim bt709 --transfer bt709 --colormatrix bt709  --bitrate 25000 --vbv-bufsize 30000 --vbv-maxrate 40000 --stats ".stats" --output NUL "Input_File.avs"

x264.exe --pass 2 --preset medium --tune film --bluray-compat --level 4.1 --ref 4 --direct auto --keyint 24 --slices 4 --b-pyramid none --weightp 0 --sar 1:1 --colorprim bt709 --transfer bt709 --colormatrix bt709  --bitrate 25000 --vbv-bufsize 30000 --vbv-maxrate 40000 --stats ".stats" --output "Output_File.264" "Input_File.avs"

replace 25000 with the desired average bitrate, 24 in the keyint with the video framerate (24 would do for 23.976 and 30 for 29.97), Input_File.avs with an AviSynth script (or a video file), and Output_File.264 with the final x264 file.

You can use them directly with the x264 command line - just copy and paste pass 1 settings then, when finished, copy and paste pass2 settings - or save as .bat file

HINTS:
  • these settings are good for 1080p video
  • pay attention to the BD size: actual ones are 23.3GB for BD-25 and 46.6GB for BD-50
  • allow about 7% overhead for the .m2ts container - for example, total file size (video+audio+subs) excluding eventual menus would be around 21.75GB for a BD-25, and 43.55 for a BD-50
  • to retain grain, better to not go under 20/22mbps for 2.35:1 and 28/30mbps for 1.78:1/1.85:1
  • max bitrate allowed for BD (video+audio) is 48000mbps, so if audio tracks total bitrate is over 8000mbps, you should lower video bitrate accordingly, in particular pay attention to --vbv-maxrate
  • to improve speed, you can use for pass 1 a "simpler" version of the final file, for example without noise reduction, grain plate, color grading, but it should be otherwise identical - same frame numbers, same resolution etc.
  • do NOT delete any temp files you get after pass 1 (.stats and .stats.mbtree) because they will be used by pass 2!!!
Reply
Thanks given by:
#2
It's an interesting suggestion and would make an interesting project for someone over the Christmas holiday. Personally I suspect that at the high bitrates with which we typically work the gains may not be so great, there may even be a penalty in that to retain grain a higher bitrate will be required. Personally I encode overnight so time savings do not necessarily bother me but as always YMMV.
Reply
Thanks given by:
#3
^^ The rapidly diminishing returns that occur when you go beyond medium are fairly well known, as is the hike in encoding time.  There's not much that needs testing, in my opinion. For people whose computers struggle with encoding, going much beyond medium is probably not worth it, which is why I didn't do so when I sent you the first lot of x264 settings, which were a compromise made with your old (slower) computer in mind.

For films that I care about enough to work on and release, I prefer to use the veryslow preset to retain as much quality as possible.  For run-of-the-mill encodings, in which I simply want to have a decent version of something to watch, I use medium or occasionally slow.  To my mind, going to slow is usually worth it, because I like to use multi-hexagon for motion estimation, and I think it hangs on to the grain a bit better.

EDIT: Like zoidberg, I encode over night and don't care about time.
Reply
Thanks given by:
#4
Well, if I'll lose even 1% quality, but this would take encoding time from 36/48hrs to 18/24hrs... I'm all in! Wink
Reply
Thanks given by:
#5
Generally I run --tune grain in the first pass, then tune film in the second. It provides better bit allocation to the grainiest scenes where the additional detail is required. I also tend to prefer b-pyramid and weighted p frames.

I build the Blu-Ray first usually, use multiavchd to slip a CRF=1 encode into it using reauthor mode, then use BD_Rebuilder. I have mine set to the highest possible settings.
Reply
Thanks given by:
#6
(2017-12-19, 09:53 PM)nightstalkerpoet Wrote: Generally I run --tune grain in the first pass, then tune film in the second. It provides better bit allocation to the grainiest scenes where the additional detail is required.

That's an interesting hint!

Quote:I also tend to prefer b-pyramid and weighted p frames.

But they are not BD compliant...
Reply
Thanks given by:
#7
(2017-12-19, 08:44 PM)Chewtobacca Wrote: EDIT: Like zoidberg, I encode over night and don't came about time.

Same here.

And overnight is short, I've had AVI encodes that took days.
New, low or non-posting members: Please do not post or PM me asking where to get something. Stick around and become a participating member first.

Looking For:
Alien 1999 Master Japanese BSHI Broadcast 1080i mid 2000s
Blade Runner DC US HDTV Broadcast 1080i 2005 (blade.runner.1080i.dd5.1.oar)
Reply
Thanks given by:
#8
b-pyramid 1 or strict is bluray compliant
Reply
Thanks given by:
#9
For those who create a lossless intermediate before x264 encoding, it's worth remembering that UT video codec will encode through x264 quicker than an equivalent lagarith file.
Reply
Thanks given by:
#10
Are use using dgdecnv at all? If you have a good video card, it offers speed improvements in avisynth to frameserve to x264. It won't read lossless files, which is why I encode my intermediates at CRF=1
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
  x265 UHD-BD compliant "perfect" settings spoRv 14 3,828 2020-09-29, 10:19 PM
Last Post: Chewtobacca
  x264 - filesize output calculator for 2-pass and CRF ? loa 7 229 2020-08-05, 10:30 PM
Last Post: spoRv
  NVenc Test Settings Chewtobacca 2 144 2020-08-04, 07:56 PM
Last Post: Chewtobacca
Thumbs Up x264 BD compliant "perfect" settings spoRv 142 88,477 2020-05-31, 08:24 PM
Last Post: alexpeden2000
  Handbrake settings - question JackForrester 3 702 2020-03-21, 09:25 PM
Last Post: TomArrow
  x264 encoding from Adobe Premiere DoomBot 26 8,418 2019-03-25, 08:26 PM
Last Post: jaminmc
  Tools and settings for compressing x264? NeonBible 1 846 2019-01-11, 12:01 PM
Last Post: MrBrown
  [Help] DNxHR to x264? Valeyard 2 1,074 2018-12-26, 10:16 AM
Last Post: TomArrow
  x264: 32bit or 64bit? spoRv 15 9,652 2018-03-03, 08:57 PM
Last Post: TomArrow
  xvYCC for x264 nightstalkerpoet 7 3,152 2017-12-30, 09:42 AM
Last Post: nightstalkerpoet

Forum Jump:


Users browsing this thread: 1 Guest(s)