Hi!
So I wrote some code to work this image sequence. It's not actually cleaned up, and it messes abit that my video exporter uses the filename -format, that's like filename-000000.jpg to filename-000100.jpg for example, in order from frame 0 to 100. I had to code some string formatting so it works.
Source code is here:
Rem Project: Image sequencer
Rem Created: Sunday, March 18, 2012
Rem ***** Main Source File *****
SET DISPLAY MODE desktop width(),desktop height(),32
SET WINDOW OFF
dirn as string
filen as string
print "You can exit anytime by pressing ESC!"
repeat
input "Please give a Pathname of a sequence: ", dirn
if path exist(dirn)=0 then print "Invalid Path!"
until path exist(dirn)=1
set dir dirn
print "Path found!"
repeat
input "Please give a seq filename without the numbers: ", filen
if file exist(filen+"-000000.jpg")=0 then print "File not found!"
until file exist(filen+"-000000.jpg")=1
print "Sequence Found! Press SPACE to load"
print "the sequence into memory. ESC to exit."
repeat
until scancode()=57
REM check loading times!
Load_time_measure = timer()
n as integer //n is just for the for-loop
imgC as integer //ImgC counts the loaded images
MAXIMG=2000 //Just to make sure there's no overflow... not tested.
for n = 0 to MAXIMG-1
FileZeros$=""
REM Filename format needs some.. formatting for DB
zeros_in_filename = 6 - len(str$(n))
for m = 1 to zeros_in_filename
FileZeros$ = FileZeros$ + "0"
next m
REM Constructing the right filename format to load.
REM Check if file exists, then load it.
if file exist(filen+"-"+FileZeros$+str$(n)+".jpg")=1
Load image filen+"-"+FileZeros$+str$(n)+".jpg",n+1
imgC=imgC+1
cls
print "Loading frames..."
print "frames loaded: " + str$(imgC)
sync
else
n = MAXIMG
endif
next n
REM EXIT the seq directory
set dir ".."
REM LOADING RESULTS!
Load_time_measure = (timer() - Load_time_measure) / 1000
print "Loading time was: " + str$(Load_time_measure) + " Secs!"
print "loaded image count: " + str$(imgC)
print "Press ENTER to continue"
repeat
until scancode()=28
REM ============================================================
REM Now, images are loaded. Time to create a plane to playback
REM SEQ as a texture.
REM ============================================================
backdrop on
color backdrop 0
make object plain 1,16,9 // Clever 16:9 aspect ratio ;D
set object light 1,0
position object 1,0,0,0
position camera 0,2.25,-13
point object 1,camera position x(), camera position y(), camera position z()
sync on
REM this should equal the videofile's own FPS so it will run in realtime.
sync rate 25
frame_atm as integer //Frame counter
max_frames as integer //MAX frames, just to make things more clear.
max_frames = imgC
repeat
set cursor 0,0
print "Press Space to playback the video."
print "exit with ESC or ENTER..."
sync
until scancode()=57
REM Video playback loop
repeat
frame_atm=frame_atm+1
if frame_atm>max_frames then frame_atm=1
texture object 1,frame_atm
set cursor 0,0
print "FPS: " + str$(screen fps())
print "frame: " + str$(frame_atm)
sync
until returnkey()=1
REM THE END
But better example can be found in my attachment. It includes a small videoclip of my dog running in the forest
Note that the resolution is 384*280, that's rather small res, and still it loads 140 frames pretty slowly. That's bad. with DVD-quality the loading time was horrible, so if you need fast loading, this is not the way to do it. But hey, this works and gives you detailed access to frames! ^^
And another bad thing about this. 140 frames of 384*280 images suck ~100M of memory. that means a 1 GB with 1400 frames...
To test the sample vid, run the application, and when it asks dir/Path, type in just "sample" and the filename is just "dog"!
EDIT: Looks like load image's attribute "texture flag" set to 1(to retain pixel perfect quality) speeds up loading enormously. Also it actually lowers the memory needed abit. Somehow "divide texture" attribute doesn't lower the memory needed, even when DBPRO help says it should.
hmmmh.. that didn't compile