Webcams freezing up.
When updating the OS to the newer version to allow for Adaptive Meshing & Priming, the webcams seem to freeze after a while. As seen in the attached video, connecting directly to the stream you can see the stream does work. To get the cameras to work again in the WebUI, it is necessary to switch tabs or swith between camera views. However, after a while, the images freeze again. This happens whatever choice you make (single camera or both).
Please note I am not 100% sure this is OS related, though the fact the stream works when connecting direclty makes me believe it may be.
Edit: forgot to mention it only seems to happen if using Adaptive MJPG (experimental).
59 Replies
Crowsnest v4 contains breaking changes and requires manual steps to...
Crowsnest just recently made huge changes to the way it works. This is great news, because it should be much faster and more reliable. Unfortunately, it also means that there are major breaking changes, and you'll need to do some manual steps to upgrade. When you update to V4 through the machine tab in mainsail, crowsnest will stop working until...
Good to know, but I am still on V3
Might help to update
Why did you install sonar?
I have a print running. I'll try to update it tomorrow as it is getting late. Well... not as late as for you. Plus 1 hour where you are, I assume π
It is known to cause problems with the network on RatOS. I don't know if it has anything to do with your webcam problem. But worth mentioning.
indeed 02:14AM π
I installed sonar because from time to time my instance stopped responding. The prints would continue printing, but I could not reache the web ui.
As if the network stopped.
Did it solve it?
So I installed sonar and since then I haven't had issues.
Ok good
At least as far as I can tell.
Haven't had a problem in months.
I have the opposite issue. Without sonar everything works, forever. If i install sonarr, nothing works π
π
Thats software for you.
ok... So I'll finish up what I am doing, leave the current print running, and tomorrow morning I'll try and upgrade to v4.
Must read, first.
Will I set this for both instances of cameras?
Change URL Stream and URL Snapshot to webcam/webrtc
Or do I have to add a number as with the current solution?yes, remember different ports though
this would be webcam/webrtc and webcam1/webrtc .. i think.. sec
webcam/webrtc and webcam2/webrtc
So in the conf file, this:
[crowsnest]
log_path: ~/printer_data/logs/crowsnest.log
log_level: verbose # Valid Options are quiet/verbose/debug
delete_log: false # Deletes log on every restart, if set to true
[cam 1]
mode: mjpg # mjpg/rtsp
port: 8080 # Port
device: /dev/video0 # See Log for available ...
resolution: 1280x720 # widthxheight format
max_fps: 15 # If Hardware Supports this it will be forced, otherwise ignored/coerced.
v4l2ctl: power_line_frequency=0
[cam 2]
mode: mjpg # mjpg/rtsp
port: 8081 # Port
device: /dev/video2 # See Log for available ...
resolution: 1280x720 # widthxheight format
max_fps: 15 # If Hardware Supports this it will be forced, otherwise ignored/coerced.
v4l2ctl: power_line_frequency=0
will become this:
[crowsnest]
log_path: ~/printer_data/logs/crowsnest.log
log_level: verbose # Valid Options are quiet/verbose/debug
delete_log: false # Deletes log on every restart, if set to true
[cam 1]
mode: camera-streamer
port: 8080 # Port
device: /dev/video0 # See Log for available ...
resolution: 1280x720 # widthxheight format
max_fps: 15 # If Hardware Supports this it will be forced, otherwise ignored/coerced.
v4l2ctl: power_line_frequency=0
[cam 2]
mode: camera-streamer
port: 8081 # Port
device: /dev/video2 # See Log for available ...
resolution: 1280x720 # widthxheight format
max_fps: 15 # If Hardware Supports this it will be forced, otherwise ignored/coerced.
v4l2ctl: power_line_frequency=0
And then the changes in the UI.indeed
Ok. I'll give it a go and report back.
Thanks!
also you should be able to get 30 fps in v4
Ohhhhhh!!!
It uses hardware encoding
I like the sound of that.
No more jerky frames.
indeed it's hella smooth
That sounds amazing!
And yes, I did run the update.
you need to do
cd ~/crowsnest
first
I'll update the guide.It is working.
But I am getting a lot of banding because of the lights / frequency.
is there any way to adjust the frequency for the camera?
equal-aquaβ’2y ago
You could see if there are any v4l options for that
You mean like changing
v4l2ctl: power_line_frequency=0
to v4l2ctl: power_line_frequency=1
? Tried that and didn't see any difference.you'd need to change the shutter speed, usually you have no fine control over that on web cams.
You mean, opening them up?
It's easier to use better lights
No
Shutter speed is the exposure time for an image.
Yes, I know.
Just don't understand when you said "fine control over that on web cams".
You want that to be divisible by your power line frequency. So at 50hz, you want 1/50, 1/200, 1/1000 etc.
I suppose I would need to do that via software.
You don't have manual shutter speed control
That's not a thing on web cams.
You can adjust exposure on some of them, but you get no numbers.
You don't know what is what
just "more" or " less"
Most of them just regulate it via gain and only have a few steps for actual exposure time
Also some lights flicker at irregular intervals.
Get good non-pwm'ed DC lights π .. Like LED's.
Those are LED π
Then those are PWM'ed leds
How are you controlling them?
Uhhhhh... I power them on... and then I power them off. π
how
Connected to a Smart Plug.
When I power on the printer it turns on the printer plug, lights plug and dry box plug.
Yeah, get 12/24V LEDs, wire them to an always on source on your board or psu.
Or a heater port or whatever
Then use an output pin or configure them as actual LED's in klipper
You can PWM them through klipper too and then you can control the PWM frequency
So it matches your powerline frequency for example
cycle_time: 0.02 = 50hz.
Uhhhhh, you do remember whou you are talking to, right? Probably one of the most noobish dweebs on the planet π
Right, litterally the only way to get rid of the banding though. Your smart plug is most likely the problem.
Half of what you said...
Ok.
I'll see what I can figure out.
Is there anywhere I can reed up on this method of connecting lights to Klipper?
If they're not actual strips or have their own controller (like say you bought some off the shelf LEDs + controllers in IKEA) you'll never get it to work.
Yes, I get I will need to replace them.
It's the same as wiring up a fan or a heater.
See image above π
You use this to control the port they're connected to: https://www.klipper3d.org/Config_Reference.html#output_pin
You have to remember I did nothing of this.
You have already wired heaters to your board..
It's all MΓ‘rcio's fault. π
Oh
I guess you go poke around on youtube.
There's a lot to learn.
Sounds like a logical next step.
Thanks.