Raspberry Pi 3 USB microscope timelapse tutorial

Опубликовано: 17 Июнь 2026
на канале: plukas
10,523
74

0:00 Installation of fswebcam
0:16 USB camera plug
0:26 Capture test of sample photos
0:52 Bash .sh script prepration
1:27 Access rights settings
1:49 Crontab configuration
2:07 Renaming of captured photos
2:35 Creating video from captured photos
2:47 Sample time-lapse video

Where to buy:
https://s.click.aliexpress.com/e/_Ejj...

Here you can find short tutorial how to setup USB camera/microscope to capture sequnce of photos which can be used to create time-lapse video.

Step 1: Prepare fswebcam
sudo apt-get install fswebcam

Test it by:
fswebcam image.jpg

Set resolution and remove bottom banner:
fswebcam -r 1280x720 --no-banner image3.jpg

Step 2: Prepare bash script
#!/bin/bash

DATE=$(date +"%Y-%m-%d_%H%M")

fswebcam -r 640x480 --no-banner /home/pi/webcam/$DATE.jpg

I have only camera with low resolution but you can setup your own resolution

Run the script and check the output:

./webcam.sh

Step 3: Setup cron
Setup cron:
crontab -e

* * * * /home/pi/webcam.sh 2﹥&1
(YouTube does not allow angle brackets in description so you need to correct this line)

See crontab help here: https://crontab.guru/

Step 4: Rename files
Rename photo sequence:

ls *.jpg | awk 'BEGIN { a=0 }{printf "mv %s myfile%04d.jpg\n", $0, a++}' | bash

Step 5: Make video file from photos
Create video from photo sequnce:

vconv -r 10 -i /home/pi/webcam/myfile%4d.jpg -r 10 -vcodec libx264 -vf scale=640:480 /home/pi/timelapse.mp4

Useful guide: https://www.raspberrypi.org/documenta...
Thanks for watching and if you like the video please click to "Like".

==========
#plukas #raspberrypi #raspberrypicamera