Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run program "/tmp/jave/ffmpeg-amd64-3.2.0" #236

Open
boyangc opened this issue Jul 12, 2023 · 6 comments
Open

Cannot run program "/tmp/jave/ffmpeg-amd64-3.2.0" #236

boyangc opened this issue Jul 12, 2023 · 6 comments

Comments

@boyangc
Copy link

boyangc commented Jul 12, 2023

We deploy on linux.This error occurs :
java.io.IOException: Cannot run program "/tmp/jave/ffmpeg-amd64-3.2.0": error=13, 权限不够 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at java.lang.Runtime.exec(Runtime.java:593) at java.lang.Runtime.exec(Runtime.java:458) at ws.schild.jave.process.ProcessWrapper.execute(ProcessWrapper.java:103) at ws.schild.jave.process.ProcessWrapper.execute(ProcessWrapper.java:135) at com.alipay.zark.avatar.service.FileUploadServer.ffmpegExecut(FileUploadServer.java:464) at com.alipay.zark.avatar.service.FileUploadServer.generateBackgroundImage(FileUploadServer.java:686) at com.alipay.zark.avatar.service.FileUploadServer.afterProcess(FileUploadServer.java:340) at com.alipay.zark.avatar.service.FileUploadServer.onMessage(FileUploadServer.java:130) at org.java_websocket.server.WebSocketServer.onWebsocketMessage(WebSocketServer.java:703) at org.java_websocket.drafts.Draft_6455.processFrameText(Draft_6455.java:963) at org.java_websocket.drafts.Draft_6455.processFrame(Draft_6455.java:887) at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:401) at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:233) at org.java_websocket.server.WebSocketServer$WebSocketWorker.doDecode(WebSocketServer.java:1096) at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:1077) Caused by: java.io.IOException: error=13, 权限不够 at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.<init>(UNIXProcess.java:247) at java.lang.ProcessImpl.start(ProcessImpl.java:134) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)

@a-schild
Copy link
Owner

Is that file existing in /tmp/jave/ folder?
Is it executable by the user which the server is running under?

@boyangc
Copy link
Author

boyangc commented Jul 12, 2023

file exists in /tmp/jave/ folder, but i cant run it throw cmd , it shows Insufficient Permissions

@boyangc
Copy link
Author

boyangc commented Jul 12, 2023

Is that file existing in /tmp/jave/ folder? Is it executable by the user which the server is running under?

and i have chown 777 , but it not works

@a-schild
Copy link
Owner

Then you have to look at your server envrionemnt,
Perhaps some SELINUX settings or similar blocking the executable

@boyangc
Copy link
Author

boyangc commented Jul 13, 2023

Then you have to look at your server envrionemnt, Perhaps some SELINUX settings or similar blocking the executable

i find that it fails in /tmp/ directory, but when i copied ffmpeg-amd54-3.2.0 to /data/ directory , it is executable.
So how do I specify the location where the ffmpeg file is generated or the location my program call when use ffmpeg in the system? I didn't do anything at the beginning, it was to automatically generate ffmpeg in /tmp/ directory

@a-schild
Copy link
Owner

a-schild commented Jul 13, 2023

Jave uses the system temp location

https://github.com/a-schild/jave2/blob/master/jave-core/src/main/java/ws/schild/jave/process/ffmpeg/DefaultFFMPEGLocator.java

Line 57
File dirFolder = new File(System.getProperty("java.io.tmpdir"), "jave/");

So you can either set another temp location in the properties of the JVM, or implement you own ProcessLocator class, which point's to the location you desire.
If you wish to use a "static" ffmpeg version, you can put it in a known place and then implement the ProcessLocatorfor your environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants