Skip to content

Remote video and audio for Raspberry Pi over LAN without knowing the internal IP

Notifications You must be signed in to change notification settings

Oliverdeb/Remote-audio-and-video-for-Raspberry-Pi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

About this project

This project was completed during a 4-week internship.

Aim

To send and receive audio and video simultaneously from a Raspberry Pi using the Raspberry Pi camera module and a USB headset attached to the Pi ( all done by UV4L ). I was required to implement a way to start the stream without knowing the IP of the Raspberry Pi before hand.

Gotcha

This implementation only works over LAN. Using services like weaved or port-forwarding will get you going for internet streaming too - but beware, it is very bandwidth intensive. You will have to play around with the fps and video quality to have a stable stream ( bandwidth dependent ).

Prerequisites:

  • Python 2.7 for UDPmulticaster.py on the Raspberry Pi.
  • Python 3.5 for the startstream.py script on the client.
  • UV4L installed on the Raspberry Pi ( see below for installation details ).
  • avahi-daemon installed on Raspberry Pi ( not mandatory, but can make things easier, used to automatically resolve raspberrypi.local to its IPv4 address ).
  • Camera module / webcam for video and a headset with a microphone for the Raspberry Pi.
  • Raspbian Jessie / Wheezy installed on the Raspberry Pi.
  • A power source of some kind, this is intended to be portable ( PoE / a power bank capable of > 2A output ).
  • SSH needs to be enabled on the Raspberry Pi for a static IP to be set using startstream.py.

Steps:

  1. Follow this guide to install and set up UV4L on the Raspberry Pi. ( HTTPS is mandatory if you want WebRTC to work, which is needed for two-way audio/video. You can however stream video from the Raspberry Pi over HTTP with no problems ).

  2. Edit the UV4L config at /etc/uv4l/uv4l-raspicam.conf to configure the driver, core module and server paramaters. (This config is run by UV4L at start-up. Therefore the HTTPS certificates and private keys etc must be set here if you want the UV4L server to start-up automatically the way you want it configured).

  3. Edit /etc/modprobe.d/alsa-base.conf to change the priority of the USB audio to be a higher priority than the onboard audio card.

options snd-usb-audio index=0
options snd_bcm2835 index=1
  1. Add the following line to /etc/rc.local to launch UDPmulticaster.py on Raspberry Pi startup.
python /yourpath/UDPmulticaster.py &

Replace yourpath with the path to the script.

This will just make it easier to stream to the Raspberry Pi as you won't have to know the IP of the Raspberry Pi beforehand, you can alternatively just set a static IP if you have router access. 5. Reboot and your Pi should be accessible by using the startstream.py script.

```shell

python startstream.py

Simply follow the on-screen menu to start the stream or set a static IP.

About

Remote video and audio for Raspberry Pi over LAN without knowing the internal IP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages