Page 1 of 1

RenderMovieFrame()

Posted: Sun Jul 20, 2003 1:35 pm
by LCD
Maybe I´m too stupid to understand, but why does this not work:

Code: Select all

a=LoadMovie(0,"sheknowbe_demo.mpg"):If a=0:MessageRequester("Error","Unknown movie format",0):Goto start_all:endif
length=1000
adr.l=CreateSprite(0,256,192,#PB_Sprite_Memory)
  For frame=0 To length:
MovieSeek(frame):RenderMovieFrame(adr):DisplaySprite(0,0,0):FlipBuffers()
  StatusBarText(0,3,"Frame :"+Str(frame)+"/"+Str(length),0)
  Next frame
Windowed screen is defined and working, but not a single frame from the movie can be displayed, and after 800 or so frames the program stops to count frames in status bar and hangs.
Note: I choose #PB_Sprite_Memory because I want to read out the pixels from each frame of the movie.

Posted: Mon Jul 21, 2003 5:12 pm
by LCD
Looks like nobody knows a way, so I wrote my own avi player decoder for uncompressed AVI, and it is really fast... (With fast file system), the only problem is, I don´t know where the picture data starts, it should be directly after "movi" chunk. Must find this out...

Posted: Mon Jul 21, 2003 6:03 pm
by Pupil
Yes, the stream starts right after the 'movi' identifier, the long before the identifier tells how bigg the chunk is, but you probably already figured that out...

Posted: Mon Jul 21, 2003 9:15 pm
by Karbon
I wrote my own avi player decoder for uncompressed AVI
Oooooooo.. I wanna see! :-)

Posted: Tue Jul 22, 2003 7:19 pm
by LCD
@Karbon: Believe me, you don´t want to see it. I posted one of my test-programs in bug section and everyone said that this could not be counted as source.

@Pupil: The AVI player works very nice now, the problem was that I readed the AVI header into a string, there was a lot of zeros in the header, and I´m not sure if this is a PB bug, but chr(0) has a zero length.

Code: Select all

a$="test"+chr(0)+chr(0)+chr(0)+"1"
debug len(a$)
gives me 5, while other Basic dialects give me the correct value 8.
this caused the search string to be too small and "movi" was on a wrong position... That´s not funny anymore, but a solution was found.