Timelapse pictures & videos with Duet and webcam on layer change
-
@Hugo-Hiasl This mainly depends on the software you use to provide the stream. Some of these will allow you to have a continuous video stream that will just be paused for a second to take a snapshot image. I think both
mjpg-streamer
anduStreamer
support this. But I have never tried it. -
@wilriker Keepalive post.
In answer to your question, yes
mjpeg-streamer
can be used this way and it is how theoctolapse
plugin works inoctoprint
. I have a Vivedino Troodon (Voron-clone) and it's clone Duet2 Wifi card is so good it has the same issues with Octoprint that the OEM board suffers. -
@wilriker
I cant speak forustreamer
butmjpeg-streamer
provides a http stream onhttp://<ip:port>/?action=stream
and can accept multiple connections. I regularly have it streaming on my desktop and media-pc simultaneously without issues or any noticeable load on the Pi.OctoPrint's inbuilt timelapse system, (or octolapse , if you love needless complexity) requests snapshots via
http://<ip:port>/?action=snapshot
, there is no detectable pause on the streams when this is invoked.Conventionally: To get a timelapse you use a script to capture frames at set intervals/events, timestamp them if desired and save them. Once the capture is complete you stitch them together using ffmpeg.
However.. when I want a timelapse on my CNC I start a screen session (nohup shell) on it's attendant Pi and run this:
pi@laserweb:~ $ ffmpeg -r 600 -i http://localhost:8080/?action=stream -vf "drawtext=fontcolor=white:fontsize=16:box=1:boxcolor=black@0.3:x=(w-text_w-10):y=(h-text_h-5):expansion=strftime::text='CNC \:\ %H\:%M\:%S'" -r 20 lapse.`date +%Y%m%d%H%M%S`.avi
Which tricks
ffmpeg
into thinking that my 30fps stream is really a 600fps stream, and the asks it to timestamp that and convert to a 20fps framerate.
The end result is a 20x speedup video with timestamp, but the quality is noticeably lower than the capture/assemble method. And the Pi3 is devoting 32->40% of it's CPU to ffmpeg while it is running. Not recommended as a permanent solution, it's a classic quick'n'dirty one liner.