#FastAPI ffmpeg issue

61 messages · Page 1 of 1 (latest)

daring pecan
#

I'm getting this error only in the railway. I have move the docker image to vultr for temporarily with 1 vcpu and 4GB memory, it's works fine. issue is I'm getting this error: failed to read the first frame of video file /user/app/utils/outputs/314828046836138453768962165010375030174.mp4. That might mean that the file is corrupted. That may also mean that you are using a deprecated version of FFMPEG. On Ubuntu/Debian for instance the version in the repos is deprecated. Please update to a recent version from the website.

thick irisBOT
#

Project ID: 0d667724-67ef-4a76-8014-e43d46da63ce

daring pecan
#

0d667724-67ef-4a76-8014-e43d46da63ce

narrow timber
#

how are you currently installing ffmpeg into your deployment

daring pecan
#

via Dockerfile : COPY ffmpeg/ffmpeg /usr/local/bin/

RUN chmod +x /usr/local/bin/ffmpeg

narrow timber
#

please send your full dockerfile

daring pecan
narrow timber
#

you are copying a local ffmpeg binary into the image, that's rarely a good idea, instead install it via apt or with whatever install method ffmpeg recommends

daring pecan
#

previously I have done that, but issue is same with that too 😦

narrow timber
#

lets go back to the correct way to install ffmpeg and work from there

daring pecan
daring pecan
#

same issue : VideoFileClip: MoviePy error: failed to read the first frame of video file /vimzy/app/utils/outputs/31299644617729035779466999651352153414.mp4. That might mean that the file is corrupted. That may also mean that you are using a deprecated version of FFMPEG. On Ubuntu/Debian for instance the version in the repos is deprecated. Please update to a recent version from the website.

narrow timber
#

okay let's see your new dockerfile

daring pecan
narrow timber
#

what version of ffmpeg does that install

daring pecan
#

it should install latest version

narrow timber
#

can you check that for me

daring pecan
#

4.2.2

narrow timber
#

cool, how did you go about getting that version

daring pecan
#

i added this line : print("ffmpeg :", moviepy.config.FFMPEG_BINARY)

narrow timber
#

what exactly did that print

daring pecan
#

/usr/local/lib/python3.10/dist-packages/imageio_ffmpeg/binaries/ffmpeg-linux64-v4.2.2

narrow timber
#

that looks like ffmpeg that a python module in trying to install, and not the ffmpeg that apt is installing, that can cause problems

#

I would recommend removing the python module that is trying to install it's own ffmpeg

daring pecan
#

okay 🙂

daring pecan
#

I have used RUN apt install -y ffmpeg and still install to the python package. issue is my local pc and vultr is working fine ( runing same docker file ) and railway is the only issue. Also I notice that My function using 30 video clips to load ( 2 - 3 seconds ) then it will give this error and if I load 5 videos it's works fine

narrow timber
#

please prevent the python module from installing ffmpeg

daring pecan
#

I have remove the python package and used /usr/bin/ffmpeg with apt install but still having the same issue 😦

narrow timber
#

what version is in use now?

daring pecan
#

I have tested it ubuntu 22.04 LTS server and works fine. I think i have to migrate for that option 😦

daring pecan
narrow timber
#

i have seen plenty of people use ffmpeg on railway without issues, after they stopped installing it via a dependency, so while that may not be the root issue, its good that we stopped doing that.

whats the current path to ffmpeg now?

daring pecan
#

/user/bin/ffmpeg

#

new path 🙂

narrow timber
#

okay great, so you said something about it working fine when you process only 5 videos?

daring pecan
#

yeah 🙂

#

it's works without the error, but when load 30 videos ( 2 - 3 seconds ) it gives the error 😦

narrow timber
#

now hearing that, it makes me think you are running into resource limitations

daring pecan
#

but I'm using it on a 4gb ram 2 cpu vps 😦

narrow timber
#

docker is completely different, a vps has hard physical limits

#

even though the metrics on railway might now tell the story I expect, can you still show me them when you try to load 30 videos?

daring pecan
narrow timber
#

oh, you're on pro

daring pecan
#

yes 🙂

narrow timber
#

hmmm, could there still be spikes up to 32gb + that are causing inconsistencies

#

or how are these 30 video files making it into your app to begin with?

daring pecan
#

they are geting download from a external source 🙂

narrow timber
#

I'm genuinely stumped

daring pecan
#

Can you report this to the railway? Thanks for the help 🙂

narrow timber
#

update for team, they are now using ffmpeg installed via apt done through their dockerfile.

daring pecan
#

Thank you for the support, I will update 🙂

narrow timber
#

thanks!

vale doveBOT
vale doveBOT
vale doveBOT
vale doveBOT
vale doveBOT
vale doveBOT
narrow timber
#

any progress?