raspberry pi camera module script

My Raspberry pi camera module script


Raspberry pi B
Camera Module
Wifi Dongle


Stream the video from raspberry pi Camera module nonstop in local network even after a reboot of the raspberry pi.

  1. Camera module setup
  2. Wifi dongle setup
  3. Official V4L2 driver setup
  4. Installed VLC
    • sudo apt-get install vlc

  5. Created script to lunch streaming combined V4L2 + cvlc
    • sudo nano myscript.sh
    • #!/bin/bashsudo modprobe bcm2835-v4l2cvlc v4l2:///dev/video0 –v4l2-width 1920 –v4l2-height 1080 –v4l2-chroma h264 –sout ‘#standard{access=http,mux=ts,dst=}’
    • sudo chmod +x myscript.sh
  6. Installed screen – creates a hidden terminal session
    • sudo apt-get install screen
  7. Adding the script to crontab so by booting / rebooting the script is lunched
    1. crontab -e
    2. @reboot /usr/bin/screen -S test -d -m /bin/bash /scripts/myscript.sh &
  8. Access the stream via VLC by using the IP address of the raspberry pi for example:
  9. Enjoy the stream

Category: Raspberry pi

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.