3 months ago
Im deploying my music bot and hence it needs ffmpeg , how do i install it?
40 Replies
3 months 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
3 months 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
3 months 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
3 months ago
You would see something like this

3 months ago
no worries, if it's railpack then adding the variable RAILPACK_DEPLOY_APT_PACKAGES=ffmpeg should work fine
im sorry for another dumb question and for wasting youre time but do i click new variable and add the variable name and value?
3 months ago
exactly
3 months ago
name is "RAILPACKDEPLOYAPT_PACKAGES" and value is "ffmpeg"
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
3 months ago
no worries at all, im happy to help
3 months 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
3 months ago
awesome, you too
3 months ago
did you deploy your changes?
3 months ago
so ffmpeg is definitely getting installed based on the logs there, i wonder why your app isnt detecting it
3 months ago
perfect, glad i could help
3 months ago
goodnight 🙂
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
AI suggests that i should use start.sh should i?
3 months ago
hmmmm, that im not sure, I've never hosted a bot that needs to join vc on railway
3 months ago
nah, unless you have a reason to
3 months ago
like you have some sort of hugely complex startup command or something
3 months 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
3 months ago
good luck!!!!



