mikedmor / OctoPrint_MultiCam

Extends the Control tab of OctoPrint, allowing the ability to switch between multiple webcam feeds.
45 stars 19 forks source link

Multicam seems to be broke for octoprint 1.9.0RC2 #53

Closed swheettaos closed 1 year ago

swheettaos commented 1 year ago

I know they are making major changes to how the webcam works. I noticed my webcams aren't working. I have to run them in 4:3 normally the problem is in your plugin (and the new octoprint web interface) it doesn't seem to give me that option anymore.

RoboMagus commented 1 year ago

Can confirm the plugin is no longer functional with 1.9.0.

Web UI Console provides the following:

Please use the webcam system introduced with 1.9.0, the webcam_snapshotUrl config setting is deprecated and will be removed in a future release. Stacktrace: Error
    at SettingsViewModel.read (https://octoprint.my-domain.com/static/webassets/packed_core.js?f195a60e:342:137)
    at Function.yd (https://octoprint.my-domain.com/static/webassets/packed_libs.js?6bee1dee:130:18275)
    at Function.zd (https://octoprint.my-domain.com/static/webassets/packed_libs.js?6bee1dee:130:17972)
    at Function.ha (https://octoprint.my-domain.com/static/webassets/packed_libs.js?6bee1dee:130:17808)
    at Function.Hc (https://octoprint.my-domain.com/static/webassets/packed_libs.js?6bee1dee:130:17653)
    at Function.notifySubscribers (https://octoprint.my-domain.com/static/webassets/packed_libs.js?6bee1dee:130:9667)
    at Function.xa (https://octoprint.my-domain.com/static/webassets/packed_libs.js?6bee1dee:130:12024)
    at Object.c [as snapshotUrl] (https://octoprint.my-domain.com/static/webassets/packed_libs.js?6bee1dee:130:11759)
    at SettingsViewModel.write (https://octoprint.my-domain.com/static/webassets/packed_core.js?f195a60e:342:361)
    at SettingsViewModel.e [as webcam_snapshotUrl] (https://octoprint.my-domain.com/static/webassets/packed_libs.js?6bee1dee:130:15710)
packed_plugins.js?dff121cc:16433 Uncaught TypeError: self.control._enableWebcam is not a function
    at MultiCamViewModel.self.loadWebcam (packed_plugins.js?dff121cc:16433:34)
    at HTMLButtonElement.<anonymous> (packed_libs.js?6bee1dee:133:4368)
    at HTMLButtonElement.dispatch (packed_libs.js?6bee1dee:13:43090)
    at v.handle (packed_libs.js?6bee1dee:13:41074)
crysxd commented 1 year ago

I was involved in redesigning the webcam stack for 1.9. The first stack trace is a warning and not cause of the issue, OctoPrint 1.9 comes with a compat layer to prevent old plugins from breaking.

The second stack trace is what breaks the plugin. The plugin seems to meddle with OctoPrint's UI, which changed with 1.9.

@mikedmor Do you plan on supporting OctoPrint 1.9? In the end you just need to implement the new WebcamPlugin mixin and you can provide a Jinja template of type webcam. This will fully integrate Multicam into the standard OctoPrint UI and ecosystem. All cameras can be viewed and used for snapshots.

mikedmor commented 1 year ago

Hey All, Its been some time since i last worked on this as its been functional for me up until 1.9. I'm in the middle of a few other projects, but still use this plugin myself daily so I definitely have intentions to update it, but at the moment I do not have a timeline for when that will happen. Ill update this thread again once i start working on the adjustments, and have an update available.

crysxd commented 1 year ago

@mikedmor I'm happy to assist you if you are still willing to maintain this plugin. I don't have a working dev environment right now as I'm not home until the 11th of May, but can help you after with a PR.

I think the conversion is super simple in the end:

M-GBear commented 1 year ago

Yes Multicam is dead with the release of 1.9

Hope @mikedmor and @crysxd can get together soon for a fix, especially as I've spent many hours configuring my cams to only have them lost to the upgrade a week later :(

Really appreciate the effort @mikedmor has put in to maintaining this plugin for a long time.

Thank you.

crysxd commented 1 year ago

I made a first rough implementation. Doesn't show the webcam yet, but the webcams are now recognized by OctoPrint. We now need to create a surface to show the webcam in (same as the bundled plugin) and apply rotation etc

Screenshot 2023-05-27 at 09 22 18 Screenshot 2023-05-27 at 09 24 02
dirkvranckaert commented 1 year ago

Any progression the issue and maybe a targettes Release date?

opjose commented 1 year ago

In case anyone is interested, the Octopod Plugin stills shows multiple cameras to connecter clients.

M-GBear commented 1 year ago

How easy is it to downgrade back to the previous version of Octoprint? Will doing that restore the previous functionality with Multicam, or will I need to setup everything again?

mikedmor commented 1 year ago

Hey @M-GBear You could try downgrading this way: https://community.octoprint.org/t/how-can-i-revert-to-an-older-version-of-the-octoprint-installation-on-my-octopi-image/205

I think anything before 1.9.0 should still be working. I have been working on the changes to get this setup, but its been going a little slow. Hopefully I can get things wrapped up and post an update over the next few weeks. Good luck downgrading.

M-GBear commented 1 year ago

@mikedmor thanks for that link, it seems straight-forward enough. I'm in the middle of a 10 hour print job so I'll tackle this tomorrow. I'll be sure to let you know how it goes. Also, great news that you hope to post an update within weeks. Cheers

chrisjq commented 1 year ago

Here's a patch to get it going from master: OctoPrint_MultiCam-56dcdb8-feat: Resolve multicam issue in latest octoprint.patch

opjose commented 1 year ago

How do we install the patch?

Thanks!!!!

dirkvranckaert commented 1 year ago

I simply downgraded, everything seems to be still working, only thing were the Octoprint camera settings that were gone (so need to re-enter the stream url)

crysxd commented 1 year ago

only thing were the Octoprint camera settings

Yes, when you moved from 1.8 -> 1.9 they were migrated into the bundled plugin and removed from the global settings. Those are not moved back when you downgrade

mikedmor commented 1 year ago

Quick update. I have a semi working version ready for when Octoprint 1.9.1 releases.

To get the new update you first will have to update to version 0.3.1 to have access to the RC channel via "Software Update" in the settings. After getting version 0.3.1, you can then go to "Software Update" and switch MultiCam to the "Release Candidate" channel to get version 0.4.0rc1.

Please note that there are still quite a few bugs that need to be worked out, it does however work better than 0.3.0 currently.

Another note is that currently in Octoprint 1.9.0 this plugin forces you into safemode as there are some bugs with the core of octoprint that will require a patch. If you would rather not wait for 1.9.1 to release, you can manually update your core using the code posted to the Octoprint Repository: https://github.com/OctoPrint/OctoPrint/issues/4818

mikedmor commented 1 year ago

rc4 was just released which addresses the issue regarding 1.9.0 and should now work for that version.