Warning: Undefined array key "ssba_bar_buttons" in /data/f/0/f0e71dcf-4f5a-4882-8c33-9944a28d7ed9/matusbankovic.com/web/wp-content/plugins/simple-share-buttons-adder/php/class-buttons.php on line 602
My Raspberry pi camera module script
Scenario:
Raspberry pi B
Camera Module
Wifi Dongle
Goal:
Stream the video from raspberry pi Camera module nonstop in local network even after a reboot of the raspberry pi.
- Camera module setup
- Wifi dongle setup
- Official V4L2 driver setup
- Installed VLC
-
sudo apt-get install vlc
-
- 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=0.0.0.0:50000}’
- sudo chmod +x myscript.sh
- Installed screen – creates a hidden terminal session
- sudo apt-get install screen
- Adding the script to crontab so by booting / rebooting the script is lunched
- crontab -e
- @reboot /usr/bin/screen -S test -d -m /bin/bash /scripts/myscript.sh &
- Access the stream via VLC by using the IP address of the raspberry pi for example: http://192.168.1.101:50000
- Enjoy the stream