Go to belabox.net for the current installation instructions
You should consider joining the Discord if you want to use BELABOX. We have a lot of other relevant information there and you can also get help if you're running into problems.
Check out my Twitch channel for sample VODs streamed using BELABOX. If you're using BELABOX, please consider sponsoring the ongoing development.
These instructions were written for L4T 32.4.4 (Based on Ubuntu 18.4 LTS) and last tested on Dec 20th, 2020. Consider this a temporary guide to setting up BELABOX while a more convenient solution is being developed.
You'll need another Internet-connected machine to serve as the ingest for your srtla-bonded stream. This can be a low cost VPS or a Linux computer (even a low power RPi) at home. Follow the receiver instructions in the srtla readme for setting it up.
Set up a micro SD card with L4T following the instructions from NVIDIA for Jetson Nano 4GB or for Jetson Nano 2GB. Note that you can do the initial setup either using a monitor, mouse & keyboard or in headless mode using the USB serial console. For the rest of the tutorial we'll assume that the system was set up correctly and that you have SSH access to the Jetson Nano via the Ethernet network.
Updating the system packages (this may take a while):
sudo apt-get update
sudo apt-get dist-upgrade
Installing the required dependencies:
sudo apt-get install nano build-essential git tcl libssl1.0-dev nodejs npm usb-modeswitch libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
Add the google DNS servers so you have some resolvers accessible through any Internet-connected interfaces, as opposed to the servers accessible through a single mobile operator that you may be getting from DHCP:
printf "\nnameserver 8.8.8.8\nnameserver 8.8.4.4\n" | sudo tee -a /etc/resolvconf/resolv.conf.d/head
Let's set up source routing for any wired modems. This uses a dhclient hook, which will execute for dhcp entries in /etc/network/interfaces
or if called manually, but not for NetworkManager-managed devices. /etc/network/interfaces
takes over configuring the ethX and usbX network interfaces from NetworkManager
sudo wget https://raw.githubusercontent.com/BELABOX/tutorial/main/dhclient-source-routing -O /etc/dhcp/dhclient-exit-hooks.d/dhclient-source-routing
sudo wget https://raw.githubusercontent.com/BELABOX/tutorial/main/interfaces -O /etc/network/interfaces
printf "100 usb0\n101 usb1\n102 usb2\n103 usb3\n104 usb4\n" | sudo tee -a /etc/iproute2/rt_tables
printf "110 eth0\n111 eth1\n112 eth2\n113 eth3\n114 eth4\n" | sudo tee -a /etc/iproute2/rt_tables
Also set up source routing for WiFi with NetworkManager:
sudo wget https://raw.githubusercontent.com/BELABOX/tutorial/main/nm-source-routing -O /etc/NetworkManager/dispatcher.d/nm-source-routing
sudo chmod 755 /etc/NetworkManager/dispatcher.d/nm-source-routing
printf "120 wlan0\n121 wlan1\n122 wlan2\n123 wlan3\n124 wlan4\n" | sudo tee -a /etc/iproute2/rt_tables
If you have a WiFi adapter fitted, you can connect to a WiFi network with sudo nmcli device wifi connect <AP NAME> password <WPA password>
after rebooting.
We use the /etc/network/interfaces
configuration because it seems more reliable than Networkmanager at always bringing up all the interfaces. It also brings up all the modems even when they use the same MAC address (which is the case for several Huawei models), unlike NetworkManager.
Disable the virtual Ethernet interface as it will cause naming conflicts if you use modems that get enumerated as usbX
devices.
sudo systemctl disable nv-l4t-usb-device-mode.service
sudo reboot
Installing (the BELABOX fork of) SRT:
cd
git clone https://github.com/BELABOX/srt.git
cd srt
./configure --prefix=/usr/local
make -j4
sudo make install
sudo ldconfig
Building belacoder:
cd
git clone https://github.com/BELABOX/belacoder.git
cd belacoder
make
Building srtla:
cd
git clone https://github.com/BELABOX/srtla.git
cd srtla
make
Setting up belaUI:
cd
git clone https://github.com/BELABOX/belaUI.git
cd belaUI
git checkout ws_nodejs
Install the Node.js dependencies:
npm install
Edit setup.json
with the paths to the belacoder
and srtla
directories.
You can start the web interface to test it with:
sudo nodejs belaUI.js
At this point BELABOX is ready to use, assuming that you have a capture card / other v4l2 input connected. Open http://address_of_the_jetson
in a web browser. It will first ask you to set a password for access.
See the belacoder readme for information about the available pipelines you can select in the Encoder settings menu of the web interface. Configure the srtla settings with the data for your ingest configured at Step -1.
After setting up and confirming that everything is working correctly, you can install belaUI as a system service that starts automatically at boot by running:
sudo ./install_service.sh
For practical use, you should configure belaUI to be automatically started at boot and use a phone to control it.
If you become a recurring github sponsor, you'll get a BELABOX cloud remote account allowing you to manage your encoder from any Internet-connected device via cloud.belabox.net. Otherwise you'll need a direct LAN connection to your encoder to access belaUI. Depending on your modem setup, you could make belaUI accessible either through a modem that has both USB (for the Jetson) and WiFI (for the phone) interfaces, or by enabling the hotspot feature on the phone and connecting the Jetson to it as per step 4, or by setting up a Wifi access point on the Jetson Nano - outside the scope of this tutorial.
Regardless of how many connections are available, BELABOX always streams via srtla. To receive this stream, you have several options, including:
- Become a github sponsor, support the BELABOX project and receive access to our hosted srtla/SRT relay service with servers in the US and France.
- Follow the srtla readme to set up a basic relay using srt-live-transmit or another SRT server configured with the equivalent options.
- Use a third party docker image configured to receive srtla, such as this one. Note that we can make no guarantees about third party packages being maintained to support future revisions of the srtla software.
If you're not confident following any of the instructions, please wait until we're able to distribute BELABOX in a more convenient format.
Once you're set up, check out the bitrate guide.