Tutorials/arduino-yun-videorecorder-101

Da WeMake Wiki.
Versione del 14 feb 2016 alle 14:42 di Costantino (discussione | contributi)
(diff) ← Versione meno recente | Versione attuale (diff) | Versione più recente → (diff)
Jump to navigation Jump to search

Arduino Yun Basics

This tutorial covers a little introduction to video recording with Arduino Yun and a USB webcam. No Arduino code in this first part, only some linux embedded configuration on the awesome Arduino Yun board!

I assume that the reader has a pc or a mac (named Bob) and an Arduino Yun, named Arduino. Moreover, I suppose the reader is quite familiar with the computer in general and know a little bit of shell/linux commands. In particular I in my case Bob is amac os/x and, and everything is starting with an iTerm2 session where everything begin with a dollar sign ($)..

Before starting

Assure we have:

Install some useful packages for video and webcam:

    ~ opkg update
    ~ opkg install kmod-video-uvc kmod-video-pwc kmod-input-core
    ~ opkg install libjpeg fswebcam mjpg-streamer
    ~ opkg install ffmpeg ffserver
    ~ opkg install python-openssl

for ps3 eye (that is a gspca-ov534 type camera):

    ~ opkg update
    ~ opkg install kmod-input-core
    ~ opkg install kmod-video-gspca-core
    ~ opkg install kmod-video-gspca-ov534

With standard usb uvc cam

To see the stream (from Arduino to Bob):

   ~ mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 640x480" -o "output_http.so -p 8080 -w /mnt/sda1"

Then open "http://arduino.local:8080/?action=stream" in a brower (inside Bob)

To shoot a photo (on Arduino):

   ~ fswebcam test.png

Or

   ~ ffmpeg -f video4linux2 -i /dev/video0 -vframes 1 test.jpeg

and to see the photo via http request from Bob, just start a

   ~ python -m SimpleHTTPServer

in the directory where the photo is saved and access it by browsing (from Bob) to "192.168.1.13/test.png"

References