tnfe / FFCreator

A fast video processing library based on node.js (一个基于node.js的高速视频制作库)
http://tnfe.github.io/FFCreator/
MIT License
2.82k stars 398 forks source link

应该以什么方式来运行 ffcreator #154

Open hjane opened 2 years ago

hjane commented 2 years ago

我是前端,对线程等理解不深。 目前使用egg框架开发后台,在准备部署项目的时候出现了问题。因为ffcreator用到了headless-gl,需要增加一个显示设备给headless-gl做输出绑定,开发模式下xvfb-run -s "-ac -screen 0 1280x1024x24" npm run dev 这样运行可以正常运行。 但是egg开发部署的时候发现没有办法后台运行,我想求助各位大佬,你们在生产环境部署的时候是怎么做的,或者你们以什么方式来运行ffcreator?

============这样可以运行======= xvfb-run -s "-ac -screen 0 1280x1024x24" yarn start yarn run v1.22.15 $ egg-scripts start --port=7001 --env=prod --title=egg-server-zhipianxing

===========加上--daemon 就会报错 ======== xvfb-run -s "-ac -screen 0 1280x1024x24" yarn start yarn run v1.22.15 $ egg-scripts start --port=7001 --daemon --env=prod --title=egg-server-zhipianxing

============错误信息=============== 2021-11-28 18:43:02,884 ERROR 7139 nodejs.TypeError: Cannot read property 'ARRAY_BUFFER' of null at FFTransition.createBuffer (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/ffcreator/lib/animate/transition.js:73:45) at FFTransition.createTransition (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/ffcreator/lib/animate/transition.js:61:10) at FFTransition.bindGL (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/ffcreator/lib/animate/transition.js:40:10) at /www/wwwroot/zhipianxing/zhipianxing-node/node_modules/ffcreator/lib/core/renderer.js:119:57 at arrayEach (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/lodash/_arrayEach.js:15:9) at forEach (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/lodash/forEach.js:38:10) at Renderer.transBindGL (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/ffcreator/lib/core/renderer.js:119:5) at Renderer.start (/www/wwwroot/zhipianxing/zhipianxing-node/node_modules/ffcreator/lib/core/renderer.js:55:10)

fantasticsoul commented 2 years ago

试试 egg-scripts start --port=7001 --daemon --env=prod --title=egg-server-zhipianxing 2>&1 & 重定向到标准输出呢,

或者参考这个 https://www.thinbug.com/q/50634819

javaswing commented 2 years ago

我是以docker方式进行运行的,对应的Dockerfile如下:

WORKDIR /app

COPY package*.json /app/package*.json

RUN npm config set registry=https://registry.npm.taobao.org/ \ 
&& npm install 

ADD . /app
RUN npm run build

EXPOSE 80

ENTRYPOINT [ "/bin/sh" ]

CMD ["./bin/deploy.sh"]

上面少了一个 FROM源,可参考这镜像源:https://github.com/jrottenberg/ffmpeg

wanghaisheng commented 2 years ago

@javaswing 这么部署以后 调用端是杂操作的 求教

hjane commented 2 years ago

这是来自QQ邮箱的自动回复邮件。您好,您的邮件已经收到,我会在一周内尽快给您回复!

javaswing commented 2 years ago

调用端?我没有太理解你的意思