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 Pro 9000 Web Cam
Logitech Pro 9000 Web Cam $22.99
End Date: Friday May-4-2018 13:26:18 PDT
Buy It Now for only: $22.99
Lots of 2 logitech QuickCam Pro 9000 USB Camera
Lots of 2 logitech QuickCam Pro 9000 USB Camera $20.00
End Date: Friday Apr-27-2018 11:06:59 PDT
Logitech QuickCam Pro 9000 Web Cam w Carl Zeiss Lens Optics
Logitech QuickCam Pro 9000 Web Cam w Carl Zeiss Lens Optics $9.99
End Date: Sunday Apr-29-2018 14:08:02 PDT
Logitech Webcam Pro 9000 Web Cam Carl Zeiss 2MP AutoFocus Tessar 20 37 V U0009
Logitech Webcam Pro 9000 Web Cam Carl Zeiss 2MP AutoFocus Tessar 20 37 V U0009 $19.99
End Date: Wednesday May-23-2018 13:45:24 PDT
Buy It Now for only: $19.99
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $80.00
End Date: Thursday May-24-2018 13:28:40 PDT
Buy It Now for only: $80.00
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $15.00
End Date: Thursday Apr-26-2018 13:23:49 PDT
Buy It Now for only: $60.00
QuickCam Pro 9000 Web Cam Original Packaging Carl Zeiss Lens
QuickCam Pro 9000 Web Cam Original Packaging Carl Zeiss Lens $17.99
End Date: Tuesday May-1-2018 12:05:10 PDT
Buy It Now for only: $24.99
Logitech QuickCam Pro 9000 V U0009 Camera 2MP Autofocus Zeiss Lens
Logitech QuickCam Pro 9000 V U0009 Camera 2MP Autofocus Zeiss Lens $15.88
End Date: Sunday May-20-2018 20:22:52 PDT
Buy It Now for only: $15.88
Logitech QuickCam Pro 9000 V U0009 Carl Zeiss
Logitech QuickCam Pro 9000 V U0009 Carl Zeiss $14.00
End Date: Wednesday May-23-2018 20:43:17 PDT
Buy It Now for only: $14.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: Tuesday May-15-2018 14:45:01 PDT
Buy It Now for only: $80.00

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