Core Alive daemon and CLI tool for publishing HLS streams to decentralized networks.
This is the main daemon that is used by streamers to upload .ts segments of a local HLS stream to IPFS and publishes its hash and duration to decentralized networks.
Python 3.8+, pip3
package manager and AliveDB dependencies are required.
Additionally, the following packages are required for its dependency packages to be installed successfully:
sudo apt-get install build-essential libssl-dev python3-dev python3-pip python3-setuptools
sudo yum install gcc openssl-devel python-devel
brew install openssl
export CFLAGS="-I$(brew --prefix openssl)/include $CFLAGS"
export LDFLAGS="-L$(brew --prefix openssl)/lib $LDFLAGS"
pkg install clang openssl python
You may also want to install IPFS node for uploading .ts segments to your local repo:
git clone https://github.com/aliveprotocol/Alive-CLI
cd Alive-CLI
To create the virtual environment (one-time):
python3 -m venv .venv --prompt alivecli
To enter the virtual environment:
source .venv/bin/activate
pip3 install . --use-pep517
alivedb_install
The default data directory is ~/.alive
where all Alive working files will be stored.
Begin from step 3 if streaming directly on-chain.
- If not already, create an AliveDB user account.
alivedb_usercreate <new_alivedb_password>
- Publish your AliveDB public key to your new stream.
alive_configure hive <hive_api_node> <link> <alivedb_pubkey> <username> <posting_key>
-
Setup OBS recording output settings according to the config below.
-
Start the Alive daemon. To get CLI usage info:
alivecli --help
- Start recording in OBS.
- Stop recording in OBS.
- Let the final segment to complete processing, then hit
Ctrl+C
on Alive daemon. - Let the world know that the stream has ended so that the stream archive will be seekable.
alive_end hive <hive_api_node> <link> <username> <posting_key>
ⓘ Important Your recording output configuration must match the settings below. Failing to do so may result in failed uploads or excessive use of bandwidth or resource credits.
- Output mode: Advanced
- Type: Custom output (FFmpeg)
- FFmpeg output type: Output to File
- File path:
~/.alivedb/record_here
- Container format: hls
- Muxer settings: hls_time=10
- Keyframe interval: Set this to 10x your framerate. For example, if you're recording at 30fps, set this value to 300.
The Alive daemon can be invoked programmatically in Python as well. For a detailed guide (including example code snippets), check out the Streamer SDK developer documentation.