Trying to convert 200 jpg files to an mp4 w/ ImageMagick. Receiving the same error over and over again

前端 未结 5 1508
梦谈多话
梦谈多话 2021-01-05 03:56

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 -del         


        
相关标签:
5条回答
  • 2021-01-05 04:40

    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
    
    0 讨论(0)
  • 2021-01-05 04:49

    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
    
    0 讨论(0)
  • 2021-01-05 04:50

    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 :

    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 讨论(0)
  • 2021-01-05 04:58

    sudo apt install ffmpeg


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

    0 讨论(0)
  • 2021-01-05 05:01

    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
    
    0 讨论(0)
提交回复
热议问题