All Projects → balenalabs → Balena Cam

balenalabs / Balena Cam

Licence: apache-2.0
Network Camera with Raspberry Pi and WebRTC. Tutorial:

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Balena Cam

Rpi Webrtc Streamer
This repo's objective is providing something like Web Cam server on the most popular Raspberry PI hardware. By integrating [WebRTC](https://webrtc.org/native-code/) and Raspberry PI, we can stream the Raspberry camera feed to browser or native client which talks WebRTC.
Stars: ✭ 428 (+256.67%)
Mutual labels:  raspberry-pi, raspberry-pi-camera, webrtc
Mmalsharp
C# wrapper to Broadcom's MMAL with an API to the Raspberry Pi camera.
Stars: ✭ 152 (+26.67%)
Mutual labels:  raspberry-pi, camera, raspberry-pi-camera
Raztot
A simple DIY, browser controlled, RPi + WebRTC video streaming rover
Stars: ✭ 67 (-44.17%)
Mutual labels:  raspberry-pi, raspberry-pi-camera, webrtc
Raspberryio
The Raspberry Pi's IO Functionality in an easy-to-use API for Mono/.NET/C#
Stars: ✭ 593 (+394.17%)
Mutual labels:  raspberry-pi, camera, raspberry-pi-camera
Pi Camera In A Box
Stream your Raspberry Pi Camera Module directly to your web browser
Stars: ✭ 49 (-59.17%)
Mutual labels:  raspberry-pi, raspberry-pi-camera
Pi Webcam
Automation to configure a Raspberry Pi as a USB OTG webcam
Stars: ✭ 990 (+725%)
Mutual labels:  raspberry-pi, camera
Picroscopy
A Python web-application to turn a Raspberry Pi and PiCam into a microscopy solution
Stars: ✭ 54 (-55%)
Mutual labels:  raspberry-pi, raspberry-pi-camera
Homekitcam
A project to make a Raspberry Pi driven, HomeKit Enabled camera.
Stars: ✭ 69 (-42.5%)
Mutual labels:  raspberry-pi, raspberry-pi-camera
Fotobox
Python based photo-booth script for Raspberry Pi and RPi Camera
Stars: ✭ 22 (-81.67%)
Mutual labels:  raspberry-pi, raspberry-pi-camera
Rpindvi
Raspberry PI NDVI Code
Stars: ✭ 57 (-52.5%)
Mutual labels:  raspberry-pi, camera
Raspberry Pi Diy Projects
Collection of Do-It-Yourself Projects on Raspberry Pi 2 / 3 & Zero W with diverse HATs and pHATs.
Stars: ✭ 70 (-41.67%)
Mutual labels:  raspberry-pi, raspberry-pi-camera
Meething Ml Camera
Machine-Learning powered Virtual Camera with SVG Animation (alpha)
Stars: ✭ 36 (-70%)
Mutual labels:  camera, webrtc
Picamera
Capture the stream of Images for a Raspberry Pi Camera in GoLang
Stars: ✭ 21 (-82.5%)
Mutual labels:  raspberry-pi, camera
Jarvis Ai
It is an AI assistant which will automate your task like it can send emails also it can control lights using raspberry pi it can inform about weather and many more features
Stars: ✭ 52 (-56.67%)
Mutual labels:  raspberry-pi, raspberry-pi-camera
Raspberryrobot
基于树莓派的智能机器人
Stars: ✭ 11 (-90.83%)
Mutual labels:  raspberry-pi, raspberry-pi-camera
Phormatics
Using A.I. and computer vision to build a virtual personal fitness trainer. (Most Startup-Viable Hack - HackNYU2018)
Stars: ✭ 79 (-34.17%)
Mutual labels:  camera, webrtc
Rpicam
Raspberry PI Surveillance Automation
Stars: ✭ 77 (-35.83%)
Mutual labels:  raspberry-pi, camera
Picamera
A pure Python interface to the Raspberry Pi camera module
Stars: ✭ 1,339 (+1015.83%)
Mutual labels:  raspberry-pi, raspberry-pi-camera
Instacam
Instant canvas video
Stars: ✭ 106 (-11.67%)
Mutual labels:  camera, webrtc
Pistreaming
A little demo of streaming the Pi's camera to web browsers
Stars: ✭ 655 (+445.83%)
Mutual labels:  raspberry-pi, raspberry-pi-camera

Live stream your balena device's camera feed.

Getting started

Running this project is as simple as deploying it to a balenaCloud application.

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 Fleet Configuration application side tab.
  • Set these variables in the Fleet Configuration application side tab
    • BALENA_HOST_CONFIG_start_x = 1

    • Set all the following gpu_mem variables so your Pi can autoselect how much memory to allocate for hardware accelerated graphics, based on how much RAM it has available

      Key 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 <application-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.

Password Protect your balenaCam device

To protect your balenaCam devices using a username and a password set the following environment variables.

Key Value
username yourUserNameGoesHere
password yourPasswordGoesHere

💡 Tips: 💡

Optional Settings

  • To rotate the camera feed by 180 degrees, add a device variable: rotation = 1 (More information about this on the docs).
  • To suppress any warnings, add a device variable: PYTHONWARNINGS = ignore

TURN server configuration

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

Additional Information

  • This project uses WebRTC (a Real-Time Communication protocol).
  • A direct WebRTC connection fails in some cases.
  • This current version uses mjpeg streaming when the webRTC connection fails.
  • Chrome browsers will hide the local IP address from WebRTC, making the page appear but no camera view. To resolve this try the following
    • Navigate to chrome://flags/#enable-webrtc-hide-local-ips-with-mdns and set it to Disabled
    • You will need to relaunch Chrome after altering the setting
  • Firefox may also hide local IP address from WebRTC, confirm following in 'config:about'
    • media.peerconnection.enabled: true
    • media.peerconnection.ice.obfuscate_host_addresses: false

Supported Browsers

  • Chrome (but see note above)
  • Firefox (but see note above)
  • Safari
  • Edge (only mjpeg stream)

Become a balena poweruser

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.

License

Copyright 2018 Balena Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].