Octolapse: Feedback for 0.3.3rc3.dev

Created on 5 Aug 2018  Â·  42Comments  Â·  Source: FormerLurker/Octolapse

Any general feedback for 0.3.3rc3.dev should go here, including failure AND success reports. What worked? What didn't? What do you like, or what would you like to see?

Here is a link to the release notes.

If you have Octolapse 0.3.3rc2 or above, you can install this through the 'Software Update' plugin by switching the release channel to 'Devel RCs' and forcing a refresh.

For older versions, here is a link you can use to install via the plugin manager: https://github.com/FormerLurker/Octolapse/archive/v0.3.3rc3.dev.zip

help wanted

All 42 comments

@Shadowen, let me know if you get a chance to try this version, thanks!

Hey! Just installed it, I will retry the DSLR function as it failed earlier. I would take 1 snap then raise the Z (Part of my starting code) then take a 2nd snap and then start the print without taking any more snapshots...

The snapshot folder didn't get created as it was supposed to. I will test in test mode and then live print with logs and post it

Did your webcam work? Also, what kind of camera?

I only enabled my Nikon D40. I can enable my Webcam too and send a test again, I'm all setup. I was trying to do test mode + full logs but somehow the log file dosen't created after I deleted it... :\

Yeah, if you delete the log you have to reboot before it starts up again.
I'm not sure why (and I'd like to know.)

On Mon, Aug 6, 2018, 8:22 PM Xenomorphdelombre notifications@github.com
wrote:

I only enabled my Nikon D40. I can enable my Webcam too and send a test
again, I'm all setup. I was trying to do test mode + full logs but somehow
the log file dosen't created after I deleted it... :\

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/FormerLurker/Octolapse/issues/216#issuecomment-410902216,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Af0UuAC9OwoRSRHnCT9X99S3e3WMQRUeks5uOOvGgaJpZM4VvLyj
.

Yeah I figured... Just rebooted then started one. It takes 1 snap, then the 2nd and then nothing... I waited 2 more layers then stopped it. Here's the log.
plugin_octolapse_2018-08-06.log

HHum and even if I Untick the DSLR and leave only the webcam on, it does the same thing. " snap, then nothing. See here: https://www.youtube.com/watch?v=GXYZU40_ZPo

Can you post your gcode and settings? I can dig in tomorrow.

Hey, I think your issue is being caused by a bug in the priming detection (your printer primes at X=15mm) that I actually fixed a few days ago. Try installing from this commit and try that code again: https://github.com/FormerLurker/Octolapse/archive/ccc3a86533d2486a5de2322702210192375c86c7.zip

Fingers crossed. Looks like I need ANOTHER rc, lol!

@Xenomorphdelombre, please send me your gcode anyway. I was re-watching your video, and it looks like Octolapse may be seeing 2 priming operations. The fix in the previous commit wouldn't fix this if that's the case. I can tell for sure if I see the gcode.

Damn you rock! I found out I had two priming, one in my Gcode form slicer and one in my starting code in octoprint (I did a Copy paste). I removed the prime from Octoprint and it takes all the snapshots now. I had to use the Echo "password" tho, if not, the metadata and jpg files are not generated in /home/pi/.octoprint/data/octolapse/snapshots. Also, the temp folder didn't got created for some reason?
Anyways, Thank you so much! I'll try with an actual print now.

Well I was really confused until I re-watched the video :P

I'm not sure what needs to be done to gphoto2 to allow it to be installed and used without sudo. If you know any linux gurus please point me in their direction. It just seems.. wrong.

Yeah, there is no temp folder anymore. Everything goes in the snapshot folder. Now the structure is as follows:

/home/pi......./octolapse/snapshots/[job guid]/[camera guid]

Each camera profile has its own guid, and every job gets a random guid assigned to it. This makes it easier for me to generate timelapses from multiple cameras. Now if I can make it render on restart like OctoPrint does, or give you the option to clear out old data (if automatic cleaning is not enabled), I'll be set!

Just tried the overlay on a live print and it doesn't render at all :D

I suspect it's passing the wrong images to ffmpeg. I'll have to check later.

Boo. I haven't had a chance to try out the full render yet, but I did have an error on the preview page that I'll look into after work (if I have time today, things are tight). I'm so willing to debug this since it's so cool. I've been slacking at adding extra replacement tokens, but I'll get on that too!

May have been this commit https://github.com/FormerLurker/Octolapse/commit/bb8e8341f1e3044e66dd528d65e2378a48c398ef that broke it. I see you added some code that might skip the preprocessing - maybe the snapshot numbers are messed up? I'll make the loop more robust to missing snapshots.

I'm wondering why you're trying to deal with a case where the snapshot exists, but the metadata doesn't? The metadata is written with the snapshot so there should always be a metadata file..?

Hmm. I thought I added code to skip it if the snapshot doesn't exist, but I'll look too. In my way of thinking metadata should only be added if a snapshot actually exists, but I may have goofed. Snapshot counts are only supposed to increment on success, which seems to be the correct approach. Again, I could have goofed :)

I just update it, and I'm trying the Multicam new feature, I cant make 2 cameras work at the same time.
I have 3 webcams, one logitech c920 and c270, I have tried all combinations. What i am missing?

I'll review the code to see what's going on after work. I am working on some code to postpone the transfer of images from a DSLR until after the print completes. I may have inadvertently included this in that commit you mentioned. If that is the case, I apologise.

@tixenre, did you configure mjpegstreamer to support both of your cameras? If so, can you access both streams manually, eg:

http://[octoprint_ip_address_here]:8080/?action=snapshot
and
http://[octoprint_ip_address_here]:[port_number_of_second_webcam_here]/?action=snapshot

Not sure what your ports or IP addresses are, so I can't fill those in for you, but you probably get the idea.

Edit: I goofed on the second example, but just corrected it.

I didnt configure mjpegstreamer, but I have the multicam plugin. Sorry, Im a hardware guy. mjpegstreamer is a plugin or do i have to do it manually on the pi?

@tixenre, and you can see both cameras via the multicam plugin? I thought you had to configure MJpegstreamer to get that working right. I might need to check that out.

mjpegstreamer is built into OctoPi, and it's what takes care of streaming the camera to a url for viewing, or to take a snapshot. I believe it needs to be done manually.

@Shadowen, I figured it out. This line:

self.add_overlay(image,
                                 text_template=self._rendering.overlay_text_template,
                                 format_vars=format_vars,
                                 font_path=self._rendering.overlay_font_path,
                                 font_size=self._rendering.overlay_font_size,
                                 overlay_location=self._rendering.overlay_text_pos,
                                 overlay_text_alignment=self._rendering.overlay_text_alignment,
                                 overlay_text_valign=self._rendering.overlay_text_valign,
                                 overlay_text_halign=self._rendering.overlay_text_halign,
                                 text_color=self._rendering.overlay_text_color)

should be this:

image = self.add_overlay(image,
                                 text_template=self._rendering.overlay_text_template,
                                 format_vars=format_vars,
                                 font_path=self._rendering.overlay_font_path,
                                 font_size=self._rendering.overlay_font_size,
                                 overlay_location=self._rendering.overlay_text_pos,
                                 overlay_text_alignment=self._rendering.overlay_text_alignment,
                                 overlay_text_valign=self._rendering.overlay_text_valign,
                                 overlay_text_halign=self._rendering.overlay_text_halign,
                                 text_color=self._rendering.overlay_text_color)

since it's returning a new image instance. Not sure how that happened. If I did it, sorry about that! I pushed a fix to devel.

@Shadowen - actually my push failed and I didn't notice. Somehow i must have messed up my earlier pull because there were some changes I didn't have locally. That has been corrected.

I re-tested the resulting code after the odd merge issue and the rendering is looking good! However, I am not getting the latest snapshot in the overlay preview yet. I hope I didn't break something with the mysterious merge issue (definitely user error). I do see that an image is being captured, but it is not being updated. Let me dig in a bit more and make sure it's not me, and that I have not somehow broken your code via a git merge mistake...

@FormerLurker I think I changed the way that overlays were added from
mutate to return a copy. It was part of the preview change. Oops!

On Wed, Aug 8, 2018 at 5:55 PM FormerLurker notifications@github.com
wrote:

@Shadowen https://github.com/Shadowen - actually my push failed and I
didn't notice. Somehow i must have messed up my earlier pull because there
were some changes I didn't have locally. That has been corrected.

I re-tested the resulting code after the odd merge issue and the rendering
is looking good! However, I am not getting the latest snapshot in the
overlay preview yet. I hope I didn't break something with the mysterious
merge issue (definitely user error). I do see that an image is being
captured, but it is not being updated. Let me dig in a bit more and make
sure it's not me, and that I have not somehow broken your code via a git
merge mistake...

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/FormerLurker/Octolapse/issues/216#issuecomment-411565031,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIJ8N5z6xOT-3zk9qBJHDz7QKXnM3ZIEks5uO140gaJpZM4VvLyj
.

LOL! No problem. There is an issue on Windows with the temp directory getting deleted. Apparently an Image object is not immediately read into memory when opened from a file, and when you call rmtree the image is deleted, which throws an exception. I'm working on that right now, but the resulting code will take a bit more memory than the previous code. There is a way around that, I believe, but I just want to make it work for now :)

Oh no! I thought Image.open() would block until it's done reading :(
I suppose you could just skip on deleting it and hope it's cleared when the
system is rebooted?

On Wed, Aug 8, 2018 at 7:06 PM FormerLurker notifications@github.com
wrote:

LOL! No problem. There is an issue on Windows with the temp directory
getting deleted. Apparently an Image object is not immediately read into
memory when opened from a file, and when you call rmtree the image is
deleted, which throws an exception. I'm working on that right now, but the
resulting code will take a bit more memory than the previous code. There is
a way around that, I believe, but I just want to make it work for now :)

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/FormerLurker/Octolapse/issues/216#issuecomment-411581817,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIJ8N9GO-gqemtRLZjCinLs1G52PUBUvks5uO27dgaJpZM4VvLyj
.

I didn't realize it worked the way it does either. It seems that any image opened from a file stream needs to be open if there are any operations to perform. A call to Image.close() is necessary to close the stream (I'm guessing the GC will get it eventually if not).

I just pushed a commit that should fix this by opening then returning a copy of the image (I think this just reads and copies into memory, but I need to research). I added a finally to close both the copied image and the final preview image. I could NOT for the life of me figure out how to use 'with' for the initial

camera_image = take_in_memory_snapshot(self.Settings, active_cameras[0])

so I didn't even bother trying to refactor the other call

preview_image = render.preview_overlay(rendering_profile, image=camera_image)

and I'm not even sure we need it for the second call since it's not coming from a file object. I may look into the Image.close() code and see what's going on. I'm guessing Image.close also releases memory, so maybe it's worth looking into.

@Shadowen, I looked into the docs and it's much easier than I made it out to be. I think we just need an
Image.Image.load()
and then close the file.. I'll try this and report back.

Try with open() as f: to make a file pointer, then call Image.open(f)
while the file pointer is valid?

On Wed, Aug 8, 2018 at 7:40 PM FormerLurker notifications@github.com
wrote:

@Shadowen https://github.com/Shadowen, I looked into the docs and it's
much easier than I made it out to be. I think we just need an
Image.Image.load()
and then close the file.. I'll try this and report back.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/FormerLurker/Octolapse/issues/216#issuecomment-411588590,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIJ8N2nwMFxk8QGNqeG4nRmvuZX6WVGKks5uO3bjgaJpZM4VvLyj
.

The problem is that operations performed on the image object seem to fail after you exit the with block. Check this page out: https://pillow.readthedocs.io/en/5.2.x/reference/open_files.html#file-handling

Also, Image.Image.load() doesn't seem to work. Only Image.copy seems to work.

It's not a problem, I just don't like reading something large into memory, then copying it into another block of memory. However, what is a few MB among friends :) I'll bet there's a way to make it happen. Feel free to look at it if you want, but the last commit works. I'm wondering why it worked on your system, but I'm sure there's some OS specific issue that made it work for you and not for me. I still can't get fontconfig working on my pi (need to just start over) so I haven't tried it there.

Very strange... Ubuntu might not actually delete files until later, so that
could be why. Image.Image.load does seem correct to me, not sure why that
wouldn't work. We can keep the image file around until the image has been
encoded into base64 if that's necessary...

Otherwise, I have no idea what's wrong with fontconfig on your pi. It
works fine on my pi :/

On Wed, Aug 8, 2018 at 7:49 PM FormerLurker notifications@github.com
wrote:

The problem is that operations performed on the image object seem to fail
after you exit the with block. Check this page out:
https://pillow.readthedocs.io/en/5.2.x/reference/open_files.html#file-handling

Also, Image.Image.load() doesn't seem to work. Only Image.copy seems to
work.

It's not a problem, I just don't like reading something large into memory,
then copying it into another block of memory. However, what is a few MB
among friends :) I'll bet there's a way to make it happen. Feel free to
look at it if you want, but the last commit works. I'm wondering why it
worked on your system, but I'm sure there's some OS specific issue that
made it work for you and not for me. I still can't get fontconfig working
on my pi (need to just start over) so I haven't tried it there.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/FormerLurker/Octolapse/issues/216#issuecomment-411590368,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIJ8N1KMmoh9UuXcCBjq9BP02Eg7r5JNks5uO3kQgaJpZM4VvLyj
.

@FormerLurker https://github.com/FormerLurker/Octolapse/issues/216#issuecomment-411556506
Hi, Im trying to be annoing but, I cant make 2 cameras work at the same time, the second one doesnt conect,
http://[octoprint_ip_address_here]:8080/?action=snapshot
and
http://[octoprint_ip_address_here]:[port_number_of_second_webcam_here]/?action=snapshot

I have tried what you said, but nothing. I might be doing something wrong.
It would be wonderful if in some future after the final version is released and everything is working properly, you make a couple guides on how to make the multi-webcam work. So people like me can do it without asking as annoyingly as I do.

Thanks for all your work with octolapse, I really like the plugin, and I think it is one of the best ones for octopi. I use it from the very beginning.
Cheers form Argentina!

@tixenre, I'm not 100% sure the best way to do this either, lol! I JUST got a second webcam like a few weeks ago. Previously I was using my DSLR and my webcam for multicamera.

I did do one manual test where I started mjpegstreamer through SSH (the terminal) and ran a print with my new endoscope and my webcam. It seemed to work fine, though I'm having some trouble with the endoscope (I don't think it's related to Octolapse). I had a bit of trouble figuring out how to start a second stream, but I'll see if I can recreate it. I am working on documentation for multicam. I'll message you back when I have something.

I'm so glad DSLR Support was finally added. Here's my first attempt with it, using a Canon EOS 350D and gphoto2. https://youtu.be/emI5P5akQAw

I do not want Octolapse to generate the timelapse though, just control movements and trigger the camera. I tried setting the Snapshot Timeout to something really short (500ms) so that it would quickly timeout after taking the picture and resume printing but the printhead would stay in the corner for 4-5 seeconds during every picture. Could you add the ability to set it so it doesn't try and get the picture?

Other than that, it worked really well!

Just disable the rendering profile. It's in the settings. Change your
camera timeout to something larger. If the timeout is reached, the
snapshot is cancelled.

Im not sure what you mean when you say,"Could you add the ability to set it
so it doesn't try and get the picture?"

Do you mean you don't want the image downloaded to the pi? If so you need
to change the download script. Let me know if you are running Linux
(octopi or something like that) or windows.

On Thu, Aug 16, 2018, 6:54 PM brandonforty2 notifications@github.com
wrote:

I'm so glad DSLR Support was finally added. Here's my first attempt with
it, using a Canon EOS 350D and gphoto2. https://youtu.be/emI5P5akQAw

I do not want Octolapse to generate the timelapse though, just control
movements and trigger the camera. I tried setting the Snapshot Timeout to
something really short (500ms) so that it would quickly timeout after
taking the picture and resume printing but the printhead would stay in the
corner for 4-5 seeconds during every picture. Could you add the ability to
set it so it doesn't try and get the picture?

Other than that, it worked really well!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/FormerLurker/Octolapse/issues/216#issuecomment-413718155,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Af0UuEJ157Oyd1WYwsie-jav_F2vs4L0ks5uRgZEgaJpZM4VvLyj
.

Thank you! Setting the timeout to 10000 makes it wait less time for the picture to be taken. When it was set to 500ms I was getting an error message saying the snapshot script failed, but it still took the picture. I thought this was because Octolapse was expecting a picture to be downloaded somewhere even though the timelapse rendering was turned off.

My problem is fixed, I had it configured incorrectly. Thank you for adding scripts. It works really well and the results are amazing!

@brandonforty2, my pleasure! Please let me know if you run into any other issues. The DSLR functionality does finally seem to be working pretty well :)

I'm using this version plus the custom profile you outlined for the Monoprice Select Mini v2 at https://github.com/FormerLurker/Octolapse/issues/169

Using Cura v3.4.1

Starting gcode in Cura:
G21;(metric values) G90;(absolute positioning) M82;(set extruder to absolute mode) M107;(start with the fan off) G28;(Home the printer) G92 E0;(Reset the extruder to 0) G0 Z5 E5 F500;(Move up and prime the nozzle) G0 X-1 Z0;(Move outside the printable area) G1 Y60 E8 F500;(Draw a priming/wiping line to the rear) G1 X0;(Move a little closer to the print area) G1 Y10 E16 F500;(draw more priming/wiping) G1 E15 F250;(Small retract) G92 E0;(Zero the extruder)

A quick test print resulted in a viable timelapse video, but when the print starts it says:

_Octolapse - Position Error
Position - Coordinates (X:-1.00000,Y:60.00000,Z:0.00000,E:439.82000) are out of the printer area! Cannot resume position tracking until the axis is homed, or until absolute coordinates are received._

If I dismiss the error the print continues as expected and then generates a video.

Attaching one of the gcodes I'm using for reference, please let me know if I can provide any other useful information for future updates. Thanks for the awesome plugin!
Wall_headphone_hook_40mm.gcode.zip

@radioraheem, it's just a warning, but if you want the message to go away your print volume needs to be adjusted. If you are using the 'override octoprint printer profile' setting in the Octolapse printer profile, change XMin to -1. Otherwise go into your Octoprint settings and click on the 'Printer Profiles' link under 'Printer', then edit your current printer profile, select the 'Print bed and build volume' tab and select 'Custom Bounding Box'. Fill in the volume, but instead of putting 0 in for X Coordinate Min use -1 instead.

Let me know if that helps!

@FormerLurker looks like that did the trick. Thank you so much!

All, I'm pushing an rc/devel release that has some major features finalized. Closing this out and starting a new one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adcurtin picture adcurtin  Â·  4Comments

brandonforty2 picture brandonforty2  Â·  9Comments

Kesiunas picture Kesiunas  Â·  13Comments

ulitiy picture ulitiy  Â·  3Comments

yoyo42 picture yoyo42  Â·  4Comments