mpeg creation problem [message #52779] |
Wed, 28 February 2007 06:26  |
kostis
Messages: 17 Registered: December 2006
|
Junior Member |
|
|
I have a 3d plot which i want to save as an mpeg video of 2000 frames
(a lot)
x[ i ] , y[ i ] , z[ i ] are arrays (dimension=2000) of numbers
properly defined
I use the following code:
; number of frames
nfr=2000
; spatial size in pixels
xsize=300
ysize=300
; open the mpeg
mpegID=MPEG_OPEN([xsize,ysize])
; loop over the frames
for f=0,nfr-2 do begin
; create a 3d environment
....................................................
; plot the line of a frame using the arrays in the
environment
for i=0,f
plots, [ x[i] , x[i+1] ], [ y[i] , y[i+1] ], [ z[i], z[i
+1] ], /T3D, /DATA
endfor
; put a frame into the mpeg
MPEG_PUT,mpegID,WINDOW=0,FRAME=f
endfor
; save and close
MPEG_SAVE,mpegID,FILENAME='vid.mpg'
MPEG_CLOSE,mpegID
Comments:
I run IDL in a remote pc (through linux ssh).
Each frame is first plotted to my screen and then inserted to the
mpg.
It takes almost 10minutes for each frame so i should wait a very long
time for my 2000 frame..!!
I think that the screen plotting delays the whole process.
There must be a better way since they say IDL is the top graphics
tool...
Questions:
1. Can I do the same job without each frame appearing on my screen??
How should I change the code??
2. Do U have any other suggestions to improve this ??
Thanx for ur patience
|
|
|
Re: mpeg creation problem [message #53032 is a reply to message #52779] |
Tue, 13 March 2007 00:35  |
Sven Geier
Messages: 17 Registered: July 2002
|
Junior Member |
|
|
kostis wrote:
[...]
> Questions:
>
> 1. Can I do the same job without each frame appearing on my screen??
> How should I change the code??
You could try plotting into the z-buffer if nothing else. The way you're
doing it now, you're transporting every pixel over your network.
> 2. Do U have any other suggestions to improve this ??
I create mpegs with a couple thousand frames of data fairly regularly. it
takes a while when you hit the mpeg_close, but each frame shouldn't take as
long as you're indicating. How large is the window that you're using (I
didn't see the window,xsize=..., ysize=... statement). If it is anything
other than 300x300, then you're not only transmitting unnecessarily large
bitmaps around, but you incur some rebinning penalty at each frame. You
might consider doing a tvrd() "by hand" for each frame and then handing the
resulting bitmaps to mpeg_put individually - if only to see whether that
makes a difference (that's how I usually do it).
- S
--
http://www.sgeier.net
My real email address does not contain any "Z"s.
|
|
|