How to add ffmpeg in railway project?
fiskyna
FREEOP

a month ago

Im deploying my music bot and hence it needs ffmpeg , how do i install it?

40 Replies

dev
MODERATOR

a month ago

if your project is being built with railpack, you can set a service variable RAILPACK_DEPLOY_APT_PACKAGES with ffmpeg listed

quick side-note: music bots are a gray area in Railway, you're fine to run one just make sure you're not hosting/serving ANY copyrighted material (which you dont have permission to) through the bot. If you get reported for it you will get banned


fiskyna
FREEOP

a month ago

what is railpack if you may explain buddy


dev
MODERATOR

a month ago

When you deploy code anywhere, its often meant to run in a specific type of environment. For example, a NodeJS application would need to run in an environment that has NodeJS, if you use npm for package managers, it requires npm to be installed in the environment.

To specify what environment the code should run in people write Dockerfiles which provide instructions on how to set up the environment the code should run in, i.e: the operating system, additional packages, file structure, etc.

The issue is few people like writing Dockerfiles, so Railway has had features that automatically build them for you. Railpack is the second iteration of that feature. Railpack looks at your project code and determines what environment it should run in and builds it automatically.

When you set that environment variable, you're telling Railpack to add ffmpeg to the environment your code runs in


fiskyna
FREEOP

a month ago

i think its production , if this is what you mean

1455231392450613200


fiskyna
FREEOP

a month ago

i do can add a new environment if thats what it all takes


dev
MODERATOR

a month ago

that type of environment is a little different. When I say environment I mean the "computer" the code runs in. The environment you're seeing there is more about the use-case of the code (production environment for the actual user facing application, staging for testing, etc). You can check if it's a Railpack managed service by going to your service settings under Builder


dev
MODERATOR

a month ago

You would see something like this

1455232049433809200


fiskyna
FREEOP

a month ago

yea its railpack btw thanks for giving youre time


dev
MODERATOR

a month ago

no worries, if it's railpack then adding the variable RAILPACK_DEPLOY_APT_PACKAGES=ffmpeg should work fine


fiskyna
FREEOP

a month ago

im sorry for another dumb question and for wasting youre time but do i click new variable and add the variable name and value?


dev
MODERATOR

a month ago

exactly


dev
MODERATOR

a month ago

name is "RAILPACKDEPLOYAPT_PACKAGES" and value is "ffmpeg"


fiskyna
FREEOP

a month ago

thanks for everything buddy , im just a kid (14yrs old) i really like coding and im damn interested in it , this is my first bot so im having some toublesome


dev
MODERATOR

a month ago

no worries at all, im happy to help


dev
MODERATOR

a month ago

heads up, my power just went out, so i'm going to have to step away for a sec, but i'll check back here once my power is back


fiskyna
FREEOP

a month ago

thx buddy and i do think its resolved now


fiskyna
FREEOP

a month ago

take care


dev
MODERATOR

a month ago

awesome, you too


fiskyna
FREEOP

a month ago

uhh when you come back i think it does have a error still

1455234251250205000
1455234251594142000


dev
MODERATOR

a month ago

did you deploy your changes?


fiskyna
FREEOP

a month ago

yup


fiskyna
FREEOP

a month ago

1455234492011909000


dev
MODERATOR

a month ago

so ffmpeg is definitely getting installed based on the logs there, i wonder why your app isnt detecting it


fiskyna
FREEOP

a month ago

wait i have redeployed it if it works ill tell ya


fiskyna
FREEOP

a month ago

it works


fiskyna
FREEOP

a month ago

thanks buddy


dev
MODERATOR

a month ago

perfect, glad i could help


fiskyna
FREEOP

a month ago

take care and since its night time here'
good night


dev
MODERATOR

a month ago

goodnight 🙂


fiskyna
FREEOP

a month ago

uh ..
my bot joins but the moment it starts playing songs it leaves the vc do you think its a problem in my code or smth but it does work fine when i run it on my vs code


fiskyna
FREEOP

a month ago

AI suggests that i should use start.sh should i?


fiskyna
FREEOP

a month ago


dev
MODERATOR

a month ago

hmmmm, that im not sure, I've never hosted a bot that needs to join vc on railway


dev
MODERATOR

a month ago

nah, unless you have a reason to


dev
MODERATOR

a month ago

like you have some sort of hugely complex startup command or something


fiskyna
FREEOP

a month ago

Any suggestions what I should do?


dev
MODERATOR

a month ago

I'd add as many debug logs as humanly possible to find out why its leaving vc, surely discord sends an error as to why it disconnected


fiskyna
FREEOP

a month ago

Thx I'll do that and I'll try to understand the error


dev
MODERATOR

a month ago

good luck!!!!


fiskyna
FREEOP

a month ago

Hope so


Loading...