transitive-bullshit / ffmpeg-concat

Concats a list of videos together using ffmpeg with sexy OpenGL transitions.
891 stars 116 forks source link

concat error Error: failed to create OpenGL context #36

Closed liule-pi closed 5 years ago

liule-pi commented 5 years ago

I run ffmpeg-concat in a centos sever, Here is the output

[root@A01-R04-I220-60 media]# Xvfb :99 & [1] 39027 [root@A01-R04-I220-60 media]# export DISPLAY=:99 [root@A01-R04-I220-60 media]# echo $DISPLAY :99 [root@A01-R04-I220-60 media]# ffmpeg-concat 1.mp4 2.mp4 -o test.mp4 { cmd: 'ffmpeg -i 2.mp4 -y -pix_fmt rgba -start_number 0 /tmp/d99b3ba34f3962a5fcef521e48c8f094/scene-1-%012d.raw' } { cmd: 'ffmpeg -i 1.mp4 -y -pix_fmt rgba -start_number 0 /tmp/d99b3ba34f3962a5fcef521e48c8f094/scene-0-%012d.raw' } init-frames: 675.932ms ffmpeg-concat: 729.122ms concat error Error: failed to create OpenGL context at module.exports (/usr/lib/node_modules/ffmpeg-concat/lib/context.js:22:11) at module.exports (/usr/lib/node_modules/ffmpeg-concat/lib/render-frames.js:19:21) at module.exports (/usr/lib/node_modules/ffmpeg-concat/lib/index.js:47:32) (node:51795) UnhandledPromiseRejectionWarning: Error: failed to create OpenGL context at module.exports (/usr/lib/node_modules/ffmpeg-concat/lib/context.js:22:11) at module.exports (/usr/lib/node_modules/ffmpeg-concat/lib/render-frames.js:19:21) at module.exports (/usr/lib/node_modules/ffmpeg-concat/lib/index.js:47:32) (node:51795) 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: 2) (node:51795) [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.

jmaslanka commented 5 years ago

https://www.npmjs.com/package/gl#how-can-headless-gl-be-used-on-a-headless-linux-machine

liule-pi commented 5 years ago

I try xvfb-run -s "-ac -screen 0 1280x1024x24" glxinfo and got some error: Xlib: extension "GLX" missing on display ":99". Error: couldn't find RGB GLX visual or fbconfig

it looks like something to do with nvidia drive, https://github.com/openai/gym/issues/366

edit: after removed nvidia drive, cuda and all libGL.so installed by nvidia, everything is ok now.

DanisHack commented 4 years ago

@transitive-bullshit Can you please help. I am getting the error Ubuntu docker container. I am able to run everything successfully on mac but not able to run on ec2 instance with a dockerized node app.

transitive-bullshit commented 4 years ago

Read the existing issues and docs on using xvfb.

mdjamiruddin0647 commented 3 years ago

I am also getting the same issue while using Node JS ffmpeg-concat module

Failed to create OpenGL context. Please see https://github.com/stackgl/headless-gl#supported-platforms-and-nodejs-versions for compatibility. ffmpeg-concat: 1977.991ms UnhandledPromiseRejectionWarning: Error: failed to create OpenGL context

It would be appreciable if anyone can help me.

wavecommander commented 3 years ago

@DanisHack @mdjamiruddin0647 Make sure you have the dependencies required for headless-gl apt install -y ffmpeg curl build-essential python3 python3-dev python python-dev libx11-dev libxext-dev libxext6 xvfb libxi-dev libglew2.1 libglew-dev pkg-config (I think that's all of them).

When you want to run ffmpeg-concat <videos> you have to prepend the command with xvfb, like this xvfb-run -s "-ac -screen 0 1920x1080x24" ffmpeg-concat -t crosswarp -d 1250 video1.mp4 video2.mp4

mdelnegro-lennd commented 1 year ago

@wavecommander I am running an alpine nodejs container and tried the command prepend and it does not work either.