comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Problems with MPEG
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Problems with MPEG [message #35977 is a reply to message #35976] Tue, 05 August 2003 09:55 Go to previous message
David.Chevrier is currently offline  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
[Message index]
 
Read Message
Read Message
Previous Topic: Problems with MPEG
Next Topic: NYC: Seeking IDL Freelance Help

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 23:59:00 PDT 2025

Total time taken to generate the page: 0.47971 seconds