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
Logitech QuickCam Pro 9000 Web Cam $9.99
End Date: Saturday Nov-18-2017 10:16:33 PST
Buy It Now for only: $9.99
Logitech WebCam Pro 9000 For Business V U0009
Logitech WebCam Pro 9000 For Business V U0009 $12.15
End Date: Tuesday Oct-31-2017 15:36:19 PDT
Buy It Now for only: $12.15
Logitech QuickCam Pro 9000 Carl Zeiss 2MP Auto Focus Webcam Microphone V UBM46
Logitech QuickCam Pro 9000 Carl Zeiss 2MP Auto Focus Webcam Microphone V UBM46 $14.98
End Date: Tuesday Nov-14-2017 4:41:12 PST
Buy It Now for only: $14.98
Logitech QuickCam Pro 9000 Carl Zeiss 2MP Auto Focus Webcam Microphone V UBM46
Logitech QuickCam Pro 9000 Carl Zeiss 2MP Auto Focus Webcam Microphone V UBM46 $12.00
End Date: Saturday Oct-21-2017 16:35:58 PDT
Buy It Now for only: $20.00
Logitech Pro 9000 PC Internet Camera Webcam
Logitech Pro 9000 PC Internet Camera Webcam $1.00 (2 Bids)
End Date: Wednesday Oct-25-2017 11:00:00 PDT
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $39.99
End Date: Tuesday Nov-14-2017 16:03:16 PST
Buy It Now for only: $39.99
Logitech QuickCam Pro 9000 Web Cam Carl Zeiss with Auto Focus HD
Logitech QuickCam Pro 9000 Web Cam Carl Zeiss with Auto Focus HD $50.39
End Date: Sunday Nov-12-2017 6:27:28 PST
Buy It Now for only: $50.39
LOGITECH QUICKCAM PRO 9000 2MP Web Cam Carl Zeiss Optics with Autofocus V UBM46
LOGITECH QUICKCAM PRO 9000 2MP Web Cam Carl Zeiss Optics with Autofocus V UBM46 $5.99
End Date: Wednesday Oct-25-2017 6:04:04 PDT
NEW Logitech Webcam Pro 9000 Web Cam 720p HD 2MP Sensor Autofocus Carl Zeiss
NEW Logitech Webcam Pro 9000 Web Cam 720p HD 2MP Sensor Autofocus Carl Zeiss $94.99
End Date: Saturday Nov-18-2017 15:13:49 PST
Buy It Now for only: $94.99
Logitech QuickCam Pro 9000 Web Cam Auto Focus CARL ZEISS Optics Lens NEW
Logitech QuickCam Pro 9000 Web Cam Auto Focus CARL ZEISS Optics Lens NEW $29.00
End Date: Saturday Oct-21-2017 19:13:03 PDT
Buy It Now for only: $29.00

« Previous12345...89

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>