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 Black Webcam
Logitech QuickCam Pro 9000 Web Cam Black Webcam $4.95
End Date: Sunday Aug-26-2018 14:45:41 PDT
New Logitech QuickCam Pro 9000 Web Cam 960 000048
New Logitech QuickCam Pro 9000 Web Cam 960 000048 $29.95
End Date: Thursday Sep-20-2018 5:33:23 PDT
Buy It Now for only: $29.95
Logitech QuickCam Pro 9000 Carl Zeiss Tessar 20 37 Web Cam For Business
Logitech QuickCam Pro 9000 Carl Zeiss Tessar 20 37 Web Cam For Business $14.00
End Date: Sunday Aug-26-2018 14:05:26 PDT
Buy It Now for only: $14.00
Logitech QuickCam Pro 9000 Web Cam With Software CD
Logitech QuickCam Pro 9000 Web Cam With Software CD $9.97
End Date: Tuesday Sep-18-2018 12:46:32 PDT
Buy It Now for only: $9.97
Logitech QuickCam Pro 9000 Web Cam Camera 2MP Autofocus Carl Zeiss Lens USB
Logitech QuickCam Pro 9000 Web Cam Camera 2MP Autofocus Carl Zeiss Lens USB $11.75
End Date: Sunday Sep-16-2018 10:33:40 PDT
Buy It Now for only: $11.75
Logitech V UBM46 Wired USB Webcam w Carl Zeiss 2MP Autofocus Lens pro 9000
Logitech V UBM46 Wired USB Webcam w Carl Zeiss 2MP Autofocus Lens pro 9000 $11.00
End Date: Saturday Aug-25-2018 15:47:43 PDT
Buy It Now for only: $11.00
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $5.00
End Date: Thursday Aug-23-2018 14:21:51 PDT
Buy It Now for only: $15.00
Logitech Webcam Pro 9000 20MP USB AF 30fps 720p Carl Zeiss CMOS 960 000048 NEW
Logitech Webcam Pro 9000 20MP USB AF 30fps 720p Carl Zeiss CMOS 960 000048 NEW $30.00
End Date: Sunday Aug-26-2018 20:28:58 PDT
Buy It Now for only: $30.00
Logitech 860000109 QUICKCAM PRO9000
Logitech 860000109 QUICKCAM PRO9000 $25.00
End Date: Monday Sep-17-2018 13:31:31 PDT
Buy It Now for only: $25.00
LOGiTECH QUiCK CAM PRO 9000 WEBCAM NEW Carl Zeiss Optics quickcam web cam
LOGiTECH QUiCK CAM PRO 9000 WEBCAM NEW Carl Zeiss Optics quickcam web cam $39.99
End Date: Wednesday Sep-19-2018 14:39:15 PDT
Buy It Now for only: $39.99

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