Installing gifify on Windows - javascript

So gifify is a pretty awesome script that converts videos to gifs via command line: https://github.com/vvo/gifify
I'm keen to get this working on my Windows 10 machine. I'm pretty new to windows and relatively new to coding, but I was able to get a few things working, but ran into a problem.
Here is what I did:
Installed node.js + npm
Installed FFmpeg using npm
Installed ImageMagick using npm (i think i did this wrong, might have only installed the wrapper).
Downloaded giflossy. It needed to be built (?)
Installed Visual Studio 2015, tried to build it using nmake and got this error:
NMAKE : fatal error U1073: don't know how to make 'win32cfg.h'
The command I used was:
PS C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin> .\nmake -f "C:\Users\Robert's Workstation\.npm-global\node_modules\giflossy-lossy-1.82.1\src\Makefile.w32"
Would really appreciate some help with this :D

I think I f***ing did it!
I spent two hours wildly downloading binaries, googling like crazy and adding a quantum tonne of environment variables to the PATH, but I did it. Here's how:
ffmpeg: http://ffmpeg.zeranoe.com/builds/. Download the binaries, place them in your Programs folder (or anywhere), copy the path and add it to your PATH environment variable
Gifsickle with lossy. I tried to compile the source from GitHub, but both makefiles threw an error (I did not investigate that any further). Instead, I searched for an already compiled binary on the web (risky) and found: https://encode.ru/threads/2481-How-to-compile-giflossy. You need 7zip to extract the binaries, but once you've done this, place them in your Programs Folder, add the path to the binaries to your PATH environment variable and you're set.
ImageMagick with convert: https://www.imagemagick.org/script/download.php#windows
Make sure to check the following options:
This should add the ImageMagick binaries to the PATH env vars for you.
Battle any '[x] is not recognised as blah' errors with locating the binary and adding its path to the PATH env variable.
If there's only the source available and you have to compile it by yourself, search for compiled binaries online.

Related

NPM START ERROR - This is related to npm not being able to find a file

I have a problem with npm, but specifically when starting my project for a simple server using node.js.
hello network
I have a problem with npm, but specifically when starting my project for a simple server using node.js.
I tried to search in forums, videos and articles but the solutions didn't answer me.
The ERROR says that the package.json file is not in the directory, but it is - and the file contains "start" directing to the nodemon app.js command.
My directory
Error npm
Thank you very much
The error says that cmd.exe; is not found (and not, as you claim, package.json). Note the extra ; at the end which shouldn't be there.
Make sure your system's COMSPEC environment variable doesn't have this spurious semicolon at the end (if it has, remove it and restart your computer) and also that you don't have any .npmrc that overrides the shell with the bad path.

NW.js - nwbuild not opening on windows

I have an application building in Nw.js. Its almost done, but now facing an issue. While on clicking nw.exe on code (development) it is opening very fast, within in 2 seconds. But when I create a build using nwbuild -p win64 . , it is taking a lot time of time, say a minute to open and giving a feeling that app is opening itself.
The code base when built, the .exe is 21 MB size. Appreciate, if some one could help me to understand why this happens and what to make it open faster.
nwbuild is not recommended by official now, maybe try nwjs-builder-phoenix or create you own distribute script. As I remember, nwjs-builder-phoenix also not handle node_modules folder size very good.
Here is how I distribute my package:
copy NW.js binaries client to dist folder
copy my working source project into a folder named package.nw(Windows) or app.nw in nwjs.app/Contents/Resources/(MacOS)
run npm prune --production under the path you just copy your source into. https://docs.npmjs.com/cli/prune.html
using npm package plist(for MacOS) or rcedit(for Windows) to change the binaries client's information about version, nanme, author ..etc
For mac these is alot of things needs to be changed if you want to publish to appstore http://docs.nwjs.io/en/latest/For%20Users/Advanced/Support%20for%20Mac%20App%20Store/

Can anybody generate opencv.js?

I can't generate OpenCV.js using this instructions: https://docs.opencv.org/master/d4/da1/tutorial_js_setup.html
I have this error:
CMake Error: CMake was unable to find a build program corresponding to
"Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need
to select a different build tool.
When I'm trying to execute:
python ./platforms/js/build_js.py build_js
Alright, guys! You can download opencv.js from sources (press F12) of this Page: https://docs.opencv.org/master/js_face_detection_camera.html
You can find a nightly build at https://docs.opencv.org/master/opencv.js and some useful stuff at https://docs.opencv.org/master/utils.js .
<script async src="https://docs.opencv.org/master/opencv.js" type="text/javascript"></script>
I'm still not able to build it from source.
But this version of opencv.js worked for me on MacOS https://docs.opencv.org/3.4/opencv.js
I'll just list out the parts where installation was slightly different from what was outlined in https://docs.opencv.org/master/d4/da1/tutorial_js_setup.html.
For installing Binaryen, make sure you cd into the emsdk directory and then run these:
./emsdk install binaryen-master-64bit
./emsdk activate binaryen-master-64bit
From the official docs,
python ./platforms/js/build_js.py build_js
doesn't work because you need to add an additional flag --emscripten_dir to specify where the correct path. Note that you want the folder below the emsdk root directory, typically /fastcomp/emscripten/ (for the older “fastcomp” compiler; for the newer upstream LLVM wasm backend it will be /upstream/emscripten/).
I personally used the /upstream/emscripten one
So run this:
python /Users/fangran/opencv/platforms/js/build_js.py build_wasm --build_wasm --emscripten_dir /Users/fangran/emsdk/upstream/emscripten
And it should work and return:
=====
===== Build finished
=====
OpenCV.js location: /Users/fangran/opencv/build_wasm/bin/opencv.js
For more details: refer to this link
Looks like Emscripten doesn't setup the enviroment variable correctly to the SDK
For anyone trying to get this to build you need to specify the correct path to the Emscripten
which is the path where Emscripten is installed found in emsdk/upstream/emscripten
python ./platforms/js/build_js.py build_js --emscripten_dir=/home/username/Desktop/emsdk/upstream/emscripten
This should then work

Electron-builder with webpack

tl,dr:
Here's what I got:
Electron
React
Webpack
electron-builder
electron-edge
node-fibers
some static assets (.png, .svg etc.)
Here's what I want:
A crossplatform autoupdating installer for the software
The long version and the problems:
I can get Electron, React, Electron Edge, node-fibers, webpack and the static assets to run perfectly when I start the webpackserver in dev mode.
However, how can I integrate this into electron-builder?
I'm new to this whole build process and I just took this boilerplate to get started:
Github of the boilerplate
To me, the dev debug process seems to go like this:
Have webpack create a bundle.js and an index.html out of my src folder
Start a webpackserver with hot mode that serves these files
However, how should I tell electron-builder where to get the different files from? There is no package.json nor node_modules/ inside dist/ and node-fibers isn't getting bundled as well (because webpack seems to fck with __dirname or smth, so I excluded it).
Whenever I launch the generated .exe file (that's not the installer, just an exe file that's supposed to launch the program), a message appears that main.js can't be found in the app.asar file. I tried extracting it, but it fails before it gets to extract the whole package. Main.js is never needed anyway though, because that was the whole point of having webpack transpile it or am I missing something here?
I have searched all over the internet for hours now, but I don't get all the concepts ..
Could anyone here explain what's wrong with my setup and what I can do to fix that?
I recommend you to use https://github.com/chentsulin/electron-react-boilerplate
If you don't want to use boilerplate for react app, consider to use https://github.com/electron-userland/electron-webpack (but boilerplate is strongly recommended).
I ended up with this boilerplate:
https://github.com/szwacz/electron-boilerplate
I couldn't get HMR to work and had to fix some es6 stuff, but at least it's doing its job.

Chrome V8 errors

I'm trying to build the Chrome V8 javascript engine so I can embed it into my c++ project. I'm following the tutorial here. I downloaded everything that was needed and managed to get the project solution created but when I compile it only 5 of the 12 solutions get compiled correctly. Can someone shed some light on my problem? There doesn't seem to be much info on the web about it.
Some tricks I learned are this:
use the correct gyp command that will generate correct sln files. maybe target architecture argument was wrong or some other parameter you supply to gyp.
I do not know how to properly "clean" the source tree, so if I wanted new options to gyp I just delete the whole source tree and unpack from original archive. (or use svn).
Make sure you use python and cygwin supplied with v8 sources.
I used pc emulator (qemu) to install Windows XP + Visual studio and v8 sources+tools.
I tried various versions of Visual Studio only VS Express 2010 worked.
On linux everything is simpler. And you do not even need to build it, just use "aptitude install v8-dev"

Categories