JasonLovesDoggo / RedditVideoMakerBot

Create Reddit Videos with just✨ one command ✨
GNU General Public License v3.0
23 stars 13 forks source link

ISSUE: 'No such file or directory' During Final Video Creation #16

Closed stopmoclay closed 2 years ago

stopmoclay commented 2 years ago

Getting the following error during the "Creating the final video" section

Moviepy - Building video results/What’s your best advice for be....mp4.
MoviePy - Writing audio in What’s your best advice for be...TEMP_MPY_wvf_snd.mp4
MoviePy - Done.
Moviepy - Writing video results/What’s your best advice for be....mp4

t:   0%|                                                                    | 2/1895 [00:00<01:40, 18.84it/s, now=None]Traceback (most recent call last):
  File "C:\Python310\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 136, in write_frame
    self.proc.stdin.write(img_array.tobytes())
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Lucas\Documents\GitHub\JasonLovesDoggoRedditVideoMakerBot\RedditVideoMakerBot\main.py", line 39, in <module>
    main()
  File "C:\Users\Lucas\Documents\GitHub\JasonLovesDoggoRedditVideoMakerBot\RedditVideoMakerBot\main.py", line 34, in main
    final_video = make_final_video(number_of_comments)
  File "C:\Users\Lucas\Documents\GitHub\JasonLovesDoggoRedditVideoMakerBot\RedditVideoMakerBot\video_creation\final_video.py", line 47, in make_final_video
    final.write_videofile(f"results/{get_video_title()}.mp4", fps=30, audio_codec="aac", audio_bitrate="192k")
  File "<decorator-gen-55>", line 2, in write_videofile
  File "C:\Python310\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration
    return f(clip, *a, **k)
  File "<decorator-gen-54>", line 2, in write_videofile
  File "C:\Python310\lib\site-packages\moviepy\decorators.py", line 135, in use_clip_fps_by_default
    return f(clip, *new_a, **new_kw)
  File "<decorator-gen-53>", line 2, in write_videofile
  File "C:\Python310\lib\site-packages\moviepy\decorators.py", line 22, in convert_masks_to_RGB
    return f(clip, *a, **k)
  File "C:\Python310\lib\site-packages\moviepy\video\VideoClip.py", line 300, in write_videofile
    ffmpeg_write_video(self, filename, fps, codec,
  File "C:\Python310\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 228, in ffmpeg_write_video
    writer.write_frame(frame)
  File "C:\Python310\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 180, in write_frame
    raise IOError(error)
OSError: [Errno 22] Invalid argument

MoviePy error: FFMPEG encountered the following error while writing file results/What’s your best advice for be....mp4:

 b'results/What\xe2\x80\x99s your best advice for be....mp4: No such file or directory\r\n'
scottytt9 commented 2 years ago

Try creating a folder in the main directory calling it "results"

stopmoclay commented 2 years ago

Try creating a folder in the main directory calling it "results"

That worked I think, thanks mate! Greatly appreciated

scottytt9 commented 2 years ago

No problem :)

JasonLovesDoggo commented 2 years ago

I'm just going make the script make the results folder on start