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

[BUG] MoviePy Error: creation of None #89

Closed
raniaamina opened this issue Feb 8, 2024 · 13 comments
Closed

[BUG] MoviePy Error: creation of None #89

raniaamina opened this issue Feb 8, 2024 · 13 comments
Assignees

Comments

@raniaamina
Copy link

Describe the bug
Process stoped after combining video

To Reproduce
Steps to reproduce the behavior:

  1. Generate video as usual
  2. Wait until combining video done
  3. errror appear
convert: attempt to perform an operation not allowed by the security policy `@/tmp/tmpinzhb12u.txt' @ error/property.c/InterpretImageProperties/3771.
convert: label expected `@/tmp/tmpinzhb12u.txt' @ error/annotate.c/GetMultilineTypeMetrics/782.
convert: no images defined `PNG32:/tmp/tmp0vf09mzc.png' @ error/convert.c/ConvertImageCommand/3234.
.

.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

Expected behavior
Video generated successfully

Screenshots

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Firefox
  • Python Version: 3.11.7

Additional context
ImageMagick already installed, i put the path correctly in .env. Also it tried to download magick as instructed in ENV file but still giving same results.

@FujiwaraChoki
Copy link
Owner

Fix permission of the magick binary

@raniaamina
Copy link
Author

what kind of permission?
both convert and magick are executable ready

@bbrooks870
Copy link

same issue

@angpetrov
Copy link

I noticed there are at least two places where you include the path for imagemagick:

  • .env file in the project home folder
  • virtualenv/lib/python3.9/site-packages/moviepy/config_defaults.py

On Mac, I initially installed imagemagick through homebrew. That didn't work so I installed it manually using the instructions from imagemagick website.

That also doesn't seem to work for now.

.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

@adildg
Copy link

adildg commented Feb 8, 2024

I noticed there are at least two places where you include the path for imagemagick:

  • .env file in the project home folder
  • virtualenv/lib/python3.9/site-packages/moviepy/config_defaults.py

On Mac, I initially installed imagemagick through homebrew. That didn't work so I installed it manually using the instructions from imagemagick website.

That also doesn't seem to work for now.

.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

Have you put the binary path correctly in the .env ?
You don't have to touch the ...site-packages/moviepy/config_defaults.py at all.

To get the binary path :
1.

brew info imagemagick

OUTPUT:

==> imagemagick: stable 7.1.1-27 (bottled), HEAD
Tools and libraries to manipulate images in many formats
https://imagemagick.org/index.php
/opt/homebrew/Cellar/imagemagick/7.1.1-27 (809 files, 31.4MB) *
  Poured from bottle using the formulae.brew.sh API on 2024-02-07 at 01:46:26
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/i/imagemagick.rb
License: ImageMagick
==> Dependencies
Build: pkg-config ✘
Required: freetype ✔, ghostscript ✔, jpeg-turbo ✔, libheif ✔, liblqr ✔, libpng ✘, libraw ✔, libtiff ✔, libtool ✔, little-cms2 ✔, openexr ✔, openjpeg ✔, webp ✔, xz ✔, libomp ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 71,337 (30 days), 223,414 (90 days), 784,778 (365 days)
install-on-request: 65,962 (30 days), 205,903 (90 days), 721,871 (365 days)
build-error: 8 (30 days)
  1. Open the folder : /opt/homebrew/Cellar/imagemagick/7.1.1-27
  2. Go to /bin/
  3. and locate the magick binary

and use the full path :

IMAGEMAGICK_BINARY="/opt/homebrew/Cellar/imagemagick/7.1.1-27/bin/magick"

That's all I had to do on my Mac and it works

@angpetrov
Copy link

I noticed there are at least two places where you include the path for imagemagick:

  • .env file in the project home folder
  • virtualenv/lib/python3.9/site-packages/moviepy/config_defaults.py

On Mac, I initially installed imagemagick through homebrew. That didn't work so I installed it manually using the instructions from imagemagick website.
That also doesn't seem to work for now.
.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

Have you put the binary path correctly in the .env ? You don't have to touch the ...site-packages/moviepy/config_defaults.py at all.

To get the binary path : 1.

brew info imagemagick

OUTPUT:

==> imagemagick: stable 7.1.1-27 (bottled), HEAD
Tools and libraries to manipulate images in many formats
https://imagemagick.org/index.php
/opt/homebrew/Cellar/imagemagick/7.1.1-27 (809 files, 31.4MB) *
  Poured from bottle using the formulae.brew.sh API on 2024-02-07 at 01:46:26
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/i/imagemagick.rb
License: ImageMagick
==> Dependencies
Build: pkg-config ✘
Required: freetype ✔, ghostscript ✔, jpeg-turbo ✔, libheif ✔, liblqr ✔, libpng ✘, libraw ✔, libtiff ✔, libtool ✔, little-cms2 ✔, openexr ✔, openjpeg ✔, webp ✔, xz ✔, libomp ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 71,337 (30 days), 223,414 (90 days), 784,778 (365 days)
install-on-request: 65,962 (30 days), 205,903 (90 days), 721,871 (365 days)
build-error: 8 (30 days)
  1. Open the folder : /opt/homebrew/Cellar/imagemagick/7.1.1-27
  2. Go to /bin/
  3. and locate the magick binary

and use the full path :

IMAGEMAGICK_BINARY="/opt/homebrew/Cellar/imagemagick/7.1.1-27/bin/magick"

That's all I had to do on my Mac and it works

Cheers, mate, it worked. I had messed it up.

@bbrooks870
Copy link

anyone knows how to make it work on Linux system (ubuntu)

@FujiwaraChoki
Copy link
Owner

FujiwaraChoki commented Feb 8, 2024

anyone knows how to make it work on Linux system (ubuntu)

It should be located somewhere in /usr/bin/convert or something similar to that.
Run whereis convert to find out where, must have installed ImageMagick beforehand:

sudo apt install imagemagick
whereis convert

@bbrooks870
Copy link

i have already did
Screenshot 2024-02-09 023244

still getting below error
image

@angpetrov
Copy link

i have already did Screenshot 2024-02-09 023244

still getting below error image

It seems that imagemagick has a file with permissions on its own. I found it while searching for my issue. Check that here:

Zulko/moviepy#693 (comment)

@V4M0N0S
Copy link

V4M0N0S commented Feb 8, 2024

Use: #100

@bbrooks870
Copy link

Hi ALL ,

This fixed the problem of Policy

sed -i '/<policy domain="path" rights="none" pattern="@\*"/d' /etc/ImageMagick-6/policy.xml

@raniaamina
Copy link
Author

after i checked, the line already commented, so it should has no effect

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

6 participants