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 WEBCAM PRO 9000
LOGITECH WEBCAM PRO 9000 $13.99
End Date: Wednesday Jun-26-2019 19:11:01 PDT
Buy It Now for only: $13.99
Logitech QuickCam Pro 9000 Web Cam 960 000561
Logitech QuickCam Pro 9000 Web Cam 960 000561 $30.00
End Date: Saturday Jul-13-2019 11:41:41 PDT
Buy It Now for only: $30.00
Logitech Webcam Pro 9000 For Business
Logitech Webcam Pro 9000 For Business $22.94
End Date: Monday Jul-8-2019 19:51:40 PDT
Buy It Now for only: $22.94
Logitech QuickCam Pro 9000 Web Cam HD720 Carl Zeiss Optics
Logitech QuickCam Pro 9000 Web Cam HD720 Carl Zeiss Optics $39.99
End Date: Wednesday Jul-17-2019 9:47:50 PDT
Buy It Now for only: $39.99
SEALED Logitech Webcam Pro 9000
SEALED Logitech Webcam Pro 9000 $69.99
End Date: Sunday Jul-14-2019 13:33:56 PDT
Buy It Now for only: $69.99
Logitech QuickCam Pro 9000 Web Cam New Open Box See Description
Logitech QuickCam Pro 9000 Web Cam New Open Box See Description $17.50
End Date: Sunday Jul-7-2019 10:02:37 PDT
Buy It Now for only: $17.50
Logitech QuickCam Pro 9000 Web Cam Carl Zeiss WORKS GREAT Free Shipping
Logitech QuickCam Pro 9000 Web Cam Carl Zeiss WORKS GREAT Free Shipping $10.49
End Date: Wednesday Jul-17-2019 17:43:38 PDT
Buy It Now for only: $10.49
LOGITECH PRO 9000 USB HD WEBCAM CAMERA AUTOFOCUS ZEISS LENS FREE SHIPPING
LOGITECH PRO 9000 USB HD WEBCAM CAMERA AUTOFOCUS ZEISS LENS FREE SHIPPING $25.99
End Date: Saturday Jun-29-2019 10:40:04 PDT
Buy It Now for only: $25.99
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: Tuesday Jul-9-2019 14:45:01 PDT
Buy It Now for only: $80.00
Logitech webcam Pro 9000 8H
Logitech webcam Pro 9000 8H $22.00
End Date: Wednesday Jun-19-2019 12:16:57 PDT
Buy It Now for only: $22.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>