Re: Problems with MPEG [message #35976] |
Tue, 05 August 2003 10:22 |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
"Kay Bente" wrote in message...
> Hi,
> I created a Array 800x600x1000 and saved this as an MPEGfilm with
>
>
mpegID=MPEG_Open([nx,ny],filename='Stars_size'+StrTrim(Strin g(size),1)+'.mpg
> ')
> FOR j=0,frames-1 DO MPEG_Put, mpegID,image=mat_save(*,*,j),frame=j
> MPEG_Save,mpegID
> ENDFOR
>
> (nx=800,ny=600)
> (mat_save=800x600x1000)
>
> but the problem is, that the mpeg file is 852x600
How do you know the resulting MPEG file is 852x600? I am guessing but could
your MPEG player be rescaling the image? How are you viewing the file?
I highly recommend a different codec for creating animations in IDL. The
indeo video codecs are better suited and are supported on PC, Mac, and many
Unices. That being said, I was unable to recreate your problem. Setting
the dimensions to [800,600] resulted in an 800x600 MPEG file as reported by
video mach.
-Rick
|
|
|
Re: Problems with MPEG [message #35977 is a reply to message #35976] |
Tue, 05 August 2003 09:55  |
David.Chevrier
Messages: 14 Registered: May 2003
|
Junior Member |
|
|
> Hi,
> I created a Array 800x600x1000 and saved this as an MPEGfilm with
>
> mpegID=MPEG_Open([nx,ny],filename='Stars_size'+StrTrim(Strin g(size),1)+'.mpg
> ')
> FOR j=0,frames-1 DO MPEG_Put, mpegID,image=mat_save(*,*,j),frame=j
> MPEG_Save,mpegID
> ENDFOR
>
> (nx=800,ny=600)
> (mat_save=800x600x1000)
>
> but the problem is, that the mpeg file is 852x600
>
> does anyone now, how the parameters have to be set, that the correct size
> comes out of the routine? it is important, that my file has exactly 800x600
If you really want to do this with idl's mpeg object, then try this:
mympeg=OBJ_NEW('IDLgrMPEG', QUALITY=100, DIMENSIONS=[800,600])
FOR x=0, (frames-1) DO mympeg->PUT, mat_save[*,*,x]
mympeg->SAVE, FILENAME='Stars_size'+StrTrim(String(size),1)+'.mpg'
OBJ_DESTROY,mympeg
BUT!!!! for 1000 frames not only will the mpeg take FOREVER to save
and close (even with a really really beefed up computer), the quality
will SUCK, no way around it. u are also limited by your ram. search
the newsgroup for idl2avi. its the best. download the dll and dlm
for it and then run this code:
aviParams=AVI_OPENW('Stars_size'+StrTrim(String(size),1)+'.a vi',
24L, 800L, 600L, FRAMERATE=30, OPTIONS=1)
;the mpegs i have made with the mpeg4 codec have been excelent
FOR x=0, (frames-1) DO
status=AVI_PUT(aviParams,x,(mat_save[*,*,x]))
status=AVI_CLOSEW(aviParams)
it will be much faster and EXTREMELY better quality. and instead of
storing the image in your ram, it stores it on your hard drive so it
doesnt take any time to save it. it also allows for mpeg4 creation
amoung many other codecs!
good luck
-dave
-----
NOAA/NMFS/NEFSC/FARG
|
|
|