Mcbcphp is a PHP CLI utility (built with Laravel Zero) for calculating display-link bandwidth requirements from core video parameters such as resolution, color depth, refresh rate, and protocol overhead.
It computes required bandwidth for multiple chroma subsampling modes and recommends the minimum HDMI and DisplayPort generations that can carry each computed bandwidth.
- Fast command-line bandwidth calculation for display configurations.
- Supports key video input parameters:
- Width (pixels)
- Height (pixels)
- Color depth (bits per pixel)
- Refresh rate (Hz)
- Optional overhead multiplier (default:
1.2)
- Calculates outputs for multiple chroma subsampling profiles:
4:4:44:2:24:2:0 / 4:1:1
- Suggests minimum compatible cable/protocol version for:
- HDMI
- DisplayPort
- Terminal-friendly formatted output via Termwind.
- Includes Pest-based test scaffolding and a feature test for the
calccommand. - Supports standalone binary packaging configuration via Box.
app/Commands/CalcCommand.php— CLI command definition and orchestration.app/Services/CalcService.php— bandwidth formulas and cable version matching.app/Services/RenderService.php— formatted output rendering.config/commands.php— command discovery/default command behavior.mcbcphp— executable PHP entrypoint.box.json— standalone build configuration.
- PHP
^8.2 - Composer
^2
git clone <your-repo-url> mcbcphp
cd mcbcphpcomposer installphp mcbcphpIf dependencies are installed correctly, this will show the Laravel Zero command summary/help output.
php mcbcphp calc {width} {height} {colour_depth} {refresh_rate} {overhead=1.2}width(int): Display width in pixels.height(int): Display height in pixels.colour_depth(int): Bits per pixel (for example24or30).refresh_rate(int): Refresh rate in Hz.overhead(float, optional): Protocol overhead multiplier. Defaults to1.2.
php mcbcphp calc 1920 1080 24 60php mcbcphp calc 3840 2160 30 120 1.2- Input summary (resolution, color depth, refresh rate, overhead)
- Computed bandwidth for each chroma subsampling mode
- Minimum HDMI version suggestion
- Minimum DisplayPort version suggestion
config/app.php- App name (
Mcbcphp) - Version sourced from
app('git.version') - Environment default (
development)
- App name (
config/commands.php- Default command is Laravel Console Summary when no command is provided.
- Commands are auto-loaded from
app/Commands.
box.json- Includes
app,bootstrap,config, andvendor - Uses gzip compression and PHP/JSON compactors
- Useful for building distributable PHAR artifacts
- Includes
laravel-zero/framework^12.0.2
laravel/pintmockery/mockerypestphp/pest
See composer.json and composer.lock for full dependency graph and pinned versions.
Run tests with:
./vendor/bin/pestor
php artisan testIn a fresh environment, you must install dependencies first.
This project includes Box configuration (box.json) and platform launchers in builds/:
builds/mcbcphp(Unix-like wrapper)builds/mcbcphp.bat(Windows wrapper)
If you package as PHAR, ensure wrappers and execution permissions are configured appropriately.
This project is licensed under the MIT License. See LICENSE.
- The project started from a Laravel Zero template and has been customized to implement a display bandwidth calculator command.
- If you extend this tool, consider adding argument validation (for positive numeric ranges) and additional tests for edge cases and higher-end cable standards.