quality reduction when using convert to make mpegs

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jobeirne

quality reduction when using convert to make mpegs

Post by jobeirne »

I have a series of PNG files that I wanted to animate into an MPEG. I issued this command:

Code: Select all

convert -delay 5 -antialias -quality 100% -loop 0 -compress None -density 300 *.png out.mpeg
but the quality of the video is still noticeably worse than each individual image file.
Any ideas on how I can avoid all compression and retain the quality of the image files?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: quality reduction when using convert to make mpegs

Post by fmw42 »

try putting your images before the options

convert -delay 5 *.png -antialias -quality 100% -compress None -density 300 -loop 0 out.mpeg


see http://www.imagemagick.org/Usage/basics/#why
jobeirne

Re: quality reduction when using convert to make mpegs

Post by jobeirne »

fmw42 wrote:try putting your images before the options

convert -delay 5 *.png -antialias -quality 100% -compress None -density 300 -loop 0 out.mpeg


see http://www.imagemagick.org/Usage/basics/#why
You're the man for replying, but I've made the change in parameter order and there's still some obvious compression going on.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: quality reduction when using convert to make mpegs

Post by fmw42 »

why do you need -density? it only affects printing of images!

the quality issue may be coming from the ffmpeg delegate library used to make the mpeg. have you tried using that delegate directly without IM? or checked to see what parameters it has for quality control?

Is it any better with:

convert -delay 5 *.png -quality 100% -compress None -loop 0 out.mpeg

Have you read: http://www.imagemagick.org/Usage/formats/#mpeg

I don't know how up to date that is, but it suggests adding M2V: to your output. But that may be from the old mpeg2encode library which I believe has been superceded by ffmpeg library. But can't hurt to try

convert -delay 5 *.png -quality 100% -compress None -loop 0 M2V:out.mpeg
jobeirne

Re: quality reduction when using convert to make mpegs

Post by jobeirne »

Good point about the density. Removed.

You're probably right; I'll look into ffmpeg and if that doesn't yield anything I'll just try a different format to encode to... AVI, maybe.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: quality reduction when using convert to make mpegs

Post by anthony »

note mpeg is basically JPEG animation. JPEG is always a loosy compression, and only the newest JP2000 allows non-loosy compression..

I doubt you will ever get perfect MPEG
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply