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 Camera Webcam Quickcam V118 New Open Box
Logitech QuickCam Pro 9000 Camera Webcam Quickcam V118 New Open Box $25.00
End Date: Monday Nov-18-2019 9:10:58 PST
Buy It Now for only: $25.00
Logitech QuickCam Pro 9000 Web Cam great condition fast FREE shipping
Logitech QuickCam Pro 9000 Web Cam great condition fast FREE shipping $5.00 (1 Bid)
End Date: Saturday Oct-19-2019 22:38:00 PDT
Logitech Quickcam Pro 9000
Logitech Quickcam Pro 9000 $13.00
End Date: Tuesday Nov-5-2019 17:45:20 PST
Buy It Now for only: $13.00
Logitech QuickCam Pro 9000 Web Cam 2MP Autofocus
Logitech QuickCam Pro 9000 Web Cam 2MP Autofocus $14.99
End Date: Friday Nov-15-2019 16:54:18 PST
Buy It Now for only: $14.99
Logitech QuickCam Pro 9000 Carl Zeiss Tessar 20 37 Web Cam
Logitech QuickCam Pro 9000 Carl Zeiss Tessar 20 37 Web Cam $5.49
End Date: Saturday Nov-16-2019 9:04:08 PST
Buy It Now for only: $5.49
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $19.00
End Date: Saturday Nov-2-2019 11:32:33 PDT
Buy It Now for only: $19.00
Logitech QuickCam Pro 9000 Web Cam Model 860 000210 Video Camera
Logitech QuickCam Pro 9000 Web Cam Model 860 000210 Video Camera $15.99
End Date: Monday Oct-28-2019 13:05:25 PDT
Buy It Now for only: $15.99
Logitech QuickCam Pro 9000 Web Cam For Business Windows
Logitech QuickCam Pro 9000 Web Cam For Business Windows $20.77
End Date: Saturday Nov-2-2019 10:53:51 PDT
Buy It Now for only: $20.77
Logitech QuickCam Pro 9000 WebCam w OEM Cam Software Users Guide CD
Logitech QuickCam Pro 9000 WebCam w OEM Cam Software  Users Guide CD $13.99
End Date: Saturday Nov-2-2019 11:32:10 PDT
Buy It Now for only: $13.99
Logitech QuickCam Pro 9000 Camera Webcam 20 Megapixel With Autofocus
Logitech QuickCam Pro 9000 Camera Webcam 20 Megapixel With Autofocus $29.95
End Date: Wednesday Oct-30-2019 10:48:07 PDT
Buy It Now for only: $29.95

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