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 USB Webcam 2 MP HD PC Notebook Desktop Windows 10
Logitech Pro 9000 USB Webcam 2 MP HD PC Notebook Desktop Windows 10 $9.99
End Date: Monday Jan-6-2020 6:59:05 PST
Buy It Now for only: $9.99
Logitech QuickCam Webcam Pro9000 Carl Zeiss Tessar 20 37 2mp Auto Focus
Logitech QuickCam Webcam Pro9000 Carl Zeiss Tessar 20 37 2mp Auto Focus $7.50
End Date: Monday Dec-23-2019 8:00:59 PST
Buy It Now for only: $7.50
Logitech Quickcam Pro 9000 HD Webcam Retail Package
Logitech Quickcam Pro 9000 HD Webcam Retail Package $9.99 (1 Bid)
End Date: Monday Dec-16-2019 5:59:35 PST
LOGITECH V U0009 QUICKCAM PRO 9000 WEBCAM 2MP AUTOFOCUS CARL ZEISS LENS G23
LOGITECH V U0009 QUICKCAM PRO 9000 WEBCAM 2MP AUTOFOCUS CARL ZEISS LENS G23 $10.99
End Date: Saturday Dec-28-2019 8:28:32 PST
Buy It Now for only: $10.99
Logitech Pro 9000 PC Internet Camera Webcam
Logitech Pro 9000 PC Internet Camera Webcam $9.99
End Date: Thursday Dec-19-2019 2:43:23 PST
Buy It Now for only: $49.99
Logitech Webcam Pro 9000
Logitech Webcam Pro 9000 $34.50
End Date: Saturday Jan-11-2020 16:29:07 PST
Buy It Now for only: $34.50
Logitech webcam pro 9000
Logitech webcam pro 9000 $18.00
End Date: Sunday Dec-29-2019 2:58:40 PST
Buy It Now for only: $18.00
Logitech QuickCam Pro 9000 Camera Webcam 20 Megapixel With Autofocus
Logitech QuickCam Pro 9000 Camera Webcam 20 Megapixel With Autofocus $29.95
End Date: Monday Dec-30-2019 9:48:07 PST
Buy It Now for only: $29.95
Logitech Pro 9000 Carl Zeiss Autofocus Microphone USB Web Cam
Logitech Pro 9000 Carl Zeiss Autofocus Microphone USB Web Cam $12.99
End Date: Tuesday Dec-24-2019 13:26:12 PST
Buy It Now for only: $12.99
Logitech Pro 9000 PC Internet Camera Webcam with 20 Megapixel Video Resolution
Logitech Pro 9000 PC Internet Camera Webcam with 20 Megapixel Video Resolution $35.00
End Date: Tuesday Jan-14-2020 15:09:21 PST
Buy It Now for only: $35.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>