Live stream your balena device's camera feed.
Running this project is as simple as deploying it to a fleet.
One-click deploy to balenaCloud:
or
Sign up on balena.io and follow our Getting Started Guide.
Clone this repository to your local workspace.
Unset (delete) the environment variable BALENA_HOST_CONFIG_gpu_mem
or RESIN_HOST_CONFIG_gpu_mem
if exists, from the Configuration
side tab under "fleets".
Set these variables in the Configuration
side tab under "fleets".
BALENA_HOST_CONFIG_start_x
= 1
gpu_mem
variables so your Pi can autoselect how much memory to allocate for hardware accelerated graphics, based on how much RAM it has availableKey | Value |
---|---|
BALENA_HOST_CONFIG_gpu_mem_256 |
192 |
BALENA_HOST_CONFIG_gpu_mem_512 |
256 |
BALENA_HOST_CONFIG_gpu_mem_1024 |
448 |
Using Balena CLI, push the code with balena push <fleet-name>
.
See the magic happening, your device is getting updated 🌟Over-The-Air🌟!
In order for your device to be accessible over the internet, toggle the switch called PUBLIC DEVICE URL
.
Once your device finishes updating, you can watch the live feed by visiting your device's public URL.
To protect your balenaCam devices using a username and a password set the following environment variables.
Key | Value |
---|---|
username |
yourUserNameGoesHere |
password |
yourPasswordGoesHere |
💡 Tips: 💡
rotation
= 1
(More information about this on the docs).PYTHONWARNINGS
= ignore
If you have access to a TURN server and you want your balenaCam devices to use it. You can easily configure it using the following environment variables. When you set them all the app will use that TURN server as a fallback mechanism when a direct WebRTC connection is not possible.
Key | Value |
---|---|
STUN_SERVER |
stun:stun.l.google.com:19302 |
TURN_SERVER |
turn:<yourTURNserverIP>:<yourTURNserverPORT> |
TURN_USERNAME |
<yourTURNserverUsername> |
TURN_PASSWORD |
yourTURNserverPassword |
Want to learn more about what makes balena work? Try one of our masterclasses. Each lesson is a self-contained, deeply detailed walkthrough on core skills to be successful with your next edge project.
Check them out at our docs. Also, reach out to us on the Forums if you need help.