2019-05-11, 03:35 AM
Following the idea of the [/url][url=https://fanrestore.com/thread-97.html]x264 BD compliant "perfect" settings, I thought it was time to do the same for x265 and Ultra HD Blu-ray.
Studied a bit here and there, and came to the following settings:
replace 50000 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. Max bitrate and buffer size were set to 64000 to be used with a BD-50, but should be lowered to 50000 to fix eventual compatibility problems, and to 35000 to be used with a BD-25; in case someone would risk to use a BD-XL 100, it could be set to 100000 (as 109000 is the maximum bitrate including audio and subs tracks).
You can use them directly with the x265 command line - just copy and paste pass 1 settings then, when finished, copy and paste pass2 settings - or save as .bat file (thanks to Feallan for the idea), or use them inside some GUIs - the best so far IMHO is Simple x264 Launcher, but using any software that is not the original x265 command line could add some further setting that could lead to have a not-compliant file, so be aware, you are warned! And, do NOT delete any temp files you get after pass 1 (.stats and .stats.mbtree) because they will be used by pass 2!!!
HINTS:
x265 command line options - https://x265.readthedocs.io/en/default/cli.html
Ultra HD Blu-ray white paper - http://blu-raydisc.com/Assets/Downloadab...clean).pdf
tsMuxeR 2.6.12 - https://www.videohelp.com/software/tsMuxeR
TSM2UHD - https://forum.doom9.org/showthread.php?t=175120
Studied a bit here and there, and came to the following settings:
ATTENTION: PROVISIONAL UNTESTED SETTINGS!!!
UPDATED: 2019-06-09
REVIEWERS AND TESTERS ARE NEEDED!!!
for the following sources: 1920x1080 or 3840x2160, 10bit, SDR, bt709
Code:
x265.exe --pass 1 --uhd-bd --bitrate 50000 --vbv-maxrate 64000 --vbv-bufsize 64000 --keyint 24 --min-keyint 1 --preset medium --tune grain --profile main10 --level-idc 51 --high-tier --aud --sar 1 --hrd --repeat-headers --no-open-gop --ref 5 --no-temporal-layers --overscan show --wpp --input-depth 10 --output-depth 10 --no-interlace --range limited --colorprim bt709 --transfer bt709 --colormatrix bt709 --stats ".stats" --output NUL "Input_File.avs"
x265.exe --pass 2 --uhd-bd --bitrate 50000 --vbv-maxrate 64000 --vbv-bufsize 64000 --keyint 24 --min-keyint 1 --preset medium --tune grain --profile main10 --level-idc 51 --high-tier --aud --sar 1 --hrd --repeat-headers --no-open-gop --ref 5 --no-temporal-layers --overscan show --wpp --input-depth 10 --output-depth 10 --no-interlace --range limited --colorprim bt709 --transfer bt709 --colormatrix bt709 --stats ".stats" --output "Output_File.265" "Input_File.avs"
for the following sources: 1920x1080 or 3840x2160, 10bit, HDR, bt2020
Code:
x265.exe --pass 1 --uhd-bd --bitrate 50000 --vbv-maxrate 64000 --vbv-bufsize 64000 --keyint 24 --min-keyint 1 --preset medium --tune grain --profile main10 --level-idc 51 --high-tier --aud --sar 1 --hrd --repeat-headers --no-open-gop --ref 5 --no-temporal-layers --overscan show --wpp --input-depth 10 --output-depth 10 --no-interlace --range limited --chromaloc 2 --colorprim bt2020 --transfer bt2020-10 --colormatrix bt2020nc --max-cll "1000,400" --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)" --stats ".stats" --output NUL "Input_File.avs"
x265.exe --pass 2 --uhd-bd --bitrate 50000 --vbv-maxrate 64000 --vbv-bufsize 64000 --keyint 24 --min-keyint 1 --preset medium --tune grain --profile main10 --level-idc 51 --high-tier --aud --sar 1 --hrd --repeat-headers --no-open-gop --ref 5 --no-temporal-layers --overscan show --wpp --input-depth 10 --output-depth 10 --no-interlace --range limited --chromaloc 2 --colorprim bt2020 --transfer bt2020-10 --colormatrix bt2020nc --max-cll "1000,400" --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)" --stats ".stats" --output "Output_File.265" "Input_File.avs"
replace 50000 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. Max bitrate and buffer size were set to 64000 to be used with a BD-50, but should be lowered to 50000 to fix eventual compatibility problems, and to 35000 to be used with a BD-25; in case someone would risk to use a BD-XL 100, it could be set to 100000 (as 109000 is the maximum bitrate including audio and subs tracks).
You can use them directly with the x265 command line - just copy and paste pass 1 settings then, when finished, copy and paste pass2 settings - or save as .bat file (thanks to Feallan for the idea), or use them inside some GUIs - the best so far IMHO is Simple x264 Launcher, but using any software that is not the original x265 command line could add some further setting that could lead to have a not-compliant file, so be aware, you are warned! And, do NOT delete any temp files you get after pass 1 (.stats and .stats.mbtree) because they will be used by pass 2!!!
HINTS:
- these settings are good for 1080p or 2160p video
- pay attention to the BD size: actual ones are 23.3GiB for BD-25, 46.6GiB for BD-50, 93.2GiB for BD-XL 100
- allow about 7% overhead for the .m2ts container - for example, total file size (video+audio+subs) excluding eventual menus would be around 21.75GiB for a BD-25, 43.55GiB for a BD-50, 87.09GiB for a BD-XL 100
- to retain grain, better to use as much bitrate as possible - the one the disc allow to
- max bitrate allowed for UHD-BD video is 100mbps, so you should be careful only if using a BD-XL 100 and if audio plus subs tracks total bitrate is over 9000mbps, 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.
x265 command line options - https://x265.readthedocs.io/en/default/cli.html
Ultra HD Blu-ray white paper - http://blu-raydisc.com/Assets/Downloadab...clean).pdf
tsMuxeR 2.6.12 - https://www.videohelp.com/software/tsMuxeR
TSM2UHD - https://forum.doom9.org/showthread.php?t=175120