Skip to content

Streams real-time video from a Raspberry Pi to a Google Cardboard VR Display (Android)

Notifications You must be signed in to change notification settings

nichhk/cardboardstream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cardboardstream

Streams real-time video from a Raspberry Pi to a Google Cardboard VR Display (Android)

Parts list

When I built this (January 2016), it cost about $150 in total, not including the phone.

Raspberry Pi Setup

  1. Installing packages
  2. uv4l to stream video from the RPi Camera $ sudo apt-get update $ sudo apt-get install uv4l uv4l-raspicam uv4l-server uv4l-webrtc
  3. Pip and Flask for the web server $ sudo apt-get install python-pip $ sudo pip install flask
  4. packages to enable i2c $ sudo apt-get install python-smbus $ sudo apt-get install i2c-tools
  5. Follow these instructions to set up the servos and pan-tilt kit.
  6. Attach the tilt servo to channel 0 and the pan servo to channel 3 (the channel choices can be configured in server.py.

Run Instructions

  1. Clone this repo on your RPi and a computer that can run Android Studio.
$ git clone https://github.com/nichhk/cardboardstream.git
  1. Begin streaming the video on the RPi.
$ uv4l --driver raspicam --auto-video_nr --server-option '--port=5000' --encoding mjpeg --server-option '--enable-webrtc' --width 256 --height 288 --framerate 24 --vflip --hflip

This command will open up an MJPEG stream of the video on port 5000. You can specify the width, height, and framerate for the stream. I flipped the stream vertically and horizontally because of how my camera is attached to the pan-tilt module.

  1. Run the webserver on the RPi.
$ cd /path/to/server
$ sudo python server.py
  1. Run the app on your Android device.
  2. Enter the RPi's IP address. You can find it using ifconfig.
  3. The RPi and Android device must be on the same local network.
  4. Enjoy!

About

Streams real-time video from a Raspberry Pi to a Google Cardboard VR Display (Android)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published