Webcam glitch as soon as I start a print job

What is the problem?
OctoPrint is running perfectly fine itself, though I have this weird issue with my webcam: As soon as I load a gcode and push the print button, my webcam glitches out like this:

firefox_2018-11-05_21-17-48

For reference, this is what it should look like: https://i.imgur.com/a1JByxR.png

It's zoomed it, overexposed, low fps and just messy. I am using a Logitech C525 on a Raspberry Pi 3B with the recommended settings from this wiki page.

I then manually stop the webcam daemon (mjpg-streamer), reconnect the USB of my camera, start it again and it works flawlessly, just until I start a new print.

Any ideas what could cause this?

What did you already try to solve it?
Tested the camera on different computers, reinstalled mjpg-streamer (some issues getting v4l completely removed though, maybe someone knows how to cleanly reinstall everything?)

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)

OctoPi 1.3.9, manually installed on latest Raspbian on a Raspberry Pi 3B.
Printer: Anycubic i3 Mega, latest 1.1.2 firmware from manufacturer

Hi @davidr!

Do you have an appropriate power supply for the RasPi, or have you connected to the power supply of the printer?

1 Like

Hi Ewald,

I use an external power supply (5V 2A) for the Raspi as I need it to run 24/7. Should be enough, but maybe it's getting dodgy, it has ran for a year now, I don't know. I will check with a phone quick charger with 5V 2,4A later.

Thanks.

1 Like

Hi @davidr, are you by chance using Octolapse? If not, you can ignore this. If you do have Octolapse running, perhaps you have ' Custom Image Preferences' enabled within your camera profile? If so, you will probably have to tune these settings or disable that option.

3 Likes

Oh well, I do indeed use Octolapse and that was it. Enabled that option to up the contrast a little bit and left everything else stock and forgot about it. That was it. Thank you very much, @FormerLurker.

2 Likes

Glad that solved your issue! Check out this guide for getting the camera settings dialed in. You'll get a better timelapse if everything is set to manual and correctly tuned for your lighting conditions. The 'Auto' settings can add unnecessary delays in some cases, and cause flickering.

1 Like

Thanks so much for that guide! While I didn't yet get to do it perfectly, I already got a much more natural image. Not as overexposed.

Before:

After:

I think the biggest advantage for me will be the manual focus, as I had some badly focused frames in my timelapses all the time. It's hard for the camera to manage with all that black.

Just a small thing, I like to stream my printing to friends, and with the settings the framerate dropped a bit. Is that normal? I can totally live with that, but maybe I can also tweak that somehow.

The quality setting can increase the bandwidth required for sure, though it doesn't seem to affect my camera at all. In other words, it's possible, but it would depend on your camera. I'm having a hard time figuring out how switching from automatic to manual would decrease framerate, though. It's worth investigating.

You should notice much smoother Octolapses now that you are using manual settings. Post a link next time you upload one!

Maybe it's just on my end, as I am running a whole lot of other stuff on my Pi. Weird enough as I thought manual settings would result in less processing power used. Or it's done on the camera itself and it's just my C525 that is weird in that regard. But really the most important thing is smooth timelapses, going from 30 to about 20 fps on a live stream is nothing to worry about.

Heh, I just noticed you're the author of Octolapse. Great work! Will post a before and after footage tomorrow.

1 Like

Thanks for the compliments, and I'm looking forward to seeing your before and after! If you post it online, maybe include the wiki link so others can benefit from your efforts.