I having problem on the Create the video step
scaruslooner opened this issue · 3 comments
When I run:
python src\create_video.py PROJECT_NAME
I get this error:
(AUTOMASHin) C:\Users\camer\Desktop\Video projects__SCRIPTS\AutoMash(USED FOR VIDEO CUTTING)>python src\create_video.py PROJECT_NAME
Moviepy - Building video tmp\the funny stuff is_0.02_0.02_0.1_0.05_0.05.mp4.
MoviePy - Writing audio in the funny stuff is_0.02_0.02_0.1_0.05_0.05TEMP_MPY_wvf_snd.mp4
chunk: 0%| | 0/23 [00:00<?, ?it/s, now=None]Traceback (most recent call last):
File "src\create_video.py", line 45, in
snippets_path = [get_snippet_path(fade_in_time, fade_out_time, data_path, lexicon, words, time_before + 0.02 , time_after + 0.02, pause_after + pause_between_phrases) for (words, time_before, time_after, pause_after) in data]
File "src\create_video.py", line 45, in
snippets_path = [get_snippet_path(fade_in_time, fade_out_time, data_path, lexicon, words, time_before + 0.02 , time_after + 0.02, pause_after + pause_between_phrases) for (words, time_before, time_after, pause_after) in data]
File "C:\Users\camer\Desktop\Video projects__SCRIPTS\AutoMash(USED FOR VIDEO CUTTING)\src\helpers.py", line 71, in get_snippet_path
video.write_videofile(output_path, audio_codec='aac')
File "", line 2, in write_videofile
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration
return f(clip, *a, **k)
File "", line 2, in write_videofile
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\decorators.py", line 137, in use_clip_fps_by_default
return f(clip, *new_a, **new_kw)
File "", line 2, in write_videofile
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\decorators.py", line 22, in convert_masks_to_RGB
return f(clip, *a, **k)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\video\VideoClip.py", line 317, in write_videofile
logger=logger)
File "", line 2, in write_audiofile
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration
return f(clip, *a, **k)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\AudioClip.py", line 209, in write_audiofile
logger=logger)
File "", line 2, in ffmpeg_audiowrite
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration
return f(clip, *a, **k)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\io\ffmpeg_audiowriter.py", line 169, in ffmpeg_audiowrite
logger=logger):
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\AudioClip.py", line 85, in iter_chunks
fps=fps, buffersize=chunksize)
File "", line 2, in to_soundarray
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration
return f(clip, *a, **k)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\AudioClip.py", line 126, in to_soundarray
snd_array = self.get_frame(tt)
File "", line 2, in get_frame
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\decorators.py", line 89, in wrapper
return f(*new_a, **new_kw)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\Clip.py", line 95, in get_frame
return self.make_frame(t)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\AudioClip.py", line 296, in make_frame
for c, part in zip(self.clips, played_parts)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\AudioClip.py", line 297, in
if (part is not False)]
File "", line 2, in get_frame
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\decorators.py", line 89, in wrapper
return f(*new_a, **new_kw)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\Clip.py", line 95, in get_frame
return self.make_frame(t)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\Clip.py", line 138, in
newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\fx\audio_fadeout.py", line 11, in fading
gft = gf(t)
File "", line 2, in get_frame
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\decorators.py", line 89, in wrapper
return f(*new_a, **new_kw)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\Clip.py", line 95, in get_frame
return self.make_frame(t)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\Clip.py", line 138, in
newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\fx\audio_fadein.py", line 10, in fading
gft = gf(t)
File "", line 2, in get_frame
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\decorators.py", line 89, in wrapper
return f(new_a, **new_kw)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\Clip.py", line 95, in get_frame
return self.make_frame(t)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\Clip.py", line 138, in
newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\Clip.py", line 190, in
return self.fl(lambda gf, t: gf(t_func(t)), apply_to,
File "", line 2, in get_frame
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\decorators.py", line 89, in wrapper
return f(new_a, **new_kw)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\Clip.py", line 95, in get_frame
return self.make_frame(t)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\io\AudioFileClip.py", line 78, in
self.make_frame = lambda t: self.reader.get_frame(t)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\io\readers.py", line 180, in get_frame
self.buffer_around(fr_min)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\io\readers.py", line 241, in buffer_around
self.seek(new_bufferstart)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\io\readers.py", line 140, in seek
self.skip_chunk(pos-self.pos)
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\io\readers.py", line 102, in skip_chunk
s = self.proc.stdout.read(self.nchannelschunksizeself.nbytes)
AttributeError: 'NoneType' object has no attribute 'stdout'
I tried to solve it by downgrading movie.py to 1.0.0, but then i got this error:
(AUTOMASHin) C:\Users\camer\Desktop\Video projects__SCRIPTS\AutoMash(USED FOR VIDEO CUTTING)>python src\create_video.py PROJECT_NAME
Moviepy - Building video tmp\the funny stuff is_0.02_0.02_0.1_0.05_0.05.mp4.
MoviePy - Writing audio in %s
MoviePy - Done.
Moviepy - Writing video tmp\the funny stuff is_0.02_0.02_0.1_0.05_0.05.mp4
Moviepy - Done !
Moviepy - video ready tmp\the funny stuff is_0.02_0.02_0.1_0.05_0.05.mp4
Moviepy - Building video tmp\what you_0.02_0.02_0.1_0.05_0.05.mp4.
MoviePy - Writing audio in %s
MoviePy - Done.
Moviepy - Writing video tmp\what you_0.02_0.02_0.1_0.05_0.05.mp4
Moviepy - Done !
Moviepy - video ready tmp\what you_0.02_0.02_0.1_0.05_0.05.mp4
Moviepy - Building video tmp\will_0.02_0.02_0.1_0.05_0.05.mp4.
MoviePy - Writing audio in %s
MoviePy - Done.
Moviepy - Writing video tmp\will_0.02_0.02_0.1_0.05_0.05.mp4
Moviepy - Done !
Moviepy - video ready tmp\will_0.02_0.02_0.1_0.05_0.05.mp4
Moviepy - Building video tmp\find_0.02_0.02_0.1_0.05_0.05.mp4.
MoviePy - Writing audio in %s
MoviePy - Done.
Moviepy - Writing video tmp\find_0.02_0.02_0.1_0.05_0.05.mp4
Moviepy - Done !
Moviepy - video ready tmp\find_0.02_0.02_0.1_0.05_0.05.mp4
Moviepy - Building video PROJECT_NAME.mp4.
Moviepy - Writing video PROJECT_NAME.mp4
Moviepy - Done !
Moviepy - video ready PROJECT_NAME.mp4
Exception ignored in: <function FFMPEG_AudioReader.del at 0x000001D9A02D1F78>
Traceback (most recent call last):
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\io\readers.py", line 254, in del
self.close_proc()
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\site-packages\moviepy\audio\io\readers.py", line 150, in close_proc
self.proc.terminate()
File "D:_PROGRAMS\anaconda3NEW\envs\AUTOMASHin\lib\subprocess.py", line 1343, in terminate
_winapi.TerminateProcess(self._handle, 1)
OSError: [WinError 6] The handle is invalid
Hello, thank you for being interested in this project and sorry for taking so long to get back to you.
Concerning your first problem, this seems to be a known issue with moviepy. As you have probably seen on stackoverflow this can be circumnavigated by downgrading moviepy to 1.0.0. However, this issue should also be fixed in moviepy 1.0.3 (see here). So I recommend to update to this version and see if this fixes both of your problems.
Should this not fix all of your problems you can also try to stay with moviepy 1.0.0. For this we need to fix the second problem which also seems to be caused by moviepy. There are are other users that have had the same problem (see here and here).
From what I have seen the following might be a workaround, please let me know if it works:
- Replace src/create_video.py with create_video.zip
- Rerun AutoMash
Please let me know if one of these options works for you.
Upgrading the movie.py 1.0.3 worked!
Thank you very much!