PlayMovie() in OpenScreen() wont work

Just starting out? Need help? Post your questions and find answers here.
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

PlayMovie() in OpenScreen() wont work

Post by nco2k »

hi fred,

seem to be broken:

Code: Select all

If InitSprite() And InitMovie() And InitKeyboard() 
  
  File.s = OpenFileRequester("", "", "*.*", 0) 
  If File And LoadMovie(0, File) And OpenScreen(640, 480, 16, "test") 
    ResizeMovie(0, 0, 640, 480) 
    PlayMovie(0, ScreenID()) 
    
    Repeat 
      Delay(1) 
      ExamineKeyboard() 
    Until KeyboardPushed(#PB_Key_Escape) 
  EndIf 
  
EndIf
tested with 3.94 and 3.93 (thanks MVXA) without any success.

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

Code: Select all

InitSprite() 
InitMovie() 
InitKeyboard()

cFile.s = OpenFileRequester("", "", "*.avi", 0)
 
hScreen = OpenScreen(640, 480, 32, "test")
LoadMovie(0, cFile.s) 
ResizeMovie(0, 0, 640, 480)
  
PlayMovie(0,hScreen)
  
Repeat
 Delay(10)
 ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
This will show the movie but the screen is not really fullscreen, it looke more like windowedscreen... (still used hScreen instead ScreenID() - so my source is wrong!)

Code: Select all

 InitMovie() 
 InitSprite() 
 InitKeyboard()

 cFile.s = OpenFileRequester("", "", "*.avi", 0)
 
 OpenScreen(640, 480, 32, "test")
 LoadMovie(0, cFile.s) 
 ResizeMovie(0, 0, 640,480)
 PlayMovie(0,ScreenID())
 
 
Repeat
  ExamineKeyboard()
  FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
 
 Debug ScreenID()
Just tried this one.. the source isnt correct! This time i used as in DOCS mentiented the ScreenID command and tried to flipbuffer... when start program, it will open a screen, minimize, just maximize and you can see your video flickering and slow down...

i coded such a thing over 1 year ago and it worked fine (lost source by hd crash) ... so it seems to be a bug....

@Fred: I think its not correct to use PlayMovie() inside start and stopdrawing(), right!? If so, the debugger should alert this.. ;)
Last edited by va!n on Mon Nov 21, 2005 12:31 am, edited 1 time in total.
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

Here is how you get it work !!!! (i know i coded and managed to get it work long time ago ;)

Code: Select all

;-----------------------------------------------------------
; Small example how to play a movie in fullscreen DX mode
; 21-Nov-2005 (requested)
;-----------------------------------------------------------

 InitSprite() 
 InitSound()
 InitKeyboard()
 InitMovie()

 cFile.s = OpenFileRequester("", "", "*.avi", 0)
 LoadMovie(0, cFile.s) 

 OpenScreen(640, 480, 32, "Video in FullScreenMode DX")
 ResizeMovie(0, 0, 640,480)

 SpriteID = CreateSprite(0,640,480,0) 
 PlayMovie(0,#PB_Movie_Rendered)
 
Repeat
 ExamineKeyboard()
   RenderMovieFrame(SpriteID)
   DisplaySprite(0,0,0)
 FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

playing a movie on a sprite is not the problem. the problem is that PlayMovie(#Movie, ScreenID()) wont work. PlayMovie(#Movie, #PB_Movie_Rendered) is a completely different thing.

p.s.: it looks like movies can only be displayed in 32bit screen mode correctly. the 16bit screen mode seems to have serious problems with some movies/codecs. :cry:

p.p.s.: however even if you play a movie on a sprite, after task switching due alt+tab for example, the last movie frame seems to freeze and wont continue after reswitching.

Code: Select all

If InitSprite() And InitMovie() And InitKeyboard()
  
  File.s = OpenFileRequester("", "", "*.*", 0)
  If File And LoadMovie(0, File) And OpenScreen(640, 480, 32, "test")
    
    Sprite.l = CreateSprite(0, 640, 480)
    If Sprite
      
      ResizeMovie(0, 0, 640, 480)
      PlayMovie(0, #PB_Movie_Rendered)
      
      Repeat
        Delay(1)
        
        RenderMovieFrame(Sprite)
        DisplaySprite(0, 0, 0)
        FlipBuffers()
        
        ExamineKeyboard()
      Until KeyboardPushed(#PB_Key_Escape)
      
    EndIf
    
  EndIf
  
EndIf
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Post Reply