0

I tried this code from tutorial in the internet

but its didnt work the error is:

OSError: MoviePy Error: creation of None failed because of the following error:

[WinError 2] The system cannot find the file specified.

.This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect
PS C:\Users\Oren\Desktop\Movie> 

I dont understand if i should download the ImageMagick, i search it and i didnt found. Please help.

# Import everything needed to edit video clips
from moviepy.editor import *
    
# loading video dsa gfg intro video
clip = VideoFileClip("cut_2.mp4")
    
# clipping of the video
# getting video for only starting 10 seconds
clip = clip.subclip(0, 10)
    
# Reduce the audio volume (volume x 0.8)
clip = clip.volumex(0.8)
    
# Generate a text clip
txt_clip = TextClip("GeeksforGeeks", fontsize = 75, color = 'black')
    
# setting position of text in the center and duration will be 10 seconds
txt_clip = txt_clip.set_pos('center').set_duration(10)
    
# Overlay the text clip on the first video clip
video = CompositeVideoClip([clip, txt_clip])
    
# showing video
video.ipython_display(width = 280)
furas
  • 134,197
  • 12
  • 106
  • 148
ZONEX
  • 23
  • 6
  • BTW The file is exists so please don't think the cause of the error is this. – ZONEX May 14 '21 at 21:58
  • always put full error message (starting at word "Traceback") in question (not comment) as text (not screenshot, not link to external portal). There are other useful information. – furas May 15 '21 at 01:00
  • how did you search ImageMagick? It has page https://imagemagick.org/ . You have to download and install it. – furas May 15 '21 at 01:02
  • in [official documentation](https://zulko.github.io/moviepy/install.html#other-optional-but-useful-dependencies) you can also see link to `ImageMagick`. If you use `import moviepy.config_defaults` and `print( moviepy.config_defaults.__file__ )` then you should get path to file with configuration – furas May 15 '21 at 01:15
  • Can you send a download link please for windows,I really didn’t found it, also I will put the full error code in some minutes – ZONEX May 15 '21 at 09:01
  • on [main page](https://imagemagick.org/) in top menu you have big word [Download](https://imagemagick.org/script/download.php) and there are files for all systems - Windows, MacOS, Linux – furas May 15 '21 at 09:10
  • Ok, I downloaded also restarted my pc and its still doesnt work – ZONEX May 15 '21 at 09:13
  • And its not letting me to add all the error code so sorry about this – ZONEX May 15 '21 at 09:15
  • did you read my second link to documentation MoviePy? It explains that on WIndows you may have to add `/full/path/to/convert.exe` to file `config.py` And this is why I put `print( moviepy.config_defaults.__file__ )` – furas May 15 '21 at 09:27
  • Oh ok, I will do it right now thank you, I will let you know if it’s working – ZONEX May 15 '21 at 09:31
  • Thank you! Its worked, I set my ImageMagick Address which is this : C:\Program Files\ImageMagick-7.0.11-Q16-HDRI\magick.exe and i define it in moviepy/config_defaults.py as IMAGEMAGICK_BINARY = "C:\\Program Files\\ImageMagick-7.0.11-Q16-HDRI\\magick.exe" instead IMAGEMAGICK_BINARY = os.getenv('IMAGEMAGICK_BINARY', 'auto-detect') – ZONEX May 15 '21 at 09:42
  • BTW: `imagemagick` is powerful tool to modify images even without Python. There is also Python module [Wand](https://docs.wand-py.org/) which uses `imagemagick` – furas May 15 '21 at 10:04

0 Answers0