05-22-2009 12:34 PM
This is very helpful. Thank you !
Will this work with images that are dynamically loaded from the Internet ? I need an endless stream of new photographs (actually video frames) to get live video.
Will this code work on the 8330 ? (I made a typo when I said an 8830)
05-22-2009 12:53 PM
yes it'll work on the 8330.
The images are loaded from the web, the first 8 images are requested after that they will be cached. But If I created more images it could go on forever just requesting with no caching.
The code waits for an image to load, then holds that image for 2 secs, then calls the next image.
05-22-2009 01:19 PM
I tested it on the 8330, and it does run. But there are several problems for what I need to do:
1) the screen is white and there's a little icon on the screen while it's loading each image
2) it fetches 8 images and then repeats them
In my live video application, the frames never repeat because each image is new, so I need to download new images constantly, and I need to keep the previous image on the screen while the next one is being downloaded and prepared (decoding JPEG) for display.
I need as high a frame rate as possible to get the smoothest video. The frame rate will depend on the image size (320x240, 160x120, etc), file size (varies, 3 to 12 K-bytes), and download speed to the BB (varies, can be < 50 Kbps).
So I need to download image(i), decode it, and put it on the screen. While it's on the screen, I need to do the same with image(i+1), for i = 0 to forever.
05-22-2009 01:25 PM
The script is to give you an idea of how to do it.
I think all the elements are there to do what you want to do.
I would thoroughly test the image.complete property though as I'm not sure it works 100% on older devices.
05-22-2009 01:25 PM
My series of images is dynamic. The server chooses the most recent image out of an endless stream of images. There's no fixed array of images being sent. The series(i) of images being received by a given BB is just the sequence of images chosen for that particular handset by the server.
05-22-2009 01:45 PM
Pretend if you will I am the server app creating the first 8 jpg images. Forget about what happens after 8.
Its just a list of images whether I create them or a server app.
05-23-2009 09:18 AM
using GIF, you have the ability to create an animation (= several images) inside a single GIF file.
Why GIF instead of JPG ? For a given resolution, the file size of a GIF image is much larger than for a JPG because we're sending photographs (frames of video), not drawings.
05-23-2009 09:32 AM
Thank you for your post on GIF. I can't use animated GIF because I'm putting live video on the screen. You can call it webcam live video, although it's not actually from a webcam. Live video raises many system-level issues, such as screen refresh, wireless download data rate, different frame and data rates for different users, latency, caching...
05-24-2009 01:11 AM
I tested the image.complete property of the image and it is not working in earlier versions, its always true! So the previous method won't work.
Take a look at this script though.
It loads the next image before moving to the next page. No images are cached, so this is like a real time request call for all the images to the server for every page (which I think is what you're doing).
I don't think its ideal, as the only way to get the next image to load on the device is to actually display it in the older versions.
It looks funny for the intial frame but from then on it looks ok.