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 Camera Webcam Carl Zeiss Optics
Logitech QuickCam Pro 9000 Camera Webcam Carl Zeiss Optics $37.97
End Date: Thursday May-23-2019 20:07:36 PDT
Buy It Now for only: $37.97
Logitech QuickCam Pro 9000 Web Cam 960 000561
Logitech QuickCam Pro 9000 Web Cam 960 000561 $30.00
End Date: Tuesday May-14-2019 11:41:41 PDT
Buy It Now for only: $30.00
Logitech QuickCam Pro 9000 Web Cam New Open Box See Description
Logitech QuickCam Pro 9000 Web Cam New Open Box See Description $17.50
End Date: Wednesday May-8-2019 10:02:37 PDT
Buy It Now for only: $17.50
LOGITECH WEBCAM PRO 9000 CARL ZEISS 2MP AUTOFOCUS TESSAR 20 37 NEW IN BOX
LOGITECH WEBCAM PRO 9000 CARL ZEISS 2MP AUTOFOCUS TESSAR 20 37 NEW IN BOX $50.00
End Date: Thursday May-23-2019 17:07:33 PDT
Buy It Now for only: $50.00
Logitech QuickCam Pro 9000 Webcam
Logitech QuickCam Pro 9000 Webcam $11.99
End Date: Monday May-20-2019 10:54:23 PDT
Buy It Now for only: $11.99
Logitech QuickCam Pro 9000 Web Cam HD720 Carl Zeiss Optics
Logitech QuickCam Pro 9000 Web Cam HD720 Carl Zeiss Optics $39.99
End Date: Saturday May-18-2019 9:47:50 PDT
Buy It Now for only: $39.99
Logitech Pro 9000 Webcam 2MP HD PC Notebook Desktop
Logitech Pro 9000 Webcam 2MP HD PC Notebook  Desktop $19.99
End Date: Thursday May-23-2019 14:20:04 PDT
Buy It Now for only: $19.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 $10.00
End Date: Tuesday May-21-2019 8:52:14 PDT
Buy It Now for only: $10.00
Logitech QuickCam Pro 9000 USB Webcam w Microphone V UBM46
Logitech QuickCam Pro 9000 USB Webcam w Microphone V UBM46 $12.99
End Date: Tuesday May-21-2019 15:23:09 PDT
Buy It Now for only: $12.99
Logitech webcam Pro 9000 8H
Logitech webcam Pro 9000 8H $22.00
End Date: Monday May-20-2019 12:16:57 PDT
Buy It Now for only: $22.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>