How read stream web cam in node.js for mac os? - macos

I seen analog lib "camelot" and "imagesnap" in npm repositories.
"camelot" - work only in linux os (because it uses /dev/videoX).
"imagesnap" - support only create jpg and not support created stream. Same it lib is binary.
What may be a simple solution?

worked with lib https://github.com/wearefractal/camera,
for mac os need install opencv, i'm use brew install opencv.
it's really work!!

I haven't got everything working yet, but connecting to GStreamer over TCP from Node looks promising:
http://delog.wordpress.com/2011/04/26/stream-live-webm-video-to-browser-using-node-js-and-gstreamer/
The tutorial is about Linux, but most things should have an OSX equivalent. To get started:
Install XQuartz: https://xquartz.macosforge.org
brew install gstreamer
brew install gst-plugins-good
brew install gst-plugins-bad
If everything installed properly, this command should give you a test video source:
gst-launch-1.0 videotestsrc ! osxvideosink
I'm now trying to figure out how to get the webcam. I think the built-in webcam is locked down, but hopefully an external one might work.
I'm interested to hear if you make any progress!

Related

Install chromedriver on Mac M1 at specific location?

I just made the jump from Ubuntu to MacBook Air M1.
I am trying to set-up the system in a way that I don't have to change scripts for both. i.e. I want to keep the scripts in such a way that editing on either system is ok.
In a script I use the following line of code:
driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver")
I used Homebrew to install chromium-browser but I can't find the file (so I can move it to this location?).
I have tried almost everything I could look up and can't figure it out. What can I try next?
Install webdriver-manager, it allows you install and store chromedrive automatically
pip install webdriver-manager
and use like this:
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
The fastest way to to solve is using Home Brew:
brew install --cask chromedriver
Chromedriver will be installed in the correct path.
You can find the downloads for various versions of the Chrome driver here: https://chromedriver.chromium.org/downloads
For example, for v99 on Mac M1 you could download this archive: https://chromedriver.storage.googleapis.com/99.0.4844.51/chromedriver_mac64_m1.zip
Once downloaded just unzip & copy to whatever location you choose. After I installed I still needed to mark the application as "safe" in macOS, I followed the instructions here: https://stackoverflow.com/a/60362134/1371489

How to install libraries (mysql connector cpp) on Mac using terminal and make things simple as in the case of Ubuntu

I will share an example.
I had to install mysql connector c++ libraries for my project.
To install connector c++ on my Mac, i had to build it from the source code and it takes a lot of effort because you get errors sometimes and then it is troublesome, something which should have been done in a short time.
In case of Ubuntu, I just had to write one command in the terminal, and wow, everything just got done automatically.
apt-get install libmysqlcppconn7
Does anybody know any similar command in mac, using brew or macports?
I tried to find but I guess I didn't get any results to satisfaction.
And if there is not, can anyone guide me so that I can make it possible, like I think it's possible for mac, if it is possible in ubuntu.
Please guide me, an answer in a bit detail would be so much appreciated.
Probably the nearest thing to apt-get on a mac is brew
Once it is set up (and this isn't difficult) "brew install mysql-connector-c++" will install on the mac

ImageMagick + El Capitan Unable to Locate Module

UPDATE: Solved with the solution here
I have spent the better part of my day trying to get ImageMagick to work with Grunt, with no luck. Grunt seems to be okay, but ImageMagick not so much, even though I've run the test on ImageMagick.org to make sure that it's installed correctly (I used HomeBrew for the install).
I get this error when trying to run a task:
Warning: Command failed: identify: unable to load module
'/usr/local/Cellar/imagemagick/6.9.2-4/lib/ImageMagick//modules-
Q16/coders/jpeg.la': file not found # error/module.c/OpenModule/1300.
identify: no decode delegate for this image format 'JPEG' #
error/constitute.c/ReadImage/501.
I've tried the solutions here and here, but none of them have helped.
(FYI I'm new to using the command line.)
Help?
As with any homebrew problem, I would suggest you run
brew doctor
first, to try and sort things out. It is an excellent diagnosis tool.
Now, to your specific problem... mmmm... the /opt/X11 part of your error message worries me because homebrew installs in /usr/local/bin and /usr/local/Cellar so your ImageMagick should not be looking anywhere in /opt at all. I guess you have installed freetype via MacPorts or some method other than homebrew.
I would suggest you install the freetype stuff using homebrew, i.e.
brew install freetype
Then I would suggest uninstalling any other freetype stuff you have installed any other way. Finally, I would suggest you check your PATH environment variable and make it point to /usr/local/bin before anything in /opt. You will need to log out and back in for the new PATH to take effect - you can check your PATH like this:
echo $PATH
and change it by editing $HOME/.profile if you need to.
The homebrew version of freetype provides version 19 of the library and is therefore compatible with the homebrew ImageMagick version.
Also, I am a little disconcerted by the X11 part in your error message - modern Macs don't really use X11 any more and it doesn't ship with OSX. Let's see if the above ideas sort you out before worrying about that too much though - unless you know, and can say for sure, that you need X11.

gstreamer error on mac

I have been working on my mac (version 10.10) and my raspberry pi (raspbian) to stream video feed live from my raspberry pi camera to my mac using gstreamer. On my mac, in terminal, I have been putting in the following code to receive the data from the raspberry pi over wifi:
gst-launch-1.0 -v tcpclientsrc host=192.168.2.50 port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false
However I keep getting the error,
ERROR: pipeline could not be constructed: no element "tcpclientsrc". Has anyone run into this issue before and is it likely that I mis-downloaded a plugin causing this error? If someone has any better way of streaming video feed with low latency and less than a second of lag, I would appreciate links to guides. Any insight into this error would be useful, if you need more information to answer the question, just ask in the comments.
Thank you for your advice.
So, I did some more research and found a list of plugins that would help. With homebrew to get the extra plugins use the command:
brew install gstreamer gst-libav gst-plugins-ugly gst-plugins-base gst-plugins-bad gst-plugins-good, which will get all of the needed plugins for streaming live video feed.
You need to install gst-plugins-base to get tcp plugins
if you use port to install your software
sudo port search gstreamer1
will list all the port related to gstreamer1
then you can install gstreamer1-gst-plugins-base
sudo port install gstreamer1-gst-plugins-base

How can I install qpdf on Mac 10.8.3?

When running R CMD check on packages on a Mac build server, I'm getting a warning
‘qpdf’ is needed for checks on size reduction of PDFs
I can't seem to get qpdf installed and on the system. I tried installing via the fink package manager, but according to the package database (http://pdb.finkproject.org/pdb/package.php/qpdf), qpdf doesn't seem to have been built since osx 10.6, and I'm on 10.8.3.
Can anyone point me to qpdf mac install or build instructions? Or is there a way to disable the warning when checking R packages?
This is somewhat related to the question qpdf.exe for compactPDF?, although they were on a windows machine and I'm on a mac.
You can install qpdf with homebrew:
brew install qpdf
MacPorts can help you. Download MacPorts from http://www.macports.org/ and run sudo port install qpdf.

Resources