TypeError: 'float' object cannot be interpreted as an integer - CompositeVideoClip
See original GitHub issueI am trying to composite a ‘.mp4’ video and ‘text’ using VideoFileClip and TextClip respectively by appending them to a variable ‘clip_list’.
If I try to print ‘clip_list’ on console it logs:
[<moviepy.video.io.VideoFileClip.VideoFileClip object at 0x7f3d1da98208>,
<moviepy.video.VideoClip.TextClip object at 0x7f3d20699a20>]
Now using CompositeVideoClip on clip_list gives me following error.
Traceback (most recent call last): File "test.py", line 155, in <module> scene_composition = CompositeVideoClip(clip_list).set_duration(scenes[i].get('duration')).on_color(size=screensize, color=(0, 0, 0)) File "/usr/local/lib/python3.7/site-packages/moviepy/video/VideoClip.py", line 616, in on_color colorclip = ColorClip(size, color=color) File "/usr/local/lib/python3.7/site-packages/moviepy/video/VideoClip.py", line 1014, in __init__ ImageClip.__init__(self, np.tile(color, w * h).reshape(shape), File "<__array_function__ internals>", line 6, in tile File "/usr/local/lib/python3.7/site-packages/numpy/lib/shape_base.py", line 1258, in tile return c.reshape(shape_out) TypeError: 'float' object cannot be interpreted as an integer
Any help here? I am using:
Python 3.7.3 moviepy==1.0.2 numpy==1.18.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Moviepy return error on CompositeVideoClip = TypeError
Moviepy return error on CompositeVideoClip = TypeError: 'float' object cannot be interpreted as an integer ... I am trying to composite a '.mp4' ......
Read more >TypeError: float object cannot be interpreted as an integer
The Python TypeError: 'float' object cannot be interpreted as an integer occurs when we pass a float to a function that expects an...
Read more >TypeError: 'float' object cannot be interpreted as an integer
TypeError : 'float' object cannot be interpreted as an integer. Floating-point numbers are values that can contain a decimal point.
Read more >TypeError: 'numpy.float64' object cannot be interpreted as an ...
The problem with your code might be that np.nan is a float64 type value but the np.r_[] expects comma separated integers within its...
Read more >TypeError float object cannot be interpreted as an integer
TypeError : 'float' object cannot be interpreted as an integer. Floating-point numbers are values that can contain a decimal point. Integers ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Very well. That just fixed my problem 😃
Thanks 👍
I’ve fixed the bug that I was getting: you need to set
scene_bg_color
to(255, 255, 255)
, not"#ffffff"
. MoviePy only accepts colours in the format I just described.If that doesn’t solve your problem, then send the full traceback for the crash that you’re getting.