LazeMSS / OctoPrint-UICustomizer

UI Customizer for octoprint
165 stars 18 forks source link

webcam problems in ver 0.1.8.7 #234

Closed CBDesignS closed 2 years ago

CBDesignS commented 2 years ago

Description

**ENTER DESCRIPTION HERE Describe your problem?

Webcam preview in right part of screen just says Loading webcam until it gives up. Cam pictures are live if the option to display in control menu is unticked as it should be but if the box is ticked to hide then it never comes back in the other preview window.. This is brand new to this release of 0.1.8.7

cam1 cam2 cam3

What is the problem? Can you recreate it? Did you try disabling plugins? Did you remember to update the subject?**


Plugins installed

nius] v2.2.8

UI Customizer settings

Software versions

Browser

LazeMSS commented 2 years ago

HLS or normal mpjeg cam stream - what is the cam URL?

LazeMSS commented 2 years ago

Bug found - thanks for reporting will try and fix asap - turn on "Float/Fullscreen webcam" as a workaround

CBDesignS commented 2 years ago

it was just the normal mpjeg cam stream @LazeMSS. thx

ManuelMcLure commented 2 years ago

I'm also seeing camera issues. It works on first page load to show the small camera in the corner, then I can zoom the camera and it works, but if I then unzoom the camera the feed is gone until I reload the page completely. This is Chrome on both Windows 10 and MacOS 12.

LazeMSS commented 2 years ago

I'm also seeing camera issues. It works on first page load to show the small camera in the corner, then I can zoom the camera and it works, but if I then unzoom the camera the feed is gone until I reload the page completely. This is Chrome on both Windows 10 and MacOS 12.

do you have the webcam hidden on control tab or not?

ManuelMcLure commented 2 years ago

Yes, I do. image

CBDesignS commented 2 years ago

Bug found - thanks for reporting will try and fix asap - turn on "Float/Fullscreen webcam" as a workaround

I tried Using this option as you suggested and it is causing the freeze up of the stream on control tab and on preview window.

LazeMSS commented 2 years ago

@ManuelMcLure can you try and use the developer tools to see if the webcam stream stop (under the network tab)

LazeMSS commented 2 years ago

Bug found - thanks for reporting will try and fix asap - turn on "Float/Fullscreen webcam" as a workaround

I tried Using this option as you suggested and it is causing the freeze up of the stream on control tab and on preview window.

Thats really strange. I have no problems on my installations.

CBDesignS commented 2 years ago

Bug found - thanks for reporting will try and fix asap - turn on "Float/Fullscreen webcam" as a workaround

I tried Using this option as you suggested and it is causing the freeze up of the stream on control tab and on preview window.

Thats really strange. I have no problems on my installations.

I use http://192.168.0.254/webcam/?action=stream to remote view on my local lan via vlc so I opened the link in a different browser tab to monitor whats going on.

When the stream freezes up if I refresh the browser tab http://192.168.0.254/webcam/?action=stream the stream starts again in that window and vanishes from the octo preview window then reloads the stream plays as it should untill it freezes and goes again. I repeat the browser tab refresh and it starts to live stream and octo reloads. Freeze can be random. 30 seconds, 5 mins, etc there seems to be no defined time cam4

cam5

This is a different machine from the one I originally started this bug report on. it is (raspbian bullseye InRelease) that I just finnished off setting up, the other machine is still on buster and both display very simmilar problems. both are up to date o/s & rpi firmware wise.

LazeMSS commented 2 years ago

Does the stream also stop in VLC when you are having the problems. The latest update remove ALL the previous "hacks" to make the streams be a copy and now only rely on the main Octoprint stuff.

If you disable hide the main webcam and have the control tab active does this still happen?

ManuelMcLure commented 2 years ago

With the camera enabled in the control tab, before zooming: image After zooming: image

With camera disabled in the control tab, before zooming: image After zooming: image

CBDesignS commented 2 years ago

Does the stream also stop in VLC when you are having the problems. The latest update remove ALL the previous "hacks" to make the streams be a copy and now only rely on the main Octoprint stuff.

If you disable hide the main webcam and have the control tab active does this still happen?

@LazeMSS the vlc stream plays as it should. I have just tried a test print to find out and while the stream in octo is frozen the vlc stream in my house was working great.

LazeMSS commented 2 years ago

@ManuelMcLure could you post the plugins you have installed? Just looking for a pattern here - but I'm guessing you have prettyGcode installed?

LazeMSS commented 2 years ago

I'm 99% sure the bug is related to prettygcode - I have submitted a bug report and a PR to fix it for that plugin (https://github.com/Kragrathea/OctoPrint-PrettyGCode/pull/135)

Until then you can use my the PR version pretty gcode by manual installing the plugin from: https://github.com/LazeMSS/OctoPrint-PrettyGCode/archive/refs/heads/id-bugfix.zip (for help see: https://plugins.octoprint.org/help/installation/ under "Via the URL and the Plugin Manager")

CBDesignS commented 2 years ago

So far so good with the prettygcode patch @LazeMSS . My cam would have frozen by now and its still playing. Just started a 46min print and will keep fingers crossed and (quick edit 2 mins after this post) its frozen up again....

CBDesignS commented 2 years ago

here is a link to a short video . the second the video stops is when it froze up again. I tried to keep it short.

link to video https://1drv.ms/v/s!AisctMQ7h6vWn_MbL7xzBJ6riniPGA?e=IRRZ5n

Since you thought floatingnavbar may have conflicted I have uninstalled FloatingNavBar and restarted octo and it froze the stream just sitting idle, I have just uninstalled PrettyGcode, restarted octo and started a new print. 30 seconds into the print its frozen the webcam stream. I have just refreshed the octo page and it is streaming the now, it may freeze or it may complete..

In my case after removing both plugins I still have stream freezing problems.

ManuelMcLure commented 2 years ago

The PrettyGcode patch doesn't fix my problem either. I think this may be a different issue, though. Do you want me to open a separate issue?

CBDesignS commented 2 years ago

I have screen recorded a short video, it starts with a frozen stream then I refresh the octo window & the stream starts again at 10 seconds into recording, I record until the stream freezes again at 1min 9 seconds.

https://1drv.ms/u/s!AisctMQ7h6vWn_MgaDEIds8uaHzzzg?e=UmHWTX

LazeMSS commented 2 years ago

Could you all try without pretty gcode plugin? It has quite a few "hacks" i just think I have fixed some of it now I looked further into it. I don't have any problems when I disable the pretty gcode plugin

CBDesignS commented 2 years ago

it is removed already along with floating nav bar so I can rule both out.

LazeMSS commented 2 years ago

it is removed already along with floating nav bar so I can rule both out.

And it still freezes after a while?

ManuelMcLure commented 2 years ago

Removing PrettyGCode has no apparent effect on my problem.

CBDesignS commented 2 years ago

it is removed already along with floating nav bar so I can rule both out.

And it still freezes after a while?

yes. the 2nd video is with both removed

copy & paste.

Plugins installed

UI Customizer settings

Software versions

Browser

LazeMSS commented 2 years ago

The hunt continues...

LazeMSS commented 2 years ago

@ManuelMcLure could you open a seperate issue - they are not related.

@CBDesignS could you try and open the developer console and on the network stream look if the stream stops to increase in size when the stream stops - like this: image

CBDesignS commented 2 years ago

Is this what you are looking for ?

cam9

Video:- https://1drv.ms/v/s!AisctMQ7h6vWn_MheUwO3mz84EP_Ow?e=dxLZ77

Now I have just noticed. when the stream freezes if I jump to an open tab hang about for a few seconds then jump back to the octo tab the stream sometimes restarts as if the stream is getting an " old school html-1 era on focus refresh command".

cam10

A short vid showing the tab swapping i mentioned above.

https://1drv.ms/v/s!AisctMQ7h6vWn_MiiK4l22piT8ZJKg?e=TOSUPN

CBDesignS commented 2 years ago

Devtools for Micr$oft Edge. this is from freeze - refresh & stream playing - freeze

cam11

LazeMSS commented 2 years ago

Yes the switching to another tab and back is default behaviour in OctoPrint to prevent the stream running when the tab is non visible. But what we are chasing is what's causing the stream to stop.

I will write a short snippet your can insert into the developer console so we can maybe trace what causing the halt of the stream.

Btw does it always happen at the same time and have you tried switching to the temperature tab instead of the control tab and see if it's any different

CBDesignS commented 2 years ago

it is random as far as I can tell when it will happen and on any octoprint tab. not just the control tab. I am used to clicking on the second tab for pretty g code and must have automatically just clicked like usual hance the reason it was on control.

LazeMSS commented 2 years ago

Okay I will continue to examine it. I just can't figure out what's triggering the stop of the stream.

CBDesignS commented 2 years ago

its got me double guessing at my computer skills. As this second printer is based on a fresh build of octo on o/s buster I never used it to print anything as it`s my OLD semi retired printer so I have just downgraded back to ui build 0.1.8.1 just to make sure the webcam is actually working as it should and this has not been a wild goose chase for a faulty webcam. Yes the webcam and stream works as it should.

One thing I have noticed is the stream window on 1.8.1 is slightly smaller than it is in 1.8.7 when it is docked in the right corner and it is a great deal smaller when its floating free. Could freezing be related to the size in some random way.

build 1.8.1 Inkedcam12_LI

Build 1.8.7 Inkedcam5_LI

It could just be because the settings are slightly different tho.

LazeMSS commented 2 years ago

Yes the old version did alot of dirty tricks to try and keep the streams running - the new version is alot more clean but still there should be nothing kill of the stream.

Try running the following in the developer console:

OctoPrint.coreui.viewmodels.controlViewModel.webcamLoaded.subscribe(function(state) { console.log(state) }); OctoPrint.coreui.viewmodels.controlViewModel.webcamError.subscribe(function(){ console.log('webcam error'); });

CBDesignS commented 2 years ago

I have a slight problem. not sure if it could have been the problem or this is just a poor timed coincidence. the tf card I use on the old printer has just died. humm but the other new Ender 5 Max (mks sgen -L v1) printer showed the same problem so I guess this is just piss poor bad luck with this tf card. it was at least 7 years old. I will rebuild from new card and only install UI and take it from there. back to basics.

clarkiej commented 2 years ago

I have tested and have the same result with both a Pi 3B+ and a Pi 4 4GB Tested with a Logitech C310and a 8MP document camera with the same result. Webcam does not display while camera works fine when testing webcam stream and when turned on under Dashboard: image Cam,era passes Stream Test: image

Camera works under Camera Settings Plugin: image

No display under Webcam: image

Same result with either Floating Overlay or Full Sdcreen Camera: image

Plugins installed

UI Customizer settings

Software versions

Browser

LazeMSS commented 2 years ago

@clarkiej try disabling the following plugins: dashboard and webcam tab.

I'm pretty sure it's related to them. I will check more later

Or maybe just try the turn on "Float/Fullscreen webcam" as a workaround in the settings of UI Customizer

clarkiej commented 2 years ago

I got teh same result using Float/Fullscreen Webcam . I will try disabling dashboard and webcam tab when my current print finishes and let you know how I get on

clarkiej commented 2 years ago

I have disabled the webcam tab and now the UI webcam display is working happily with Dashboard still enabled. I added your Pretty Gcode plugin as well and it is still working fine image

If the Float/Fullscreen webcam is set to "float" the webcam works fine in the control section but if you set it to "FullScreen" when yuo swith to teh control section tab the camera sometimes is blank untill you zoom to full screen and back and then the camera seems to work fine:

Set to "Float": image

ddpt83 commented 2 years ago

Description

**ENTER DESCRIPTION HERE Describe your problem? I have the same Problem. Maybe this test can help you. What is the problem? In same cases, Webcam preview in right part of screen just says Loading webcam until it gives up Can you recreate it? Yes. If I reload the page (F5) when the TAB was on "Control TAB", the Webcam is always OK. If I reload the page when we are on another TAB, the Webcam never does display. Without reloading, when I click on "Control TAB" the Webcam is displaying again.

Did you try disabling plugins? I disabled PrettyGcode. Did you remember to update the subject?**


Plugins installed

UI Customizer settings

Software versions

Browser

DrieStone commented 2 years ago

Description

**ENTER DESCRIPTION HERE

I want to say that I'm having a similar issue. I get "Loading Webcam...." but nothing ever happens. The Webcam tab also doesn't show anything. I can go into the settings and test my webcam and it comes up properly.

This was working until the recent update.

I've tried restarting everything. I've tried this in both Safari and Chrome on my Mac (same effect).


Plugins installed

UI Customizer settings

Software versions

Browser

LazeMSS commented 2 years ago

If you are running webcam tab that's a problem. Im looking into that right now.. I might be able to make a work around that plugin.

DrieStone commented 2 years ago

It happens even when I hide the tab.

Screen Shot 2022-02-28 at 4 39 30 PM

LazeMSS commented 2 years ago

There should not be anything breaking the stream from loading when webcam tab has been disabled.

I will look into it tomorrow

CBDesignS commented 2 years ago

@LazeMSS After the tf card giving up the ghost on me I have just clean installed the curent octo on a new tf card and UIC is the only plugin installed apart from the pre installed ones and so far this test print it has not frozen the stream. If this works I can start installing plugins one at a time until I break it. well thats the plan. I have forgot just how sparse octo is in its generic form.. My cam stream would have frozen less than 60 seconds into a print and its going strong at 5 mins in.

ManuelMcLure commented 2 years ago

Entered new issue #238 for the issue I reported. It looks like an interaction with PrintJobHistory.

DrieStone commented 2 years ago

There should not be anything breaking the stream from loading when webcam tab has been disabled.

I will look into it tomorrow

I figured it out. In my case I had the "webcam tab" plugin active. Once I disabled the plugin, it started to work.

CBDesignS commented 2 years ago

@LazeMSS So far in I have just installed prettygcode and as you already knew it only causes the double stream window on the right or wherever it is configured but it does not cause the stream freezing. I will try your patched version of pretty gcode and see if that fixes the double stream window. If not hey hoy I will move on to the next plugin while trying to freeze the stream.

LazeMSS commented 2 years ago

@clarkiej and @ddpt83 your problems are probally related to PrintJobHistory creating a duplicate of the main webcam id: https://github.com/OllisGit/OctoPrint-PrintJobHistory/issues/194

ddpt83 commented 2 years ago

After disabling PrintJobHistory, the webcam is displayed correctly.

CBDesignS commented 2 years ago

@LazeMSS I dont know if I am getting closer or further away.. Anyway here is the list of plugins I have instralled one at a time and tested with a full reboot after every install and a test print of a part..

Plugins installed