H265Repack is an easy-to-use CLI video converter tool designed to repack single videos or video directories into the H.265 format, ensuring high efficiency and quality. On macOS, it leverages hardware-level H.265 encoding supported by macOS devices for optimal performance. On Linux, the script doesn't assume hardware configuration. Feel free to alter the script to support your device specifically.
If made executable the install_H265Repack
script will handle installing H265Repack
on any mac.
chmod +x /path/to/install_H265Repack.sh
This will also install a man page with additional information for the optional arguments.
I did not include an installer file for Linux due to the large array of customization options the system is known for. Simply copy the H265RepackLinux.sh script to a folder in your $PATH
and be sure to grant it executable permission. Additionally, the man page should be installed for clarity. The file is included at man/H265Repack.1
I'd love to see this script added to Homebrew someday. It will need wider adoption first, but I've already created the required .rb installer script for it once that threshold is met. Be sure to follow this posting if you find it useful, so we can add this to a proper package manager.
This is a command-line tool. It will accept either a standard video file or a directory containing video files for <source>
. It will then output the file(s) at the target destination including any recursive file structure. The basic syntax is as follows:
H265Repack <source> <target> <containerFormat> [crf] [preset-Compression]
<source>
: Path to source video file(s).<target>
: Path to save the converted video file(s).<containerFormat>
: Desired output container format (e.g., mp4, mkv).[crf]
: Optional. Constant Rate Factor for controlling the output quality (e.g., poor, good, superb or 0-51)[-preset]
: Optional. Preset for compression (e.g., fast, medium, slow or 0-9).
H265Repack input.mp4 output mkv
H265Repack /videos/source /videos/target mp4 fair 5
It is worth noting that hardware acceleration on macOS is only available when not using optional arguments. The hardware acceleration circutry is opinionated and doesn't allow for those optional customizations.
It is easy to get the latest codec libraries and encoding logic. Simply type:
H265Repack --update
These will update if newer versions are available:
Contributions are welcome! If you have suggestions for improvements or have found bugs, please email me at thebluwiz@icloud.com. For major changes, please open an issue first to discuss what you would like to change.
AV1
Titles.This project is created and maintained by TheBluWiz. If you have any questions or would like to see more of my projects, feel free to visit my GitHub or contact me at thebluwiz@icloud.com.
This project is licensed under the GNU General Public License (GPL) v3.0. For more details, see the LICENSE file in the repository.