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 works Great
Logitech QuickCam Pro 9000 Web Cam works Great $49.99
End Date: Sunday Apr-26-2020 1:53:57 PDT
Buy It Now for only: $49.99
Logitech Webcam Pro 9000 20 Megapixel PN 860 000210 V U0009 built in Microphone
Logitech Webcam Pro 9000 20 Megapixel PN 860 000210 V U0009 built in Microphone $50.00
End Date: Friday Apr-10-2020 17:30:49 PDT
Logitech Pro 9000 PC Internet Camera Webcam with 20 Megapixel Video Resolution
Logitech Pro 9000 PC Internet Camera Webcam with 20 Megapixel Video Resolution $16.05 (2 Bids)
End Date: Tuesday Apr-7-2020 23:25:49 PDT
Logitech QuickCam Pro 9000 AUTOFOCUS Web Cam I Compare to C930c
Logitech QuickCam Pro 9000 AUTOFOCUS Web Cam I Compare to C930c $26.00 (16 Bids)
End Date: Wednesday Apr-8-2020 9:50:20 PDT
Logitech QuickCam Pro 9000 Web Cam in good condition
Logitech QuickCam Pro 9000 Web Cam in good condition $16.50 (12 Bids)
End Date: Wednesday Apr-8-2020 18:36:02 PDT
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $43.00 (12 Bids)
End Date: Monday Apr-6-2020 5:43:06 PDT
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $19.99 (1 Bid)
End Date: Tuesday Apr-7-2020 8:06:39 PDT
Logitech Pro 9000 PC Internet Camera Webcam w 20 Megapixel Video Resolution
Logitech Pro 9000 PC Internet Camera Webcam w 20 Megapixel Video Resolution $128.00
End Date: Monday May-4-2020 19:44:31 PDT
Buy It Now for only: $128.00
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $42.00 (9 Bids)
End Date: Tuesday Apr-7-2020 12:08:32 PDT
Logitech Quickcam Pro 9000 HD Webcam Retail Package
Logitech Quickcam Pro 9000 HD Webcam Retail Package $51.00 (6 Bids)
End Date: Wednesday Apr-8-2020 12:00:56 PDT

« Previous1234

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>