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

AttributeError: 'NoneType' object has no attribute 'stdout' #1054

Closed
bezerra-lucas opened this issue Dec 26, 2019 · 1 comment
Closed

AttributeError: 'NoneType' object has no attribute 'stdout' #1054

bezerra-lucas opened this issue Dec 26, 2019 · 1 comment

Comments

@bezerra-lucas
Copy link

Hello everyone

I am writing a script to merge short clips into a video, but these videos contain different sizes and frame rates. When I ran the code below, the output video was full of glitches from the second clip.

`from moviepy.editor import *

clips = [ VideoFileClip("clips/clip-1.mp4"),
VideoFileClip("clips/clip-2.mp4"),
VideoFileClip("clips/clip-3.mp4")]

final_clip = concatenate_videoclips(clips)
final_clip.write_videofile("final.mp4")`

Searching better I assumed it was possibly because they diverged in attributes, so I included the compose() method:

final_clip = concatenate_videoclips(clips, method='compose')
and got the error below:
File "c:/video machine/test.py", line 8, in <module> final_clip.write_videofile("final.mp4") File "<C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\decorator.py:decorator-gen-51>", line 2, in write_videofile File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration return f(clip, *a, **k) File "<C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\decorator.py:decorator-gen-50>", line 2, in write_videofile File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\decorators.py", line 137, in use_clip_fps_by_default return f(clip, *new_a, **new_kw) File "<C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\decorator.py:decorator-gen-49>", line 2, in write_videofile File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\decorators.py", line 22, in convert_masks_to_RGB return f(clip, *a, **k) File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\video\VideoClip.py", line 317, in write_videofile logger=logger) File "<C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\decorator.py:decorator-gen-73>", line 2, in write_audiofile File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration return f(clip, *a, **k) File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\audio\AudioClip.py", line 209, in write_audiofile logger=logger) File "<C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\decorator.py:decorator-gen-70>", line 2, in ffmpeg_audiowrite File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration return f(clip, *a, **k) File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\audio\io\ffmpeg_audiowriter.py", line 169, in ffmpeg_audiowrite logger=logger): File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\audio\AudioClip.py", line 85, in iter_chunks fps=fps, buffersize=chunksize) File "<C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\decorator.py:decorator-gen-72>", line 2, in to_soundarray File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration return f(clip, *a, **k) File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\audio\AudioClip.py", line 126, in to_soundarray snd_array = self.get_frame(tt) File "<C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\decorator.py:decorator-gen-10>", line 2, in get_frame File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\decorators.py", line 89, in wrapper return f(*new_a, **new_kw) File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\Clip.py", line 95, in get_frame return self.make_frame(t) File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\audio\AudioClip.py", line 296, in make_frame for c, part in zip(self.clips, played_parts) File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\audio\AudioClip.py", line 297, in <listcomp> if (part is not False)] File "<C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\decorator.py:decorator-gen-10>", line 2, in get_frame File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\decorators.py", line 89, in wrapper return f(*new_a, **new_kw) File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\Clip.py", line 95, in get_frame return self.make_frame(t) File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\audio\io\AudioFileClip.py", line 78, in <lambda> self.make_frame = lambda t: self.reader.get_frame(t) File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\audio\io\readers.py", line 184, in get_frame self.buffer_around(fr_max) File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\audio\io\readers.py", line 238, in buffer_around array = self.read_chunk(chunksize) File "C:\Users\LT1Kqob5UDEML61gCyjnAcfMXgkdP3wGcg45UBcFon37-32\lib\site-packages\moviepy\audio\io\readers.py", line 112, in read_chunk s = self.proc.stdout.read(L) AttributeError: 'NoneType' object has no attribute 'stdout'

moviepy version: 1.0.1

@bezerra-lucas
Copy link
Author

If you're in trouble because this method is not working, just downgrade moviepy to the version 1.0.0

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

1 participant