ffmpeg | ffprobe EACCES error on nodejs production server

In my express.js server I use ffmpeg for files, on local server everything works fine but on railway when I send file I'm getting error
'spawn /app/node_modules/@ffprobe-installer/linux-x64/ffprobe EACCES',
'spawn /app/node_modules/@ffprobe-installer/linux-x64/ffprobe EACCES',
this is what error I get I've ffmpeg paths in express server written
import ffmpeg from "fluent-ffmpeg";
import ffprobe from "@ffprobe-installer/ffprobe";
import { path } from "@ffmpeg-installer/ffmpeg";

ffmpeg.setFfmpegPath(path);
ffmpeg.setFfprobePath(ffprobe.path);
import ffmpeg from "fluent-ffmpeg";
import ffprobe from "@ffprobe-installer/ffprobe";
import { path } from "@ffmpeg-installer/ffmpeg";

ffmpeg.setFfmpegPath(path);
ffmpeg.setFfprobePath(ffprobe.path);
like that but still getting issue, on stackoverflow i found solution to give ffprobe persmission
chmod +x /app/node_modules/@ffprobe-installer/linux-x64/ffprobe
chmod +x /app/node_modules/@ffprobe-installer/linux-x64/ffprobe
is it possible to do on railway?
No description
11 Replies
Percy
Percy8mo ago
Project ID: 00b1176f-3284-40c5-9b89-ff64391f880c
yaviscoke
yaviscoke8mo ago
00b1176f-3284-40c5-9b89-ff64391f880c
Brody
Brody8mo ago
dont use any kind of npm package that installs ffmpeg/ffprobe install ffmpeg natively with a nixpacks.toml file
[phases.setup]
nixPkgs = ['...', 'ffmpeg']
[phases.setup]
nixPkgs = ['...', 'ffmpeg']
(the ffmpeg nix package does come with ffprobe too)
yaviscoke
yaviscoke8mo ago
oh I'll check right now
Brody
Brody8mo ago
this means removing all npm packages that install ffmpeg/ffprobe and only using the npm package that provides an api for ffmpeg
yaviscoke
yaviscoke8mo ago
I'll have to remove all these packages as well right?
import ffmpeg from "fluent-ffmpeg";
import ffprobe from "@ffprobe-installer/ffprobe";
import { path } from "@ffmpeg-installer/ffmpeg";
import ffmpeg from "fluent-ffmpeg";
import ffprobe from "@ffprobe-installer/ffprobe";
import { path } from "@ffmpeg-installer/ffmpeg";
Brody
Brody8mo ago
fluent-ffmpeg is fine, it is just an api wrapper, the installers need to go when using fluent-ffmpeg in your code, do not specify a path for the ffmpeg or ffprobe binary's, that package should be able to find them itself
yaviscoke
yaviscoke8mo ago
it should be like that right?
No description
yaviscoke
yaviscoke8mo ago
@Brody
yaviscoke
yaviscoke8mo ago
No description
yaviscoke
yaviscoke8mo ago
i had typo issue i had to name it nixpacks.toml
Want results from more Discord servers?
Add your server
More Posts