N8N with FFMPEG
olitroli
FREEOP

9 months ago

im reffering to this thread: https://discord.com/channels/713503345364697088/1382322356814614628

Hey, I've been using Railway for a few months now, but I'm not quite sure how to install FFMPEG. Are there any new solutions? From what I've seen in the documentation, it seems that you just need to add a environment Variable. What's the best and quickest way to do this now, for someone who vibecodes a lot but doesn't deal much with the code itself? Is it safe? Will I not lose my data from N8n? Because I want to add FFmpeg to N8n. Thank you and best regards!

Solved

152 Replies

olitroli
FREEOP

9 months ago

I've seen @Medim made video on how to do it but i need to know if my n8n won't get demaged


9 months ago

continuing from #🎤|chit-chat

RAILPACK_PACKAGES=ffmpeg

is probs your best bet if youre using railpack

how do you know if youre using railpack?

go to your service settings, then scroll down to the build section, if the build section is empty or the builder is nixpacks then you're not using railpack, otherwise if it says railpack is the builder then youre using railpack

if youre using nixpacks then you should stop using nixpacks

and if the build section is empty then youre deploying from an image registry, in which case installing ffmpeg will be a lot more difficult


olitroli
FREEOP

9 months ago

I suppose im on the railpack, thats cool, so i need to edit only variable to install ffmpeg

1423959976749301953

1423959977172930632


olitroli
FREEOP

9 months ago

nooo im using the image registry, how to move it to railpack without losing my n8n instance?


9 months ago

no, it seems youre deploying from an image registry


9 months ago

you cant move to railpack


9 months ago

you'll need to edit the start command to install ffmpeg


olitroli
FREEOP

9 months ago

When i was installing n8n i just press few buttons and click deploy and thats all, sorry for being little slow


9 months ago

its okay


9 months ago

apt update && apt install ffmpeg && n8n start

maybe try this for the start command


olitroli
FREEOP

9 months ago

Will my n8n be safe? Im affraid i can loose some of the workflows, eventhough i made a backup but it still can be very painfull


9 months ago

assuming the template you deployed is set up correctly, it shouldnt cause data loss


9 months ago

^^^ this is very dependent on whether the template you deployed is correctly built


olitroli
FREEOP

9 months ago

Should i use this command in the worker section or on the other one?


9 months ago

or actually set your start command to this instead:

apt update && apt install -y ffmpeg && n8n start

just in case apt install has any prompts


9 months ago

the n8n one, not the worker


olitroli
FREEOP

9 months ago

ok cool


9 months ago

if the worker needs it too then you might need to add the apt update && apt install -y ffmpeg && part to that one as well but lets see


9 months ago

maybe its not necassery


olitroli
FREEOP

9 months ago

so i just do this and it should work?

1423961406222499891


9 months ago

yup that looks good


9 months ago

lets hope it works


olitroli
FREEOP

9 months ago

okay i deplyed


olitroli
FREEOP

9 months ago

and it flopped after 7 sec


9 months ago

if it doesnt work then its going to be a real pain installing ffmpeg


9 months ago

can you tell what error you got?


olitroli
FREEOP

9 months ago

1423961833932460132


9 months ago

i had a feeling


9 months ago

<:imgPepeCry:1203771089117904916>


olitroli
FREEOP

9 months ago

damn


olitroli
FREEOP

9 months ago

🙏


9 months ago

okay lets try apk instead of apt


9 months ago

and if apk isnt there either then we'll just need to use curl


9 months ago

try this command

apk add --no-cache ffmpeg && n8n start

olitroli
FREEOP

9 months ago

ok, deployed, now waiting


olitroli
FREEOP

9 months ago

it is deploying for 60 sec right now, maybe it would work


9 months ago

yea hopefully


9 months ago

i guess n8n is alpine based


olitroli
FREEOP

9 months ago

idk what does it even means tbh, but i hope it will work


olitroli
FREEOP

9 months ago

1423962971574636584


9 months ago

ooh nice


9 months ago

so far so good


olitroli
FREEOP

9 months ago

yup already 3+ mins and not a single error in sight, i might just chill and hope for the best


olitroli
FREEOP

9 months ago

1423963555706834965


olitroli
FREEOP

9 months ago

ouch


olitroli
FREEOP

9 months ago

failed


9 months ago

<:PurgatoryDepressed:1134368817879994442>


9 months ago

alr my assumption is that it installed ffmpeg but never moved onto n8n start for some reason


olitroli
FREEOP

9 months ago

damn just let me use ffmpeg node to connect videos 🙏


olitroli
FREEOP

9 months ago

so whats right now chief?


olitroli
FREEOP

9 months ago

Thanks btw for helping, you are saving my life rn


9 months ago

no worries


9 months ago

I can't figure why n8n start wouldnt run after


9 months ago

maybe I should make an n8n template that has ffmpeg and a bunch of other stuff preinstalled


9 months ago

anyway, let's try one last thing

try setting the start command like so:

/bin/sh -c "apk add --no-cache ffmpeg && n8n start"

olitroli
FREEOP

9 months ago

okay, now we wait

1423964682217197629


olitroli
FREEOP

9 months ago


9 months ago

good to know


olitroli
FREEOP

9 months ago

1423965897361723452


olitroli
FREEOP

9 months ago

ehh...


olitroli
FREEOP

9 months ago

no good news


9 months ago

<:pepeEyeRoll:763297232207216640>


9 months ago

what the sigma


9 months ago

can you check the logs and tell me what you see


9 months ago

deploy logs specifically


olitroli
FREEOP

9 months ago

1423966973393371157


9 months ago

HMMMM okay that makes sense


9 months ago

in your service variables, try adding RAILWAY_RUN_UID=0, just a shot in the dark


9 months ago

and if this doesnt work we can just try via curl


9 months ago

and if that doesnt work then im out of ideas


olitroli
FREEOP

9 months ago

1423967619702067231


olitroli
FREEOP

9 months ago

liker this?


9 months ago

yup, perfect


olitroli
FREEOP

9 months ago

and now deploy yes?


9 months ago

yea click "Add" and then "Deploy"


olitroli
FREEOP

9 months ago

love the energy


olitroli
FREEOP

9 months ago

1423967905879691325


olitroli
FREEOP

9 months ago

lets see


olitroli
FREEOP

9 months ago

i see that the n8n got updated


olitroli
FREEOP

9 months ago

now lets check ffmpg


olitroli
FREEOP

9 months ago

everything is left as it was when looking at the workflows


9 months ago

that's good to know


olitroli
FREEOP

9 months ago

if i did everything right the ffmpeg is not installed

1423969677390119054


9 months ago

<:whatthefuck:1309293173927055410>


9 months ago

whar


9 months ago

how is that even remotely possible


9 months ago

we literally installed ffmpeg


olitroli
FREEOP

9 months ago

maybe i should try to redeploy


9 months ago

nah that isnt the issue


9 months ago

can you check logs again?


9 months ago

the issue is if the install failed then the deployment shouldve failed


9 months ago

unless it failed but with a success exit code


9 months ago

or && doesnt work the way I think it does


9 months ago

okay actually let me just deploy the template myself


olitroli
FREEOP

9 months ago

1423970524832202836


olitroli
FREEOP

9 months ago

1423970795507417119

1423970795947823227


9 months ago

yea the logs shows that ffmpeg was installed succesfully


olitroli
FREEOP

9 months ago

i see that there is something ffmpeg related, maybe im doing something wronhg


9 months ago

yea I just followed the steps you took and ffmpeg is definitely present in the container

1423971330604138536


olitroli
FREEOP

9 months ago

damn so something is wrong i guees


olitroli
FREEOP

9 months ago

maybe something is wrong here

1423971851687956641


olitroli
FREEOP

9 months ago

maybe i pasted something wrong


9 months ago

nah its all good


9 months ago

<:PepeThink:585531518701797401>


9 months ago

the only possibility I can think of is that n8n only checks for binaries in specific locations but that wouldn't make any sense tbh


9 months ago

can you try /usr/bin/ffmpeg --version instead of ffmpeg --version


olitroli
FREEOP

9 months ago

maybe i should try it the other way, maybe the same way that was mentioned above


9 months ago

the RAILPACK_PACKAGES method ?


olitroli
FREEOP

9 months ago

okay



olitroli
FREEOP

9 months ago

this method


olitroli
FREEOP

9 months ago

Still not found

1423973108053835857


9 months ago

oh i see what he does


9 months ago

OOH you know what


9 months ago

it's probably trying to find ffmpeg in the worker


9 months ago

okay nah that's easy fix


9 months ago

just add the RAILWAY_RUN_UID=0 variable to the worker and set the worker's start command as

/bin/sh -c "apk add --no-cache ffmpeg && n8n worker"

9 months ago

I'm 10 billion percent sure this will work


olitroli
FREEOP

9 months ago

okay give me a sec


olitroli
FREEOP

9 months ago

witch one i should choose?

1423973721592303647


9 months ago

neither


9 months ago

just add 0 on the value side


olitroli
FREEOP

9 months ago

okay


olitroli
FREEOP

9 months ago

succes

1423974138376360035


9 months ago

nice!


olitroli
FREEOP

9 months ago

1423974221922701344


olitroli
FREEOP

9 months ago

god bless!


olitroli
FREEOP

9 months ago

that works!


9 months ago

NICE!!!


olitroli
FREEOP

9 months ago

AND COMPLETELY NO DATA LOSS


9 months ago

sorry for taking so long with the solution, i just dont know the workflow of n8n


olitroli
FREEOP

9 months ago

no problem, love the work


olitroli
FREEOP

9 months ago

i want to return the fawor


olitroli
FREEOP

9 months ago

you have Paypal or crypto account by any chance?


olitroli
FREEOP

9 months ago

or maybe revolut, that would be the best option i think


9 months ago

Ahww thank you, I do have a paypal at paypal.me/FragsPaypal or buy me a coffee at


9 months ago

you dont have to though, im happy to help either way


olitroli
FREEOP

9 months ago

Oh no way you r from africa! cheers brother, my dad is from ghana! I live in poland but love to see the homeland!


9 months ago

that's awesome! love it when I see a fellow african on discord; rare seeing other africans ngl 😔


olitroli
FREEOP

9 months ago

I live in poland unfortunetely there is not much africans eaither hah


9 months ago

oh makes sense yea


olitroli
FREEOP

9 months ago

thank you for the help, "coffe" should reached you at,


olitroli
FREEOP

9 months ago

didnt use paypal becouse fee for sending 5$ is 5$ hahah


9 months ago

thanks a ton 🙏 i really appreciate it


9 months ago

wow, that is definitely not worth it 😭


9 months ago

thank you


olitroli
FREEOP

9 months ago

the pleasure is mine


9 months ago

Hey! just saw this thread, gonna link this for future reference: https://github.com/kadumedim/n8n-ffmpeg

You can just swap service images, you won’t lose your saved workflows.


9 months ago

Fork the repo and change your service image 😉


9 months ago

!s


Status changed to Solved medim 9 months ago


9 months ago

bro stole my kill


9 months ago

<:pepeEyeRoll:763297232207216640>


Welcome!

Sign in to your Railway account to join the conversation.

Loading...