Skip to content

html5-webcam: feat: Update Webcam widget to allow streaming h264(mp4) - #796

Merged
emcniece merged 6 commits into
cncjs:masterfrom
colin-campbell:html5-webcam
Jan 16, 2023
Merged

emcniece merged 6 commits into
cncjs:masterfrom
colin-campbell:html5-webcam

Conversation

@colin-campbell

Copy link
Copy Markdown
Contributor

A simple update to the webcam widget that allows the use of the HTML5 <video/> tag for suitable remote streams.

It means less faffing about and expensive conversions for those of us that have, say, h264-capable webcams attached to a pi. We may use for example https://github.com/soyersoyer/fmp4streamer

If your stream URL ends with ".mp4" it will simply switch out the <Image/> tag for <video/>

@emcniece

emcniece commented Jan 9, 2023

Copy link
Copy Markdown
Contributor

Thanks for the great PR! And welcome to the NodeJS version challenge 😓

@colin-campbell

Copy link
Copy Markdown
Contributor Author

@emcniece Thank you! Is there work going on to mitigate this in v2? I do mainly Golang & stuff, but I'm not above doing some grunt work around getting the dependencies and toolchain updated beyond 2019 ;)

@cheton
cheton self-requested a review January 9, 2023 20:15
@emcniece

emcniece commented Jan 9, 2023 •

Copy link
Copy Markdown
Contributor

I'm not aware of any dependency management tools (dependabot, greenkeeper, etc) planned for implementation, but it would certainly help us out once we get everything updated. This work is not in progress unfortunately, the project is pretty quiet. I'd happily accept help if you want to give it a shot!

I know that NodeJS 12 is long-EOL'd, but there are some difficult issues around updating packages now that many things have major version bumps. I think some packages are now deprecated and need replacement as a whole. Upgrading is difficult, and involves a larger discussion about the platforms and deploy targets that CNCJS supports. I made a serious attempt to update the documentation repo about a year ago and fell flat on my face in dependency hell.

It looks like your bump to Node 14 nearly worked, with the exception of a node-gyp issue on Windows. If we can figure that out it would be a nice win, and I'd happily update the docs and deprecate Node 12 as a supported runtime.

@colin-campbell

Copy link
Copy Markdown
Contributor Author

A bump to node 16 would, I think give us a prebuilt native MacOS arm64 node runtime and the possibility to build both universal and architecture-specific MacOS electron apps, among other things.
Like I say, this toolset is not really my area, although I recently had to upgrade a React Native app from 0.59 to 0.63, with all that associated torture. If I get some time, I shall look at it - this platform is proving very useful in my adventures with grblHAL.

@parachvte

parachvte commented Jan 11, 2023 •

Copy link
Copy Markdown

I know that NodeJS 12 is long-EOL'd, but there are some difficult issues around updating packages now that many things have major version bumps. I think some packages are now deprecated and need replacement as a whole. Upgrading is difficult, and involves a larger discussion about the platforms and deploy targets that CNCJS supports. I made a serious attempt to update the documentation repo about a year ago and fell flat on my face in dependency hell.

Feel free to use https://github.com/Snapmaker/Luban as a reference for dependency upgrades.

We forked from CNCjs and we are actively maintaining our version.

There are still some packages by cheton (and his company) still not being replaced, but popular packages are kinda up-to-date. I also made macOS ARM64 attempts, and it worked (building on Github Actions).

@colin-campbell

Copy link
Copy Markdown
Contributor Author

Well I got past the npm problem, only to be beaten by the serialport bindings on Windows. I shall try to find a windows machine somewhere to test myself.

Is there any reason yarn is used in Appveyor but not in the main project?

@emcniece

Copy link
Copy Markdown
Contributor

I'm personally not sure if there was a reason for using yarn instead of npm - that was before my time here. Unification would be good, especially given #794.

The serialport package issue has a long history, available for reading here in the issues. I haven't dug into it yet, but from what I can remember it's a distribution/packaging problem with binaries that get shipped (or don't) with the package. I think I read something about changing that library out for a different one, and there was a problem with that too.

@emcniece

Copy link
Copy Markdown
Contributor

Nice sleuthing 🕵️

@colin-campbell

Copy link
Copy Markdown
Contributor Author

Pity I don't know how Appveyor works. I'll try to fix the yaml in the next commit.

@colin-campbell

Copy link
Copy Markdown
Contributor Author

@emcniece Finally! Got the windows to build. But the MacOS failed because of a glitch in the matrix, I think. Is it possible for you to re-trigger the build?

@emcniece

Copy link
Copy Markdown
Contributor

I don't see any options to manually run the build, I think because it's https://ci.appveyor.com/project/cheton/cncjs/ and not mine.

Might I suggest git commit --amend && git push -f --no-verify?

…THoutside PS

Re-trigger build because: reasons.
@emcniece

Copy link
Copy Markdown
Contributor

The Github publish docs don't mention it, but I have a feeling that the nodejs_version: "12" references in the on: trigger section of each of the 3 Github deploy providers will need to be bumped to match the new version 14 builds.

This is only for the publishing step though, in the interest of not having to rebuild this PR again and wait 1.25h I can incorporate this change in my other PR that deals with artifacting npm-shrinkwrap 👍

Might as well tag & release both of these PRs at the same time (later). Ready for merge?

@colin-campbell

Copy link
Copy Markdown
Contributor Author

Yeah, thanks. Go ahead!

@emcniece
emcniece merged commit 9644ab2 into cncjs:master Jan 16, 2023
@emcniece

Copy link
Copy Markdown
Contributor

Thanks for all the help on this one 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants