CLI
If you are using Windows, you must install a terminal emulator, PuTTY.
- Download and install it by default settings
- Run the program
- Then give the IP address of Arduino
- A command prompt will appear
- Give value root for login as
- If you don't change the password then give default password - aarduino
SD Card
- Format the SD card as FAT32 file system
- Plug in with Arduino
- For creating mount point
- mkdir -p /mnt/sda
- mount /dev/sda /mnt/sda
- For accessing the SD card
- cd /mnt/sda
- To see all file in SD card
- ls -all
If the file system of SD card would become read only:
mount -o remount,rw /mnt/sda
USB Webcam
Configure Webcam
Check if USB camera is detected:
dmesg | tail -n3
Run following command after opening CLI. At first you need to update opkg.
opkg updateInstall kmod-video-uvc
opkg install kmod-video-uvc
Sometimes kmod-video-uvc does not install for it's dependencies. Then you need to run following command to full fill it's dependencies before installing it.
opkg install usbutils
opkg install kmod-usb-core kmod-usb2 kmod-video-core
opkg install kmod-video-uvc
Run following command to complete the process
opkg install python-openssl
opkg install fswebcam
opkg install mjpg-streamer
Test Webcam
Verify if your USB webcam is detected as video device:
ls /dev/video*
To capture a picture and stored it to SD card memory:
cd /mnt/sdaImage will flicker sometime due to camera resolution. You have to specify resolution by -r:
fswebcam test.png
fswebcam test.png -r 280x175You can skip frame by -s:
fswebcam test.png -r 280x175 -S 2
Start Video Streaming
Check if mjpg-streamer is running on 8080
netstat -an | grep 8080
ps | grep mjpg_streamer
If it is not running yet, you can run it manually by a simple command
mjpg_streamer -i "input_uvc.so" -o "output_http.so"
Sometimes this will show error for mismatching with camera resolution. For that situation you need to specify the resolution.
mjpg_streamer -i "input_uvc.so -y -n -f 30 -r 280x175" -o "output_http.so -p 8080 -n -w /www/webcam"
After that you will see the output in following URL.
http://192.168.xxx.xxx:8080/?action=snapshot
http://192.168.xxx.xxx:8080/?action=stream
http://192.168.xxx.xxx:8080/stream.html
Use following command to enable auto start of the service.
/etc/init.d/mjpg-streamer enableUse following command to manually stop the service.
killall mjpg_streamerUse ps command to verify if the process has been run:
ps | grep mjpg
Note 1: 192.168.xxx.xxx is an IP address of Arduino Yun.
Note 2: Video will flicker sometimes due to camera resolution. You need to specify it by camera resolution.
Video Streaming on Youtube
- Download Wirecast
- Install and open Wirecast
- Click "+" on any layer (bottom of the window)
- Click on Web Display...
- Fillup field
- Address: http://192.168.xxx.xxx:8080/?action=stream
- Width: your_desired_width
- Height: your_desired_height
- Select any shot of any layer by clicking it
- Then press "->" button to stream it
- Menu bar => Output => Output Settings [shortcut key: ctrl + y]
- Select YouTube from Destination dropdown
- Authenticate yourself
- Start broadcasting by pressing Stream button (top of the window)
Recording Video from Streaming URL
At first you need ffmpeg library:
opkg update
opkg install ffmpeg
Then run following command to record video for 5 seconds:
ffmpeg -f mjpeg -r 5 -i "http://192.168.xxx.xxx:8080/?action=stream" -t 5 video.aviYou can also capture image via ffmpeg:
ffmpeg -f video4linux2 -i "http://192.168.xxx.xxx:8080/?action=stream" -vframes 1 test_ffmpeg.jpegorffmpeg -f video4linux2 -i /dev/video0 -vframes 1 test_ffmpeg.jpeg
Note: Make confirm that server is running before capture image or record video.