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 Carl Zeiss Optics Autofocus HD 1600x1200 2007
Logitech QuickCam Pro 9000 Web Cam Carl Zeiss Optics Autofocus HD 1600x1200 2007 $19.99
End Date: Sunday Jun-25-2017 11:45:16 PDT
Logitech QuickCam Pro 9000 V UBM46 Carl Zeiss 2MP Webcam w Microphone
Logitech QuickCam Pro 9000 V UBM46 Carl Zeiss 2MP Webcam w Microphone $9.99
End Date: Tuesday Jun-27-2017 15:14:33 PDT
Buy It Now for only: $9.99
Lot of 5 Logitech Pro 9000 Webcams
Lot of 5 Logitech Pro 9000 Webcams $49.99
End Date: Wednesday Jul-12-2017 18:00:13 PDT
Buy It Now for only: $49.99
Logitech WebCam Pro 9000 For Business V U0009
Logitech WebCam Pro 9000 For Business V U0009 $12.50
End Date: Sunday Jul-23-2017 16:57:19 PDT
Buy It Now for only: $12.50
Lot of 2 Logitech WebCam Pro 9000 Business V U0009 Good Working Condition
Lot of 2 Logitech WebCam Pro 9000 Business V U0009 Good Working Condition $29.99
End Date: Saturday Jul-1-2017 11:09:52 PDT
Buy It Now for only: $29.99
Logitech Webcam Pro 9000 2MP Carl Zeiss Optics NEW
Logitech Webcam Pro 9000 2MP Carl Zeiss Optics NEW $46.59
End Date: Thursday Jul-13-2017 12:27:02 PDT
Buy It Now for only: $46.59
Logitech QuickCam Pro 9000 Web Cam w Accessories Install Disc and Users Manual
Logitech QuickCam Pro 9000 Web Cam w Accessories Install Disc and Users Manual $19.99
End Date: Thursday Jun-29-2017 21:34:19 PDT
Buy It Now for only: $19.99
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $6.50 (2 Bids)
End Date: Tuesday Jun-27-2017 15:18:09 PDT
Logitech Pro 9000 Webcam V UBM46 Computer Camera USB
Logitech Pro 9000 Webcam V UBM46 Computer Camera USB $14.99
End Date: Sunday Jul-23-2017 17:27:29 PDT
Buy It Now for only: $14.99
Logitech Pro 9000 PC Internet Camera Webcam w Carl Zeiss Lens Optics AutoFocus
Logitech Pro 9000 PC Internet Camera Webcam w Carl Zeiss Lens Optics AutoFocus $58.60
End Date: Tuesday Jul-4-2017 11:06:29 PDT
Buy It Now for only: $58.60

« Previous12345678

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>