-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"TypeError: must be a real number, not NoneType" when trying to use "write_videofile" on any platform other than Google Colab or my computer #1986
Comments
Master seems to have this issue solved #1990 |
Please always include your specs like we ask for in our issue templates – MoviePy version, platform used etc. – to help pinpoint what causes your problem, thanks. |
I have solved this problem through the following command |
Has anybody been able to crack it, It works fine on my local but using a docker file it shows error FROM python:3.8
RUN apt-get update && apt-get install texlive-latex-extra -y
RUN apt-get update && apt-get install -y ffmpeg && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install libportaudio2 -y && \
apt-get install libpango1.0-dev -y
RUN pip3 install moviepy
COPY requirements.txt /reels-gen-service/
WORKDIR /reels-gen-service
RUN pip3 install -r requirements.txt
ADD . /reels-gen-service/
CMD [ "python3", "flask_app.py" ] Everything works fine till,
|
@Fujiwara16 I would try to install the github version from the master branch. |
There is a simple solution to this problem (restart kernel): |
I created two different Conda environments on two separate computers. One of these environments, utilizing Python 3.10, works without any problems. However, the other environment, which was created similarly but uses Python 3.11, presented this specific issue. Solution Implemented:In order to resolve this issue swiftly, I made a modification to the VideoClip.py file within the MoviePy library. Specifically, I added the code below to the write_video_file method. The code ensures that if the fps is not explicitly defined, it defaults to using the clip's fps attribute, which I believe is very similar (though not identical) to the behavior provided by the @use_clip_fps_by_default decorator.
Suggestion:I would like to suggest considering the removal of the @use_clip_fps_by_default decorator from the write_video_file method. The corresponding code of the decorator would then be copied into the body of the method. This change seems to eliminate the issue, which appears to be affecting so many users. By removing this decorator, you could potentially resolve this pervasive bug that frustrates so many users. |
I have tried every method almost. It seems there is only one way I can walk, and fortunately it works ultimately. But I think it's not the best way to solve the problem, It's a very not elegant solution, I hope there will be a better solution in the future. |
Can you please insert a newline between the uninstall and the install? I copied yours and removed my |
Thanks! It really works in my env |
I also have same problem.final I solve this question by Downgrade decorator to version 4.0.2 |
Thanks!It works for me. |
Just in case: |
Due to limitations of Google Colab resources, I am trying to use MoviePy on other platforms. The latest platform I tried was a free account on DeepNote. However, when executing the code:
The following errors happen:
To avoid other errors that I discovered earlier I do:
I just want to use MoviePy to generate a video with text appearing on the screen using Deepnote, but at some point in the code, the variable
fps
becomesNone
, resulting in an error in the operation‘%.02f’ % fps
.The text was updated successfully, but these errors were encountered: