[visionegg] Re: Displaying raw movies
- From: Andrew Straw <astraw@xxxxxxxxxxx>
- To: visionegg@xxxxxxxxxxxxx
- Date: Thu, 23 Sep 2004 21:48:48 -0700
Martin Spacek wrote:
Hi Andrew,
Thanks, that worked like a charm! With Numeric, it takes about 30sec to
load a 120 MB file into a 3D array. With numarray, it takes only a
couple of seconds to do the same. Both seem to be equally quick in
accessing the contents after the fact though (is this because you've
converted the numarray into a Numeric array, as mentioned in the
comments?).
No, conversion between the two formats is not happening -- I re-wrote
Textures.py to be agnostic about the source of texel data, and here was
a pay-off. I think by using the buffer() stuff I mentioned earlier,
there may be another speed boost.
On our setup (512MB RAM, Athlon 700MHz, Radeon 9800 Pro,
Windows 2000) it takes about 0.8 ms to load a 2D frame from the 3D
array, draw it, swap the buffers, and change the bit value on our
digital out card (viewed on an oscilloscope). This is plenty fast enough
for the 5 ms available on a 200Hz display.
Super!
Unfortunately, if I create
two separate texture stimuli to run two movies simultaneously within the
same viewport, things seem to slow down quite a bit, averaging 5.7 ms
per frame. This is even when the identical movie is fed to both stimuli.
Might there be a speed advantage in setting up two separate viewports
instead?
Hmm... This is very strange. It suggests a strong penalty for multiple
viewports inherent to the OpenGL level (obviously the code from the
first case should take 1.6 ms when run twice). Is it possible for you
to workaround the problem by copying the relevant bits from to arrays
into a third array and drawing that onto a single viewport? Admittedly
this is not ideal. Unfortunately, I can't look into this very deeply at
the moment, but if it continues to plague you, please continue to plague
me :) ! (Just a sanity check -- you're not swapping buffers in there,
are you?)
For anyone's reference, I've attached the current code I have for
playing a raw movie from a file.
On another note, in FrameTimer() in VisionEgg.Core, you might want to
consider replacing the word "frame" with "inter frame interval" or
"IFI":
Mean frame was 5.00 msec (200.01 fps), longest frame was 6.52 msec.
to
Mean IFI was 5.00 msec (200.01 fps), longest IFI was 6.52 msec.
For the longest time, I wondered why the total population of the
histogram was always one less than the total number of displayed frames,
'til I finally clued in :)
Good suggestion. Done in CVS.
Cheers!
Andrew
======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
- References:
- [visionegg] Displaying raw movies
- From: Martin Spacek
- [visionegg] Re: Displaying raw movies
- From: Andrew Straw
- [visionegg] Re: Displaying raw movies
- From: Martin Spacek
Other related posts:
- » [visionegg] Displaying raw movies
- » [visionegg] Re: Displaying raw movies
- » [visionegg] Re: Displaying raw movies
- » [visionegg] Re: Displaying raw movies
Hi Andrew,
Thanks, that worked like a charm! With Numeric, it takes about 30sec to load a 120 MB file into a 3D array. With numarray, it takes only a couple of seconds to do the same. Both seem to be equally quick in accessing the contents after the fact though (is this because you've converted the numarray into a Numeric array, as mentioned in the comments?).
Windows 2000) it takes about 0.8 ms to load a 2D frame from the 3D
array, draw it, swap the buffers, and change the bit value on our
digital out card (viewed on an oscilloscope). This is plenty fast enough
for the 5 ms available on a 200Hz display.
two separate texture stimuli to run two movies simultaneously within the
same viewport, things seem to slow down quite a bit, averaging 5.7 ms
per frame. This is even when the identical movie is fed to both stimuli.
Might there be a speed advantage in setting up two separate viewports
instead?
For anyone's reference, I've attached the current code I have for playing a raw movie from a file.
On another note, in FrameTimer() in VisionEgg.Core, you might want to consider replacing the word "frame" with "inter frame interval" or "IFI":
Mean frame was 5.00 msec (200.01 fps), longest frame was 6.52 msec.
to
Mean IFI was 5.00 msec (200.01 fps), longest IFI was 6.52 msec.
For the longest time, I wondered why the total population of the
histogram was always one less than the total number of displayed frames,
'til I finally clued in :)
Good suggestion. Done in CVS.
====================================== The Vision Egg mailing list Archives: http://www.freelists.org/archives/visionegg Website: http://www.visionegg.org/mailinglist.html
- [visionegg] Displaying raw movies
- From: Martin Spacek
- [visionegg] Re: Displaying raw movies
- From: Andrew Straw
- [visionegg] Re: Displaying raw movies
- From: Martin Spacek