DISCLAIMER: This process will overwrite the current Android ROM on your TV box. I have tested these steps on my own devices, but I am not responsible if you damage or brick your device. Verify the ROM will work on your device before starting and make sure to backup any data you do not want to lose before proceeding.
For more information read the original XDA thread at https://forum.xda-developers.com/t/v4-s905w-s912-rom-android-tv-9-pie-aidans-custom-rom-stable-3139-mi-box-firmware-port-to-amlogic-boxes.4199287