editly
editly copied to clipboard
Error: gl returned null (missing dependencies)
While attempting to run the "kenBurns" example in a Debian docker image (using a node:14-stretch base image) I get the following error:
640x640 25fps
Error: gl returned null, this probably means that some dependencies are not installed. See README.
at module.exports (/usr/local/lib/node_modules/editly/glTransitions.js:12:11)
at module.exports (/usr/local/lib/node_modules/editly/index.js:265:36)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async /usr/local/lib/node_modules/editly/cli.js:124:3
For reference, here's the Dockerfile I'm using:
FROM node:14-stretch
RUN apt-get -qq update \
&& apt-get -qq install \
build-essential \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
libxi-dev \
libglu1-mesa-dev \
libglew-dev \
pkg-config \
python2.7 \
python-pip \
ffmpeg
RUN mkdir -p /opt/node \
&& cd /opt/node \
&& npm install --global --unsafe-perm editly
maybe you need xvfb
No change after installing that package, still seeing the same error
https://github.com/thewtex/docker-opengl/blob/master/Dockerfile https://github.com/jamesbrink/docker-opengl#docker-images https://hub.docker.com/r/jamesbrink/opengl/dockerfile
it looks like a minimal install might be a little bit complicated
Looks like any sort of docker install might be complicated! 😛
If you find a way to do it, then it would be nice if u put together a list of working instructions (or a link), then we can put it in the readme 👍
Merely installing xvfb just... installs it. However it is not running. I've used the instructions found here
xvfb-run -s "-ac -screen 0 1280x1024x24" <node program>
Using that command results in e.g. xvfb-run -s "-ac -screen 0 1280x1024x24" editly --json kenBurns.json5 which now complains about assets not found.
BTW I find it unfortunate that there are no sample assets. Makes it harder to play around with it.
@Stefan-Hanke great find, that command prefix does the trick! I'll submit a PR with the dockerfile and instructions in the readme. If we could get those assets in this repo then the examples could just work (tm) out of the box...
Good job!
I don't want to include the sample assets in this repository because they are quite huge and I don't want everyone who downloads the repo to have to download hundreds of megabytes. But I'm thinking about putting them in a separate github repo and then having a download script from here.
I'm thinking about putting them in a separate github repo and then having a download script from here Yes please!
I did get further along with this Docker File...But now its failing when FFMPEG tries to write out to the temp dir- Hope this helps someone
FROM node:14.7
# FROM nikolaik/python-nodejs:latest
RUN apt-get update && apt-get install -y \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
libxi-dev \
libglu1-mesa-dev \
libglew-dev \
python2.7 \
python-pip \
ffmpeg \
xvfb
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# #
# ## Install app dependencies
COPY package.json /usr/src/app/
RUN npm install
ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 /usr/bin/dumb-init
RUN chmod 0777 /usr/bin/dumb-init
# Bundle app source
COPY . /usr/src/app
ENTRYPOINT ["/usr/bin/dumb-init", "--", "xvfb-run", "-s", "-ac -screen 0 1280x1024x24"]
CMD [ "node", "source/startup.js" ]
@MDrooker your configuration works for me just fine
Yea...Mine is still tossing errors on creating the asset.
Using xvfb-run -s '-screen 0 1024x768x24 -ac +extension GLX +render -noreset' node index.js fails with an out of memory error if the video is 720P in width.
640x640 25fps
(node:19147) UnhandledPromiseRejectionWarning: Error: gl returned null, this probably means that some dependencies are not installed. See README.
at module.exports (/home/ubuntu/backend/node_modules/editly/glTransitions.js:12:11)
at module.exports (/home/ubuntu/backend/node_modules/editly/index.js:347:36)
(node:19147) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:19147) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I am also struglling this issue in ubuntu 18
@dinesh-rawat You have to install all the linux dependencies.
@srameshr Can you please redirect me to some helpful article? Finding no solution for this anywhere
https://github.com/mifi/editly/issues/72#issuecomment-698242279
For MacOS that is all I did,
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
@srameshr Most of the packages you shared are not found for ubuntu 18.
I tried to debug it a little bit and found:
https://github.com/mifi/editly/blob/master/glTransitions.js#L9
is not returning anything.
@dinesh-rawat I run on a mac and all you need is ffmpeg and ffprobe. For linux you need more dependencies.
I tried to debug it a little bit and found:
https://github.com/mifi/editly/blob/master/glTransitions.js#L9
is not returning anything.
I'm trying to run on my mac, same issue
gl returned null, this probably means that some dependencies are not installed.
which node.js version are you running? and macos version. See https://github.com/stackgl/headless-gl#supported-platforms-and-nodejs-versions
Node.js v12.13.0 macOS Mojave 10.14.4
same problem with newest node.js 12?
yes..
armando$ editly --fast kenBurns.json5 ffmpeg version 4.3.1 ffprobe version 4.3.1 250x250 15fps Caught error Error: gl returned null, this probably means that some dependencies are not installed. See README. at module.exports (/usr/local/lib/node_modules/editly/glTransitions.js:12:11) at Editly (/usr/local/lib/node_modules/editly/index.js:170:60) at async /usr/local/lib/node_modules/editly/cli.js:133:3
which node version are you running now?
12.13.0
that is not the newest version...
I'm running node v15.2.0, throw an error:
`node:internal/modules/cjs/loader:1161 return process.dlopen(module, path.toNamespacedPath(filename)); ^
Error: The module '/usr/local/lib/node_modules/editly/node_modules/canvas/build/Release/canvas.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 72. This version of Node.js requires NODE_MODULE_VERSION 88. Please try re-compiling or re-installing`
google can help you with this
Got this working in Docker thanks to @maerics @chapmanjacobd @MDrooker, thanks all! See #96 (I'm 100% sure it can be improved after [or before?] merge 🎉 )
EDIT: just confirmed gl shaders work.
Anyone solved this on Heroku? I tried running the following command on Heroku CLI and also tried to install xvfb but commands are not found.
xvfb-run -s "-ac -screen 0 1280x1024x24" <node program>
Also, I this same issue occurs on any other ffmpeg library I tested so far. Only way to bypass this AFAIK on Heroku was to execute the original ffmpeg shell script on runtime using child_process.
exec("ffmpeg -safe 0 -f concat -protocol_whitelist file,https,tls,tcp -i ${urlListPath} -c copy ${outPath}")
@monurcevik try this version of ffmpeg built with the flags in the upstream docker container (it's managed by core ffmpeg team):
https://github.com/mifi/editly/blob/0bfed321e0c659e9c5ce1db1fd1cb8becf5e71d6/Dockerfile#L1
@patcon Thanks. However, I'm not using Docker at the moment. Do you know a workaround on Heroku without using Docker? Or is it mandatory?
I'm not sure "mandatory" is the right word, but it was mandatory for me :)
You might get better feedback by opening a new ticket, as Heroku support is perhaps a new thing with different requirements and context. As in, I have no idea whether you wrote your own buildpack or used existing ones, but it doesn't feel like this is the place to share that (11 ppl are getting notifications about each comment, after all)
Hi! I'm trying to install on Ubuntu 18.04 node v12.18.2
and I receive the error:
Caught error Error: gl returned null, this probably means that some dependencies are not installed. See README. at module.exports (/usr/lib/node_modules/editly/glTransitions.js:12:11) at Editly (/usr/lib/node_modules/editly/index.js:172:60) at async /usr/lib/node_modules/editly/cli.js:136:3
can I solve without using docker? thanks!!
ffmpeg is probably one of the more important version numbers to share :)
In case dockerfiles aren't easy for ppl to read, this is the summary:
- ubuntu 18.04
- ffmpeg 4.3.1 (supplied by this upstream dockefile used in compilation, mostly bash RUN commands, but very long)
- node 14.4.0
building ffmpeg with the same flags is probably where gotchas are. The pre-built ones in the package repos may or may not use all the same flags.
Hi @patcon I updated the versions:
- ffmpeg version 4.3.1
- node v14.15.2
and throws the same error :(
Sorry, not sure then! You might want to clarify (for future travellers) if you built with all the same flags from the dockerfile I linked, so ppl will know which approach you've exhausted
@Stefan-Hanke solution works for me https://github.com/mifi/editly/issues/33#issuecomment-622289045
If I run xvfb-run editly --json kenBurns.json5 the video is created. What's the downside of this technique? I need to run from node, can I use this lib for that https://www.npmjs.com/package/xvfb ?
thanks! Armando
Ah yes, the xvfb-run bit was 100% part of my dockerfile as well. Sorry if that wasn't clear before
Also receiving this issue on Ubuntu: 18.04 node: 15.8 ffmpeg: 9f38fac053010205806ece11e6aea9b7d3bde041 built using the static build: https://www.johnvansickle.com/ffmpeg/faq/
@Stefan-Hanke solution also worked for me but running from node is throwing the 'gl returned null (missing dependencies)' error
macOS: BigSur 11.4 nodejs: v12.14.1 ffmpeg: 4.4 python: 3.9
$ editly --fast mosaic.json5 ffmpeg version 4.4 WARNING: ffmpeg issue: Invalid Version: 4.4 ffprobe version 4.4 WARNING: ffprobe issue: Invalid Version: 4.4 250x250 15fps Caught error Error: gl returned null, this probably means that some dependencies are not installed. See README. at module.exports (/usr/local/lib/node_modules/editly/glTransitions.js:12:11) at Editly (/usr/local/lib/node_modules/editly/index.js:172:60) at async /usr/local/lib/node_modules/editly/cli.js:136:3
I'm also having this issue trying to dockerize an API that uses editly. The error is:
Error: gl returned null, this probably means that some dependencies are not installed. See README.
at module.exports (/usr/src/app/node_modules/editly/glTransitions.js:12:11)
at Editly (/usr/src/app/node_modules/editly/index.js:172:60)
The Dockerfile is:
FROM node:14
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
COPY tsconfig.json ./
# Necessary to run editly and node-gyp
RUN apt-get update && apt-get install -y \
ffmpeg \
build-essential \
libxi-dev \
libglu1-mesa-dev \
libglew-dev \
pkg-config \
xvfb \
RUN npm install
# If you are building your code for production
# RUN npm ci --only=production
# Bundle app source
COPY . .
EXPOSE 8080
CMD [ "npm", "start" ]
For me, these dockerfile RUN commands along with --server-num=1 CMD command seemed to fix things. I'm running this container inside AWS Lambda Functions! Also make sure in your .env you have DISPLAY=1. I had canvas installed elsewhere outside editly so I had to remove it from editly's node_modules folder:
FROM jrottenberg/ffmpeg:4.3.1-ubuntu1804
# Do my app specific build stuff...
# Source: https://gist.github.com/remarkablemark/aacf14c29b3f01d6900d13137b21db3a
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
ENV CANVAS_RELEASE=${LAMBDA_TASK_ROOT}/node_modules/canvas/build/Release
RUN cd ${CANVAS_RELEASE} && rm libfribidi.so.0 libpango-1.0.so.0 libpangoft2-1.0.so.0
RUN apt-get update && apt-get -y --force-yes install x-window-system \
&& rm -rf /var/lib/apt/lists/*
RUN rm -rf ${LAMBDA_TASK_ROOT}/node_modules/editly/node_modules/canvas
ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_x86_64 /usr/bin/dumb-init
RUN chmod 0777 /usr/bin/dumb-init
EXPOSE 8080
ENTRYPOINT ["/usr/bin/dumb-init", "--" ]
CMD [ "xvfb-run", "-a" , "--server-num=1", "-s", "-ac -screen 0 1920x1080x24 -noreset", "/usr/bin/npx", "/var/task/node_modules/aws-lambda-ric/bin/index.js", "/var/task/server/server.handler"]
I got the same issue when trying to run editly on an Ubuntu github action runner I fixed it by installing those dependencies first :
sudo apt-get install -y build-essential libxi-dev libglu1-mesa-dev libglew-dev pkg-config
sudo apt-get install -y python-is-python3
sudo add-apt-repository ppa:savoury1/ffmpeg4
sudo add-apt-repository ppa:savoury1/graphics
sudo add-apt-repository ppa:savoury1/multimedia
sudo apt-get install -y ffmpeg
sudo apt-get install -y xvfb
sudo apt full-upgrade
Then running my node command with xvfb :
xvfb-run -s "-ac -screen 0 1280x1024x24" node src/main.js
Hope it helps 🙂
This is very important when I use ubuntu with desktop it works fine.
It works with screen -S xxx in desktop.
xvfb-run -s "-ac -screen 0 1280x1024x24" node src/main.js
It works in terminal without desktop well.