Page 1 of 1

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

Posted: 2010-02-25T13:07:03-07:00
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

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

Posted: 2010-02-25T13:38:21-07:00
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

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

Posted: 2010-02-25T14:02:53-07:00
by magick
Add a delay to your command line to maintain the white background:
  • convert -delay 100 *ps test.mpg

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

Posted: 2010-02-25T14:24:39-07:00
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.

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

Posted: 2010-02-25T15:59:39-07:00
by fmw42
try

-background none -rotate ...

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

Posted: 2010-02-26T14:00:03-07:00
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?

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

Posted: 2010-02-26T14:10:06-07:00
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?

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

Posted: 2010-03-01T21:52:29-07:00
by mdtoy
fmw42,

I'm definitely not getting that error. Sorry I can't help.

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

Posted: 2010-03-01T22:07:42-07:00
by fmw42
what version of Ghostscript are you using. perhaps I need to upgrade? or my gs fonts are corrupt?

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

Posted: 2010-03-02T09:02:46-07:00
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.

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

Posted: 2010-03-08T09:59:02-07:00
by mdtoy
Hi fmw42,

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

-- mdtoy

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

Posted: 2010-03-08T11:06:04-07:00
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

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

Posted: 2010-03-08T12:45:42-07:00
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