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 V UBM46 USB Webcam Camera Carl Zeiss 2MP Autofocus
Logitech QuickCam Pro 9000 V UBM46 USB Webcam Camera Carl Zeiss 2MP Autofocus $4.99
End Date: Saturday Dec-16-2017 15:49:30 PST
Buy It Now for only: $15.00
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $18.99
End Date: Monday Jan-8-2018 18:25:09 PST
Buy It Now for only: $18.99
Logitech QuickCam Pro 9000 V UBM46 USB Webcam Camera Carl Zeiss 2MP Autofocus
Logitech QuickCam Pro 9000 V UBM46 USB Webcam Camera Carl Zeiss 2MP Autofocus $9.00
End Date: Sunday Dec-17-2017 15:06:25 PST
Buy It Now for only: $19.50
Logitech Web Cam Pro 9000 New
Logitech Web Cam Pro 9000 New $20.00
End Date: Thursday Dec-14-2017 8:39:03 PST
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $4.47
End Date: Saturday Dec-16-2017 14:11:45 PST
Logitech Pro 9000 PC Internet Camera Webcam with 20 Megapixel Video Resolution
Logitech Pro 9000 PC Internet Camera Webcam with 20 Megapixel Video Resolution $8.00 (4 Bids)
End Date: Thursday Dec-14-2017 16:06:01 PST
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $14.99
End Date: Monday Dec-18-2017 12:50:46 PST
Buy It Now for only: $14.99
LOGITECH WEBCAM PRO 9000 CARL ZEISS 2MP AUTOFOCUS TESSAR 20 37 NEW IN BOX
LOGITECH WEBCAM PRO 9000 CARL ZEISS 2MP AUTOFOCUS TESSAR 20 37 NEW IN BOX $50.00
End Date: Wednesday Jan-10-2018 22:08:11 PST
Buy It Now for only: $50.00
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: Saturday Dec-16-2017 13:45:01 PST
Buy It Now for only: $80.00
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $43.24
End Date: Monday Jan-8-2018 9:10:11 PST
Buy It Now for only: $43.24

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