PDA

View Full Version : importing sequence - most efficient file format


xxxphil
11-12-2007, 11:05 PM
firstly, hi to everyone! it's nice to be part of a community similar interest.. hopefully i can help out as much as i can to add to the help offered by others here!

so my problem..

i'm importing a large sequence of images from google earth, the target is not for web but for demonstration purposes.

i've got 3 sequences, one of around 150images and the other 2 around 50 images.

currently i'm processing the files with photoshop to jpeg @ 1024x768

i'm using image sequences as they look a hell of alot better then video and demonstrate/represent the qual of google earths 3d better then a motion file (although it looks like i might have to go that route)

so the problem is that the file is eating up around 1.6gb of ram (this machine is a 3ghz p4d with ht and 2gb ddr2 looked to upgrade but this stupid motherboard has ram maxed out).

i can compile once then on second compilation it runs out of memory, to run the outputted swf (50mb file) in the standalone player it uses about 400mb of ram. my guess is when it runs it decompresses the images and bloats the ram usage.

so the question is would anyone have a better suggestion on a file format to use in the name of running smoothly without concern of the swfs actual filesize but more so on it running smoothly?

and if the best method for this would just be to use a video file, any suggestions on the best codec to use to get 1024x768 in flash looking clean?

thanks in advance..

phil

Flash Gordon
11-13-2007, 12:38 AM
I don't know why flash doesn't release the ram of loaded images. It's annoying. But I'd suggest turning the image sets into high quality video. Less ram and it will work nicely.

senocular
11-13-2007, 12:52 AM
Flash will usually hold on to RAM in case it needs it again (assuming you are even clearing your references) Its easier for the player to use RAM it already has access to rather than dumping it and requesting it again. It makes certain assumptions based on how much RAM has been used and what it might think might be needed again.

Flash Gordon
11-13-2007, 01:27 AM
This is kind of related but according to the docs:
If you no longer need an event listener, remove it by calling removeEventListener(), or memory problems could result. Objects with registered event listeners are not automatically removed from memory because the garbage collector does not remove objects that still have references.
.....
useWeakReference:Boolean (default = false) — Determines whether the reference to the listener is strong or weak. A strong reference (the default) prevents your listener from being garbage-collected. A weak reference does not.


But that isn't true. If you run this script this proves that:

package {
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.events.*;
import flash.system.*;
public class GarbageCollectionDemo extends Sprite {
public function GarbageCollectionDemo() {
// This Sprite object is garbage collected after enough memory
// is consumed
var s:Sprite=new Sprite ;
s.addEventListener(Event.ENTER_FRAME,enterFrameLis tener );
// Repeatedly create new objects, occupying system memory
var timer:Timer=new Timer(1,0);
timer.addEventListener(TimerEvent.TIMER,timerListe ner);
timer.start();
}
private function timerListener(e:TimerEvent):void {
// Create an object to take up some system memory. Could be
// any object, but TextField objects are nice and meaty.
new TextField ;
}
// This function is executed until the Sprite object is
// garbage collected
private function enterFrameListener(e:Event):void {
// Display the amount of memory occupied by this program
trace("System memory used by this program: " + System.totalMemory);
}
}
}

xxxphil
11-14-2007, 05:11 AM
thanks for the help guys.

i tried changing formats to png (though didn't think this would hav much effect and it didn't) but obviously the problem is loading so many large bitmaps in memory.

i ended up outputting what i needed as uncompressed avi from google earth then converting to "max bitrate" of 4000 in the flv converter. the quality isn't so crash hot but its enough to demonstrate the application appropriately.

perhaps given more time to complete this project, i would look into loading it all up through actionscript and trying to clear out the memory as it goes. but there would still most likely be performance issues to do what i'm asking the computer to do (load large images sequencially @ 25fps).


note; i did come across this link, http://www.gskinner.com/blog/archives/2005/10/major_flash_pla.html which looked like a similar prob but the example given (flash 8) didn't seem to have the same effect in flash 9 so i didn't go any further with it