msieg / deep-music-visualizer

The Deep Visualizer uses BigGAN (Brock et al., 2018) to visualize music.
389 stars 104 forks source link

TypeError: must be real number, not NoneType when writing with moviepy #17

Open mjedmonds opened 3 years ago

mjedmonds commented 3 years ago

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 commented 3 years ago

Were you able to find the fix for this?

mjedmonds commented 3 years ago

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 https://github.com/msieg/deep-music-visualizer/issues/17#issuecomment-855228248, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRNIPGQ4TE3EUS6XCT4SKLTRIFE5ANCNFSM437WBVEQ .

KhawajaAli commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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

Isaakkamau commented 1 year ago

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 commented 1 year ago

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 commented 11 months ago

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

牛牛牛

ZhangSIming-blyq commented 10 months ago

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!!