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 Pro 9000 Internet Webcam Carl Zeiss Lens New In Box US Seller
Logitech Pro 9000 Internet Webcam Carl Zeiss Lens New In Box US Seller $29.00
End Date: Wednesday May-17-2017 10:21:40 PDT
Buy It Now for only: $29.00
Logitech QuickCam Pro 9000 2MP WebCam Carl Zeiss Optics with Autofocus V UBM46
Logitech QuickCam Pro 9000 2MP WebCam Carl Zeiss Optics with Autofocus V UBM46 $12.88
End Date: Friday Apr-28-2017 20:19:31 PDT
Buy It Now for only: $12.88
Logitech QuickCam Pro 9000 2MP WebCam Carl Zeiss Optics used LQQK
Logitech QuickCam Pro 9000 2MP WebCam Carl Zeiss Optics used LQQK $15.00
End Date: Wednesday May-24-2017 19:08:39 PDT
Buy It Now for only: $15.00
Logitech 2MP QuickCam Pro 9000 V U0009 Carl Zeiss Optics with Autofocus USB
Logitech 2MP QuickCam Pro 9000 V U0009 Carl Zeiss Optics with Autofocus USB $12.50
End Date: Tuesday May-9-2017 20:43:01 PDT
Buy It Now for only: $12.50
logitech webcam pro 9000
logitech webcam pro 9000 $6.99
End Date: Wednesday Apr-26-2017 15:29:35 PDT
Logitech 720p 2MP QuickCam Pro 9000 V UBM46 Carl Zeiss Optics with Autofocus USB
Logitech 720p 2MP QuickCam Pro 9000 V UBM46 Carl Zeiss Optics with Autofocus USB $29.99
End Date: Wednesday May-24-2017 15:53:50 PDT
Buy It Now for only: $29.99
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $15.00
End Date: Tuesday May-2-2017 16:10:57 PDT
Buy It Now for only: $15.00
Logitech Webcam Pro 9000
Logitech Webcam Pro 9000 $10.00
End Date: Saturday Apr-29-2017 2:28:56 PDT
Buy It Now for only: $15.00
Logitech QuickCam Pro 9000 2MP WebCam Carl Zeiss Optics with Autofocus
Logitech QuickCam Pro 9000 2MP WebCam Carl Zeiss Optics with Autofocus $16.00
End Date: Saturday May-20-2017 19:05:49 PDT
Buy It Now for only: $16.00
Logitech V U0009 WebCam Pro 9000 TESTED WORKING
Logitech V U0009 WebCam Pro 9000 TESTED WORKING $11.99
End Date: Monday May-1-2017 12:18:13 PDT
Buy It Now for only: $11.99

« 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>