element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Blog Get a working webcam on Arduino Yun - The smart entrance - Internet of Holiday Lights RoadTest
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: matfur92
  • Date Created: 16 Jan 2015 12:07 AM Date Created
  • Views 467 views
  • Likes 1 like
  • Comments 0 comments
  • RoadTest
  • holiday
  • iot_holidaylights
  • smart_entrance
  • christmas
  • iot
  • arduino
Related
Recommended

Get a working webcam on Arduino Yun - The smart entrance - Internet of Holiday Lights RoadTest

matfur92
matfur92
16 Jan 2015

Today we will see how to run, on Arduino Yun, a webcam protocol compatible UVC (virtually every recent webcam supports this protocol).

 

First, install the sftp to read and write files into the Arduino Yun. From SSH do the following commands:

opkg update
opkg install openssh-sftp-server

Now we can access via SFTP with the same username and password that we used for the SSH to our Arduino Yun. For example I used FileZilla.

 

Then proceed with the installation of the driver to handle the webcam.

opkg update
opkg install kmod-video-uvc
opkg install fswebcam

 

Extract the files and place them with sftp in the annex for example in the /www/webcam/ . Position itself in this folder with cd /www/webcam/ and do the following command to install the mjpg-streamer :

opkg install mjpg-streamer_r148-4_ar71xx.ipk

 

Now you can connect the webcam with USB cable. If you have problems with the following commands reboot and try again with the following commands.

 

To view the current snapshot you must do:

mjpg_streamer -i "input_uvc.so -d /dev/video0 -y" -o "output_http.so"

It allow you to use the browser and, for example in my case, from http://192.168.1.10:8080/?action=snapshot you can view a snapshot in real time, if you refresh the page you can get a new snapshot. This method have the best image quality!

 

Another way to save an image is to use fswebcam. If you want to save on the /www/ you must do it:

fswebcam --device /dev/video0 --input 0 --resolution 640x480 --jpeg 95 --save /www/viewcam.jpg --palette MJPEG --no-banner

 

Another way to save images is to use a config file such as .fswebcam.conf with this content:

device /dev/video0
input 0
loop 15
skip 20
background
resolution 640x480
set brightness=60%
set contrast=13%
top-banner
font /usr/share/fonts/arial.ttf
title "ArduinoYunCAM"
timestamp "%d-%m-%Y %H:%M:%S (%Z)"
jpeg 95
save /www/viewcamC.jpg
palette MJPEG

And to use it go in the same directory and run:

fswebcam -c .fswebcam.conf

 

Other information are on:

- WebCam: Time-laps video

- WebCam: Using mjpeg streamer to stream video over HTTP

 

This is all for today...stay tuned to the next post, it will be about leds strips! image

 

 

PS: If anyone have a problem with mjpg-straemer, my configuration file /etc/config/mjpg-streamer is:

config mjpg-streamer core
    option enabled        true
    option device        "/devices/platform/ehci-platform/usb1/1-1/1-1.1/1-1.1:1.0/input/input1"
    option resolution    "640x480"
    option fps        "5"
    option www        "/www/webcam"
    option port        "8080"

Another tips is to do:

/etc/init.d/mjpg-streamer enable
/etc/init.d/mjpg-straemer start

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube