As the title may suggest... Started with a bit of scripting, had a Raspberry pi 3b+ lying around and decided to use it for some time-passing productive activity so I just attached it to a Microsoft LifeCam HD-3000 I had unused, fresh raspbian installed on the SD card and SSH enabled through the raspi-config.
In Summary we used:
- Raspberry Pi 3b+
- Raspberry power supply
- Sandisk microSD card 16gb with raspbian installed on it
- usb webcam
So we create the following bash script which I named autoshot.sh I used NANO editor to create this (sudo nano autoshot.sh), script content as follows:
#!/bin/bashecho offDATE=$(date +"%Y-%m-%d")COUNT=1while [ $COUNT -le 120 ]doecho Photo: $COUNTTIME=$(date +"%H%M%S")fswebcam -r 1024x768 -S 10 /home/pi/PROJ/webcam/photos/$DATE-$COUNT-$TIME.jpgsleep 30s((COUNT++))done
And we run as follows and get the following result as well:
pi@raspberrypi:~/PROJ/webcam $ ./autoshot.shoffPhoto: 1--- Opening /dev/video0...Trying source module v4l2.../dev/video0 opened.No input was specified, using the first.Adjusting resolution from 1024x768 to 1280x720.--- Capturing frame...Skipping 10 frames...Capturing 1 frames...Captured 11 frames in 0.33 seconds. (33 fps)--- Processing captured image...Writing JPEG image to '/home/pi/PROJ/webcam/photos/2021-04-05-1-180416.jpg'.Photo: 2--- Opening /dev/video0...Trying source module v4l2.../dev/video0 opened.No input was specified, using the first.Adjusting resolution from 1024x768 to 1280x720.--- Capturing frame...Skipping 10 frames...Capturing 1 frames...Captured 11 frames in 0.33 seconds. (33 fps)--- Processing captured image...Writing JPEG image to '/home/pi/PROJ/webcam/photos/2021-04-05-2-180447.jpg'.
Then we just need to either use the raspbian GUI or setup a samba shared folder on the raspberry to grab the photos from a windows machine, for example.
No hay comentarios:
Publicar un comentario