But a day and lots of debugging later I ended up going with a Python program after all. Here is a Twitter thread detailing all the problems I encountered, and that was after I figured out how to get the camera's ribbon cable installed the right way.
Debugging raspistill #RaspberryPi #timelapse, process keeps skipping a frame and naming last frame out of sequence, then quitting process so I can't get long timelapse captures (1/n) pic.twitter.com/LVgD5aduhj— Erik Nauman (@openblackboard) March 22, 2019
So I ended up working from tips off the picamera Python module documentation to make a program that takes any number of pictures you want at whatever interval:
link to code
EDIT: To use the program, you can first find out the different required and optional flags by typing "python timelapse.py" in the location where it resides:
Type "python timelapse.py -h" for a more verbose explanation:
So, at a minimum you have to run it with an interval and number of frames ("python timelapse.py -i 5 -n 20" for a minute of captures every 5 seconds), but as you can see you have control over whether the image is flipped horizontally and vertically, ISO setting, and whether to overlay a timestamp. I fortunately came across argparse which made providing such options with the script so easy.
I used scp to copy the pictures over to my computer:
scp pi@192.168.10.110:~/Desktop/images/* ~/images/
Then I used ffmpeg to stitch together the images into a video, detailed in this previous post:
ffmpeg -framerate 5 -i ~/images/image%04d.jpg -pix_fmt yuv420p video.mp4
The final result, some taken with raspistill and the last with the Python script:
No comments :
Post a Comment