Issues with converting from *.ps to *.mpeg -- revisited

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
mdtoy
Posts: 14
Joined: 2010-02-08T11:46:40-07:00
Authentication code: 8675309

Issues with converting from *.ps to *.mpeg -- revisited

Post by mdtoy »

Hello,

This is a reposting of two posts I sent on 2/8/2010, now with the actual files available for download.

I am operating on MacOSX Ver. 10.5.8 and my ImageMagick version is 6.5.8-0.

I am trying to convert a series of postscript files to an mpeg animation using the line command "convert".

1) When I enter the line command:
convert -rotate "90>" *ps theta_eta.1.mpeg

The following file (theta_eta.1.mpeg) results:
http://www.adrive.com/public/3fc200ac04 ... 10958.html

Note that the first frame comes out fine, but subsequent frames have the background "blacked out".


2) I can get around problem 1 above by first flattening the images. But there is still a problem that when I include the "crop" option, there is still a bunch of empty white space at the bottom of the animation that I can't get rid of.

The following csh script:
#!/bin/csh
foreach d ($1*ps)
convert -rotate "90>" -flatten $d $d.flat.rotated.ps
end
convert -crop 100%x70%+0+0 $1*flat.rotated.ps $1.mpeg
/bin/rm *flat.rotated.ps

results in the attached mpeg file theta_eta.2.mpeg:
http://www.adrive.com/public/50828bb805 ... 9797a.html


Note that earlier versions of ImageMagick did not produce these odd results. It used to work fine. Please let me know if you are able to reproduce my results, and what the fix might be. Thank you.

BTW, the postscript files theta_eta_0000 thru 0010.ps are downloadable at:
theta_eta_0001.ps http://www.adrive.com/public/e9111a5ef6 ... a7cb4.html
theta_eta_0001.ps http://www.adrive.com/public/ac001e91b6 ... 81730.html
theta_eta_0002.ps http://www.adrive.com/public/2d1d93584b ... dedb0.html
theta_eta_0003.ps http://www.adrive.com/public/a2e8224ce1 ... f18d8.html
theta_eta_0004.ps http://www.adrive.com/public/a415e3ed84 ... e1884.html
theta_eta_0005.ps http://www.adrive.com/public/36faf5a9d0 ... 4f4f7.html
theta_eta_0006.ps http://www.adrive.com/public/008cedbfd9 ... 9fda5.html
theta_eta_0007.ps http://www.adrive.com/public/7caee03e2d ... 8444d.html
theta_eta_0008.ps http://www.adrive.com/public/327e6d8394 ... 56a14.html
theta_eta_0009.ps http://www.adrive.com/public/d953bd4adc ... d1f95.html
theta_eta_0010.ps http://www.adrive.com/public/6d9fe48987 ... b40ab.html
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issues with converting from *.ps to *.mpeg -- revisited

Post by fmw42 »

add +repage after you crop and see if that helps. see http://www.imagemagick.org/Usage/crop/#crop_repage


with regard to your first problem, let me first say that the correct IM v6 syntax is to specify the input image before any operations that act on it such as resize. Probably won't matter for now, but in IM 7, eventually it will. see http://www.imagemagick.org/Usage/basics/#why

with regard to the transparency, try

convert *.ps -channel rgba -alpha on -rotate "90>" result.mpeg

Not sure if this will help, as I don't do much with mpeg or animations
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Issues with converting from *.ps to *.mpeg -- revisited

Post by magick »

Add a delay to your command line to maintain the white background:
  • convert -delay 100 *ps test.mpg
mdtoy
Posts: 14
Joined: 2010-02-08T11:46:40-07:00
Authentication code: 8675309

Re: Issues with converting from *.ps to *.mpeg -- revisited

Post by mdtoy »

Thank you fmw42 and magick.

fmw42:
Your suggestion of adding +repage after crop did the trick. Final image is of the desired size. Thanks!
Your suggestion of adding "-channel rgba -alpha on" didn't work, however. I still get the black background.

magick:
Adding the "-delay" option didn't get rid of the black background either. First frame still fine, but black background on subsequent frames still there, even with the delay between frames.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issues with converting from *.ps to *.mpeg -- revisited

Post by fmw42 »

try

-background none -rotate ...
mdtoy
Posts: 14
Joined: 2010-02-08T11:46:40-07:00
Authentication code: 8675309

Re: Issues with converting from *.ps to *.mpeg -- revisited

Post by mdtoy »

Hello fmw42,

I tried -background none -rotate ... and this does not change anything -- still get the black background.

Have you tried converting the postscript files I attached? Do you get the same results as I do?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issues with converting from *.ps to *.mpeg -- revisited

Post by fmw42 »

sorry when I try to convert your ps, i get gs errors:

convert -delay 100 theta_eta_0000.ps theta_eta_0001.ps theta_eta_0002.ps theta_eta.mpg
Error: /invalidfont in /findfont
Operand stack:
--nostringval-- Helvetica
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1857 1 3 %oparray_pop 1856 1 3 %oparray_pop 1840 1 3 %oparray_pop 1723 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 1815 2 3 %oparray_pop
Dictionary stack:
--dict:1144/1684(ro)(G)-- --dict:0/20(G)-- --dict:93/200(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 794
GPL Ghostscript 8.61: Unrecoverable error, exit code 1


Anyone know how to fix this?
mdtoy
Posts: 14
Joined: 2010-02-08T11:46:40-07:00
Authentication code: 8675309

Re: Issues with converting from *.ps to *.mpeg -- revisited

Post by mdtoy »

fmw42,

I'm definitely not getting that error. Sorry I can't help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issues with converting from *.ps to *.mpeg -- revisited

Post by fmw42 »

what version of Ghostscript are you using. perhaps I need to upgrade? or my gs fonts are corrupt?
mdtoy
Posts: 14
Joined: 2010-02-08T11:46:40-07:00
Authentication code: 8675309

Re: Issues with converting from *.ps to *.mpeg -- revisited

Post by mdtoy »

I have at least two versions of ghostscript on my computer:
The one that is first on my path is ver. 8.57. But the one I have in /usr/local/bin is ver. 8.70. I'm not sure which one of these ImageMagick's "convert" uses.
mdtoy
Posts: 14
Joined: 2010-02-08T11:46:40-07:00
Authentication code: 8675309

Re: Issues with converting from *.ps to *.mpeg -- revisited

Post by mdtoy »

Hi fmw42,

Any luck upgrading ghostscript? Are you still getting the gs errors?

-- mdtoy
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issues with converting from *.ps to *.mpeg -- revisited

Post by fmw42 »

mdtoy wrote:Hi fmw42,

Any luck upgrading ghostscript? Are you still getting the gs errors?

-- mdtoy

I have not had time to try to upgrade, yet.

Thanks

Fred

P.S.
2) I can get around problem 1 above by first flattening the images. But there is still a problem that when I include the "crop" option, there is still a bunch of empty white space at the bottom of the animation that I can't get rid of.
If you did not see this before, try putting your input images just after convert and before your other options such as -crop
mdtoy
Posts: 14
Joined: 2010-02-08T11:46:40-07:00
Authentication code: 8675309

Re: Issues with converting from *.ps to *.mpeg -- revisited

Post by mdtoy »

Frank,

"2) I can get around problem 1 above by first flattening the images. But there is still a problem that when I include the "crop" option, there is still a bunch of empty white space at the bottom of the animation that I can't get rid of."

I tried changing the placement of the options, and it didn't make a difference.

I wonder what kind of results magick gets when converting the postscript files I uploaded.

-- Mike
Post Reply