RenderMovieFrame()

Just starting out? Need help? Post your questions and find answers here.
LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

RenderMovieFrame()

Post 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.
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

Post 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...
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post 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...
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

I wrote my own avi player decoder for uncompressed AVI
Oooooooo.. I wanna see! :-)
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

Post 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.
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
Post Reply