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 Carl Zeiss Lens Internet Camera Webcam USB Used
Logitech QuickCam Pro 9000 Carl Zeiss Lens Internet Camera Webcam USB Used $34.99
End Date: Sunday Aug-2-2020 12:11:04 PDT
Buy It Now for only: $34.99
New Logitech Pro 9000 HD Webcam
New Logitech Pro 9000 HD Webcam $41.00 (11 Bids)
End Date: Tuesday Jul-7-2020 20:07:22 PDT
Logitech QuickCam Pro 9000 Web Cam New Out Of Box
Logitech QuickCam Pro 9000 Web Cam New Out Of Box $21.50 (15 Bids)
End Date: Monday Jul-6-2020 18:07:14 PDT
Logitech Webcam Pro 9000 w Carl Zeiss Optics and AutoFocus New
Logitech Webcam Pro 9000 w Carl Zeiss Optics and AutoFocus New $79.99
End Date: Sunday Aug-2-2020 6:56:03 PDT
Buy It Now for only: $79.99
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $72.50
End Date: Monday Aug-3-2020 20:39:41 PDT
Buy It Now for only: $72.50
Logitech Webcam Pro 9000 w Carl Zeiss Optics 720p HD Video AutoFocus New Sealed
Logitech Webcam Pro 9000 w Carl Zeiss Optics 720p HD Video AutoFocus New Sealed $89.99
End Date: Wednesday Aug-5-2020 18:35:50 PDT
Buy It Now for only: $89.99
Logitech Webcam Pro 9000 w Carl Zeiss Optics and AutoFocus New
Logitech Webcam Pro 9000 w Carl Zeiss Optics and AutoFocus New $79.99
End Date: Sunday Aug-2-2020 15:28:42 PDT
Buy It Now for only: $79.99
Logitech Webcam Pro 9000
Logitech Webcam Pro 9000 $149.99
End Date: Tuesday Jul-28-2020 19:21:38 PDT
Buy It Now for only: $149.99
Logitech QuickCam Pro 9000 Webcam Carl Zeiss Optics 2 Megapixel New In Box
Logitech QuickCam Pro 9000 Webcam Carl Zeiss Optics 2 Megapixel New In Box $129.95
End Date: Monday Jul-27-2020 14:39:40 PDT
Buy It Now for only: $129.95
Logitech Webcam Pro 9000 w Carl Zeiss Optics 720p HD Video AutoFocus New Sealed
Logitech Webcam Pro 9000 w Carl Zeiss Optics 720p HD Video AutoFocus New Sealed $119.95
End Date: Monday Aug-3-2020 11:15:32 PDT
Buy It Now for only: $119.95

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