9

I'm trying to convert 200 .jpg files that were .ppm files into one .mp4 file.

In the same directory as the .jpg files, I ran this code:

convert -delay 6 -quality 95 test*ppm movie.mp4

and received this error message:

convert: no images defined `movie.mp4' @ error/convert.c/ConvertImageCommand/3210.

What caused this error?

2
  • Do the images in the directory you are running the command from have a .jpg extension? Aug 3, 2015 at 3:35
  • 1
    Do you have ffmpeg as a delegate in your ImageMagick install. MPEG formats require that ImageMagick have ffmpeg as a delegate library. You should see mpeg listed in Delegates section from convert -version. See the comment in the MPEG section of imagemagick.org/script/formats.php#supported
    – fmw42
    May 9, 2018 at 0:16

5 Answers 5

14

Nevermind, I just ended up using ffmpeg. This is the code that I used:

ffmpeg -framerate 1 -pattern_type glob -i '*.jpg' -c:v libx264 out.mp4
2
  • 1
    glob is defined in the POSIX standard and it's not available on Windows by default. Jul 6, 2017 at 18:24
  • What does -pattern_type glob and -c:v do? Nov 25, 2020 at 3:07
3

From what I am reading the images you are running the command on have a .jpg extension.

Try

convert -delay 6 -quality 95 *.jpg movie.mp4
2
  • 5
    Sadly, I receive the error: convert: delegate failed `"avconv" -v -1 -i "%M%%d.jpg" "%u.%m" 2> "%Z"' @ error/delegate.c/InvokeDelegate/1310.
    – fmartin
    Aug 3, 2015 at 3:45
  • convert -delay 600 *.png movie.mp4 worked on my side (600 means 6 seconds) Jul 6, 2017 at 18:26
2

sudo apt install ffmpeg


ImageMagick delegates video processing. I lost more than 5 hours to understand why such a bug NotIdentifiedByImageMagickError

0

TL;DR

Use \ls or ls --color=never to get uncolored files list

Failing command...

for f in $( ls *.JPG ); do convert -resize 1920x $f re_$f ; done

... becomes

for f in $( ls --color=never *.JPG ); do convert -resize 1920x $f re_$f ; done

Details

I got same error, due to colored output of ls command :

Error I got (in french):

$ for f in $( ls *.JPG ); do convert -resize 1920x $f re_$f ; done
convert: pas de délégué pour décoder ce format d'image `JPG' @ error/constitute.c/ReadImage/501.
convert: pas d'images définies `IMG_5235.JPG' @ error/convert.c/ConvertImageCommand/3210.
convert: impossible d'ouvrir l'image `IMG_5236.JPG': Aucun fichier ou dossier de ce type @ error/blob.c/OpenBlob/2712.

Filenames are colored like in this screenshot :

enter image description here

My ls command is aliased to a ls --color=auto which leads convert file parameters to contain color sequences.

Disable ls colored output by using \ls :

for f in $( \ls *.JPG ); do convert -resize 1920x $f re_$f ; done

or :

for f in $( ls --color=never *.JPG ); do convert -resize 1920x $f re_$f ; done

Then convert may not give previous errors. Hope this can help.

0

The proper syntax is:

convert src_file [options] dst_file

So in your case, it should be like:

convert movie.mp4 -delay 6 -quality 95 test*ppm movie_converted.mp4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.