Moviepy: AttributeError: 'NoneType' object has no attribute 'stdout'

Created on 26 Dec 2019  路  1Comment  路  Source: Zulko/moviepy

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

Most helpful comment

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

>All comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

buddhashrestha picture buddhashrestha  路  3Comments

bobozar picture bobozar  路  4Comments

bilel picture bilel  路  4Comments

wayn picture wayn  路  4Comments

cquintini picture cquintini  路  4Comments