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 $9.99
End Date: Wednesday Dec-26-2018 10:42:41 PST
Buy It Now for only: $9.99
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $9.99
End Date: Monday Dec-17-2018 20:30:01 PST
NEW Logitech Pro 9000 Webcam w 2 MP Optical Resolution Carl Zeiss Lens Optics
NEW Logitech Pro 9000 Webcam w 2 MP Optical Resolution Carl Zeiss Lens Optics $19.99
End Date: Monday Dec-24-2018 13:49:08 PST
Buy It Now for only: $19.99
Logitech QuickCam Pro 9000 Web Cam New In Box
Logitech QuickCam Pro 9000 Web Cam New In Box $17.00
End Date: Sunday Dec-16-2018 15:13:03 PST
New Logitech Webcam Pro 9000 720p HD Video 2MP HD Sensor Autofocus
New Logitech Webcam Pro 9000 720p HD Video 2MP HD Sensor Autofocus $49.99
End Date: Tuesday Jan-8-2019 14:40:04 PST
Buy It Now for only: $49.99
NEW IN BOX Logitech Pro 9000 Webcam 20MP USB AF 30fps HD 720p Carl Zeiss
 NEW IN BOX  Logitech Pro 9000 Webcam 20MP USB AF 30fps HD 720p Carl Zeiss $74.95
End Date: Wednesday Jan-9-2019 23:36:02 PST
Buy It Now for only: $74.95
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $5.00
End Date: Thursday Dec-13-2018 19:31:29 PST
Buy It Now for only: $7.00
UNTESTED Logitech QuickCam Pro 9000 Webcam V UBM46
UNTESTED Logitech QuickCam Pro 9000 Webcam V UBM46 $10.00
End Date: Monday Dec-24-2018 10:58:26 PST
Buy It Now for only: $10.00
NEW IN BOX SEALED LOGITECH PRO 9000 USB HD WEBCAM CAMERA AUTOFOCUS ZEISS LENS
NEW IN BOX SEALED LOGITECH PRO 9000 USB HD WEBCAM CAMERA AUTOFOCUS ZEISS LENS $39.99
End Date: Tuesday Jan-8-2019 12:31:42 PST
Buy It Now for only: $39.99
NEW Logitech QuickCam Pro 9000 HD Web Cam Carl Zeiss Optics 32
NEW Logitech QuickCam Pro 9000 HD Web Cam Carl Zeiss Optics 32 $35.00
End Date: Wednesday Dec-19-2018 10:38:12 PST
Buy It Now for only: $35.00

« Previous12345...910

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>