Capture and FTP upload a webcam image

To install web cam capture software on the Raspberry Pi

sudo apt-get install fswebcam

To test

fswebcam -d /dev/video0 -r 720x480 webcam.jpeg

Python Code to take picture and upload to web

#!/usr/bin/env python

import os
import ftplib

os.system("fswebcam -d /dev/video0 -r 384x288 /var/www/webcam.jpeg")

print ("Starting FTP")
session = ftplib.FTP('ftp.com','ftp@ftp.com','asdfasdfasdfasdf')
file = open('/var/www/webcam.jpeg','rb') # file to send
session.storbinary('STOR webcam.jpeg', file) # send the file
file.close() # close file and FTP
session.quit()
print ("Finished FTP")
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $2.00
End Date: Saturday Feb-24-2018 20:54:06 PST
Buy It Now for only: $15.00
Logitech QuickCam Pro 9000 V UBM46 USB Webcam Camera Carl Zeiss 2MP Autofocus
Logitech QuickCam Pro 9000 V UBM46 USB Webcam Camera Carl Zeiss 2MP Autofocus $11.95
End Date: Saturday Mar-17-2018 20:32:46 PDT
Buy It Now for only: $11.95
Logitech QuickCam Pro 9000 V UBM46 USB Webcam Camera Carl Zeiss 2MP Autofocus
Logitech QuickCam Pro 9000 V UBM46 USB Webcam Camera Carl Zeiss 2MP Autofocus $11.94
End Date: Monday Mar-19-2018 23:17:46 PDT
Buy It Now for only: $11.94
Logitech QuickCam Pro 9000 20 M High Quality WebCam with Multi Features
Logitech QuickCam Pro 9000 20 M High Quality WebCam with Multi Features $29.99
End Date: Tuesday Mar-20-2018 16:19:17 PDT
Buy It Now for only: $29.99
New Logitech QuickCam Pro 9000 Web Cam 960 000048
New Logitech QuickCam Pro 9000 Web Cam 960 000048 $40.00
End Date: Sunday Mar-18-2018 10:12:11 PDT
Buy It Now for only: $40.00
Logitech Webcam Pro 9000 for Razor Sharp HD Video with Autofocus
Logitech Webcam Pro 9000 for Razor Sharp HD Video with Autofocus $80.00
End Date: Friday Mar-16-2018 14:45:01 PDT
Buy It Now for only: $80.00
Logitech Webcam Pro 9000 HD 720 Video Autofocus Carl Zeiss Optics Microphone
Logitech Webcam Pro 9000 HD 720 Video Autofocus Carl Zeiss Optics Microphone $35.99
End Date: Tuesday Feb-20-2018 17:56:52 PST
Buy It Now for only: $35.99
Logitech Pro 9000 PC Internet Camera Webcam with 20 Megapixel Video Resolution
Logitech Pro 9000 PC Internet Camera Webcam with 20 Megapixel Video Resolution $124.29
End Date: Thursday Mar-8-2018 3:57:48 PST
Buy It Now for only: $124.29
Logitech Pro 9000 Webcam with 2 Megapixel Optical Resolution and Built in Noise
Logitech Pro 9000 Webcam with 2 Megapixel Optical Resolution and Built in Noise $118.24
End Date: Thursday Mar-8-2018 4:05:53 PST
Buy It Now for only: $118.24
Logitech QuickCam Pro 9000 2MP WebCam Carl Zeiss Optics
Logitech QuickCam Pro 9000 2MP WebCam Carl Zeiss Optics $22.00
End Date: Saturday Mar-17-2018 2:02:03 PDT
Buy It Now for only: $22.00

« Previous12345...89

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>