Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

take a X pictures with Y seconds between every image #26

Open
ladiko opened this issue Mar 18, 2016 · 1 comment
Open

take a X pictures with Y seconds between every image #26

ladiko opened this issue Mar 18, 2016 · 1 comment

Comments

@ladiko
Copy link

ladiko commented Mar 18, 2016

I would like fswebcam to have a 2 seconds initialization delay, then take 6 images with different names and a delay of 0.5 seconds between each image and then quit. From reading the man page, i think i can only start an infinite loop and each image gets overwriten by the next one.

Right now i am using http://linux.die.net/man/1/streamer with streamer -c /dev/video0 -q -s 1920x1080 -t 10 -r 2 -j 100 -o ~/00.ppm to create 00.ppm to 09.ppm, delete the first 4 (too dark or broken) and convert the last 6 to JPG. If i use streamer to directly create JPGs, there are strange artefacts in red colored image parts, which doesnt happen when using PPM. Maybe its related to MJPG vs. YUYV !? So streamer doesnt support an initial delay nor produce usable JPGs.

@roygbyte
Copy link

roygbyte commented May 2, 2021

If you have the option to run this as a bash script, you could do this:

#!/bin/bash

INDEX=0
COUNT=3
DELAY=1
RES='1024x786'

while [[ $INDEX < $COUNT ]]; do	
	IMAGE="$INDEX".jpg
  	fswebcam -r $RES $IMAGE
	echo "Image saved to $IMAGE"
  	sleep $DELAY
  	INDEX=$(($INDEX + 1))
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants