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 Webcam Pro 9000 V U0009 Carl Zeiss 2MP AutoFocus Tessar 20 37
Logitech Webcam Pro 9000 V U0009 Carl Zeiss 2MP AutoFocus Tessar 20 37 $8.50
End Date: Sunday Mar-3-2019 10:17:18 PST
Buy It Now for only: $8.50
Logitech Pro 9000 Webcam 2MP HD PC Notebook Desktop
Logitech Pro 9000 Webcam 2MP HD PC Notebook  Desktop $2.00
End Date: Sunday Feb-24-2019 16:26:00 PST
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $1.00
End Date: Saturday Feb-23-2019 14:40:45 PST
Logitech QuickCam Pro 9000 Web Cam
Logitech QuickCam Pro 9000 Web Cam $45.00
End Date: Saturday Mar-23-2019 13:45:07 PDT
Buy It Now for only: $45.00
Logitech Pro 9000 Webcam 2MP HD PC Notebook Desktop
Logitech Pro 9000 Webcam 2MP HD PC Notebook  Desktop $19.99
End Date: Sunday Mar-24-2019 14:20:04 PDT
Buy It Now for only: $19.99
Logitech Pro 9000 Webcam 2MP HD PC Notebook Desktop light scratches
Logitech Pro 9000 Webcam 2MP HD PC Notebook  Desktop light scratches $17.99
End Date: Tuesday Mar-19-2019 11:52:42 PDT
Buy It Now for only: $17.99
Logitech Webcam Pro 9000 2 MP MIB
Logitech Webcam Pro 9000 2 MP MIB $17.99 (1 Bid)
End Date: Saturday Feb-23-2019 8:39:44 PST
LOGITECH WebCam Pro 9000 with Software UsedGood Condition
LOGITECH WebCam Pro 9000 with Software UsedGood Condition $10.00
End Date: Saturday Feb-23-2019 19:00:57 PST
Buy It Now for only: $10.00
LOGITECH WEBCAM PRO 9000 RAZOR SHARP HD VIDEO WITH AUTOFOCUS NEW
LOGITECH WEBCAM PRO 9000 RAZOR SHARP HD VIDEO WITH AUTOFOCUS NEW $19.99
End Date: Thursday Mar-14-2019 22:00:34 PDT
Buy It Now for only: $19.99
Logitech Webcam Pro 9000
Logitech Webcam Pro 9000 $14.95
End Date: Friday Mar-1-2019 10:42:25 PST

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