Skip to content
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 real number, not NoneType when writing with moviepy #17

Open
mjedmonds opened this issue May 2, 2021 · 9 comments
Open

Comments

@mjedmonds
Copy link

I receive the following error using the demo. I'll try to resolve myself, and update the issue if I find a fix.

python visualize.py --song beethoven.mp3 --duration 15 --resolution 128

Reading audio


Generating input vectors

100%|█████████████████████████████████████████████████████████| 2586/2586 [00:02<00:00, 1222.00it/s]


Generating frames

100%|███████████████████████████████████████████████████████████████| 21/21 [04:21<00:00, 12.45s/it]
Moviepy - Building video output.mp4.
MoviePy - Writing audio in outputTEMP_MPY_wvf_snd.mp4
MoviePy - Done.
Moviepy - Writing video output.mp4

Traceback (most recent call last):
  File "visualize.py", line 400, in <module>
    clip.write_videofile(outname,audio_codec='aac')
  File "/Users/mark/miniconda3/envs/random/lib/python3.7/site-packages/decorator.py", line 231, in fun
    return caller(func, *(extras + args), **kw)
  File "/Users/mark/miniconda3/envs/random/lib/python3.7/site-packages/moviepy/decorators.py", line 54, in requires_duration
    return f(clip, *a, **k)
  File "/Users/mark/miniconda3/envs/random/lib/python3.7/site-packages/decorator.py", line 231, in fun
    return caller(func, *(extras + args), **kw)
  File "/Users/mark/miniconda3/envs/random/lib/python3.7/site-packages/moviepy/decorators.py", line 135, in use_clip_fps_by_default
    return f(clip, *new_a, **new_kw)
  File "/Users/mark/miniconda3/envs/random/lib/python3.7/site-packages/decorator.py", line 231, in fun
    return caller(func, *(extras + args), **kw)
  File "/Users/mark/miniconda3/envs/random/lib/python3.7/site-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB
    return f(clip, *a, **k)
  File "/Users/mark/miniconda3/envs/random/lib/python3.7/site-packages/moviepy/video/VideoClip.py", line 307, in write_videofile
    logger=logger)
  File "/Users/mark/miniconda3/envs/random/lib/python3.7/site-packages/moviepy/video/io/ffmpeg_writer.py", line 216, in ffmpeg_write_video
    ffmpeg_params=ffmpeg_params) as writer:
  File "/Users/mark/miniconda3/envs/random/lib/python3.7/site-packages/moviepy/video/io/ffmpeg_writer.py", line 88, in __init__
    '-r', '%.02f' % fps,
TypeError: must be real number, not NoneType
@KhawajaAli
Copy link

Were you able to find the fix for this?

@mjedmonds
Copy link
Author

mjedmonds commented Jun 5, 2021 via email

@KhawajaAli
Copy link

I was not unfortunately. I didn't spend much time on it though…so may be possible with relatively little effort.

On Sat, Jun 05, 2021 at 4:47 AM, Khawaja Ali Arshad < @.***> wrote: Were you able to find the fix for this? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#17 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRNIPGQ4TE3EUS6XCT4SKLTRIFE5ANCNFSM437WBVEQ .

Oh okay, i have been at it for the entire day, still no luck

@fractalias
Copy link

I re-installed moviepy and that seemed to get rid of this error for me, running Python 3.6.8 on W10

pip3 install moviepy

@bsszds
Copy link

bsszds commented May 23, 2022

Reinstalling doesn't work either, and the problem still occurs on Spyder

@Isaakkamau
Copy link

I know I am late but for the sake of someone else: If you have JUST installed pip3 install moviepy make sure to restart the kernel if you are on Juypter notebook otherwise you will keep getting TypeError: must be real number, not NoneType

@MarioMagdy
Copy link

I know I am late but for the sake of someone else: If you have JUST installed pip3 install moviepy make sure to restart the kernel if you are on Juypter notebook otherwise you will keep getting TypeError: must be real number, not NoneType

YOU SAVED MY DAY

@lovelan521
Copy link

我知道我迟到了,但为了其他人:如果您刚刚安装,pip3 install moviepy请确保重新启动内核(如果您使用的是 Juypter 笔记本),否则您将不断收到TypeError: must be real number, not NoneType

牛牛牛

@ZhangSIming-blyq
Copy link

I know I am late but for the sake of someone else: If you have JUST installed pip3 install moviepy make sure to restart the kernel if you are on Juypter notebook otherwise you will keep getting TypeError: must be real number, not NoneType

Save my day!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants