- Messages
- 2,685
- Reaction score
- 8
- Trophy Points
- 48
This is a very short guide devoted to answering a single question:
How do I encode a BD via the command-line?
Assuming [email protected] input, I do it like this.
Windows
Feed your rendered video to x264 via AviSynth. (My decoding guide has instructions for writing a basic script.)
Linux
The main difference is that on Linux you'll probably be feeding x264 via ffms support: your distro should have such a version in its repos. To check, open a terminal and run:
This is the line that you need to look for:
Ensure that it says (yes) next to "ffms support".
Bitrate
Use a bitrate calculator to determine the average bitrate, and change --bitrate XXXXX accordingly: e.g., --bitrate 25000.
Closing GOPs and setting b-pyramid to none and weightp to 0 are measures that promote compatibility with older chip-sets (and can help with fussy authoring programs) but are not strictly required by the BD spec, which looks like shon3i's excellent post here. If you are encoding anything other than [email protected], I suggest that you follow the command-lines given on this site but adjust them to include the three compatibility measures given above (i.e. by adding --b-pyramid none and --weightp 0 and removing --open-gop in order to close the GOPs).
Tools
x264
AviSynth (I always recommend the latest non-MT version.)
Bitrate Calculator
tsMuxeR
I always use a 32-bit workflow because the 32-bit versions of tools are usually more up to date, but you can use a 64-bit workflow if you like. N.B. You must use like with like i.e. you cannot use the 32-bit version of AviSynth with the 64-bit of x264 (and vice versa). If in doubt, keep everything 32-bit and you will not go wrong.
N.B. I do not intend to turn this into a thread about using or troubleshooting the various GUIs that are available (e.g. MeGUI). Please start separate threads in you want to discuss those.
Muxing
Nightly builds of tsMuxer for Linux, macOS, and Windows are currently available at VideoHelp.com.
N.B. Questions about colorspace conversions and levels issues are beyond the scope of this guide.
How do I encode a BD via the command-line?
Assuming [email protected] input, I do it like this.
Windows
Code:
"x264.exe" --pass 1 --bitrate XXXXX --bluray-compat --level 4.1 --preset slower --tune film --keyint 24 --sar 1:1 --slices 4 --vbv-bufsize 30000 --vbv-maxrate 40000 --b-pyramid none --weightp 0 --colorprim bt709 --transfer bt709 --colormatrix bt709 --merange 24 --output NUL "whatever.avs"
"x264.exe" --pass 2 --bitrate XXXXX --bluray-compat --level 4.1 --preset slower --tune film --keyint 24 --sar 1:1 --slices 4 --vbv-bufsize 30000 --vbv-maxrate 40000 --b-pyramid none --weightp 0 --colorprim bt709 --transfer bt709 --colormatrix bt709 --merange 24 --output "whatever.264" "whatever.avs"
Feed your rendered video to x264 via AviSynth. (My decoding guide has instructions for writing a basic script.)
Linux
Code:
x264 --pass 1 --bitrate XXXXX --bluray-compat --level 4.1 --preset slower --tune film --keyint 24 --sar 1:1 --slices 4 --vbv-bufsize 30000 --vbv-maxrate 40000 --b-pyramid none --weightp 0 --colorprim bt709 --transfer bt709 --colormatrix bt709 --merange 24 --output /dev/null --fps 24000/1001 input.mkv
x264 --pass 2 --bitrate XXXXX --bluray-compat --level 4.1 --preset slower --tune film --keyint 24 --sar 1:1 --slices 4 --vbv-bufsize 30000 --vbv-maxrate 40000 --b-pyramid none --weightp 0 --colorprim bt709 --transfer bt709 --colormatrix bt709 --merange 24 --output output.264 --fps 24000/1001 input.mkv
The main difference is that on Linux you'll probably be feeding x264 via ffms support: your distro should have such a version in its repos. To check, open a terminal and run:
Code:
x264 --fullhelp | head
This is the line that you need to look for:
Code:
or libav* formats if compiled with lavf support (yes) or ffms support (yes)
Ensure that it says (yes) next to "ffms support".
Bitrate
Use a bitrate calculator to determine the average bitrate, and change --bitrate XXXXX accordingly: e.g., --bitrate 25000.
Closing GOPs and setting b-pyramid to none and weightp to 0 are measures that promote compatibility with older chip-sets (and can help with fussy authoring programs) but are not strictly required by the BD spec, which looks like shon3i's excellent post here. If you are encoding anything other than [email protected], I suggest that you follow the command-lines given on this site but adjust them to include the three compatibility measures given above (i.e. by adding --b-pyramid none and --weightp 0 and removing --open-gop in order to close the GOPs).
Tools
x264
AviSynth (I always recommend the latest non-MT version.)
Bitrate Calculator
tsMuxeR
I always use a 32-bit workflow because the 32-bit versions of tools are usually more up to date, but you can use a 64-bit workflow if you like. N.B. You must use like with like i.e. you cannot use the 32-bit version of AviSynth with the 64-bit of x264 (and vice versa). If in doubt, keep everything 32-bit and you will not go wrong.
N.B. I do not intend to turn this into a thread about using or troubleshooting the various GUIs that are available (e.g. MeGUI). Please start separate threads in you want to discuss those.
Muxing
Nightly builds of tsMuxer for Linux, macOS, and Windows are currently available at VideoHelp.com.
N.B. Questions about colorspace conversions and levels issues are beyond the scope of this guide.