FastAPI ffmpeg issue
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.
46 Replies
Project ID:
0d667724-67ef-4a76-8014-e43d46da63ce
0d667724-67ef-4a76-8014-e43d46da63ce
how are you currently installing ffmpeg into your deployment
via Dockerfile : COPY ffmpeg/ffmpeg /usr/local/bin/
RUN chmod +x /usr/local/bin/ffmpeg
please send your full dockerfile
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
previously I have done that, but issue is same with that too 😦
lets go back to the correct way to install ffmpeg and work from there
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.
okay let's see your new dockerfile
what version of ffmpeg does that install
it should install latest version
can you check that for me
4.2.2
cool, how did you go about getting that version
i added this line : print("ffmpeg :", moviepy.config.FFMPEG_BINARY)
what exactly did that print
/usr/local/lib/python3.10/dist-packages/imageio_ffmpeg/binaries/ffmpeg-linux64-v4.2.2
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
okay 🙂
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
please prevent the python module from installing ffmpeg
I have remove the python package and used /usr/bin/ffmpeg with apt install but still having the same issue 😦
what version is in use now?
I have tested it ubuntu 22.04 LTS server and works fine. I think i have to migrate for that option 😦
4.2.2 🙂
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?
/user/bin/ffmpeg
new path 🙂
okay great, so you said something about it working fine when you process only 5 videos?
yeah 🙂
it's works without the error, but when load 30 videos ( 2 - 3 seconds ) it gives the error 😦
now hearing that, it makes me think you are running into resource limitations
but I'm using it on a 4gb ram 2 cpu vps 😦
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?
oh, you're on pro
yes 🙂
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?
they are geting download from a external source 🙂
I'm genuinely stumped
Can you report this to the railway? Thanks for the help 🙂
i will mark this thread as private -> https://help.railway.app/questions/fast-api-ffmpeg-issue-fd7ea729
the team will then respond there, i will also lose access to it, so keep me updated in this discord thread please.
update for team, they are now using ffmpeg installed via apt done through their dockerfile.
Thank you for the support, I will update 🙂
thanks!
New reply sent from Help Station thread:
(hidden)You're seeing this because this thread has been automatically linked to the Help Station thread. New reply sent from Help Station thread:
(hidden)You're seeing this because this thread has been automatically linked to the Help Station thread. New reply sent from Help Station thread:
(hidden)You're seeing this because this thread has been automatically linked to the Help Station thread. New reply sent from Help Station thread:
(hidden)You're seeing this because this thread has been automatically linked to the Help Station thread. New reply sent from Help Station thread:
(hidden)You're seeing this because this thread has been automatically linked to the Help Station thread. New reply sent from Help Station thread:
(hidden)You're seeing this because this thread has been automatically linked to the Help Station thread. New reply sent from Help Station thread:
(hidden)You're seeing this because this thread has been automatically linked to the Help Station thread.
any progress?
New reply sent from Help Station thread:
(hidden)You're seeing this because this thread has been automatically linked to the Help Station thread.