Page 1 of 1

Movie problems

Posted: Thu Sep 18, 2003 11:29 am
by stan
Hi,

I have tried to make a small movie player, which doesn't work Reliably (sometimes it's OK, sometimes it stop playing ...), here is the code :

Code: Select all

InitMovie()
LoadMovie( 1, "output.avi")
UseMovie( 1 )

resize = 0

Width = MovieWidth()

If Width > 800
  Width = 800
  resize = 1
EndIf

Height = MovieHeight()

If Height > 600
  Height = 600
  resize = 1
EndIf

If resize = 1
  ResizeMovie(0, 0, Width, Height)
EndIf

WindowID = OpenWindow(10, 10, 10, Width, Height, #PB_Window_ScreenCentered|#PB_Window_BorderLess, "" )

If WindowID
  PlayMovie(1, WindowID)
  While MovieStatus( ) < 1 : Delay( 2 ) : Wend
  While MovieStatus() <> 0 : Delay( 1 ) : Wend
  CloseWindow(10)
  FreeMovie(1) 
EndIf

End
Could someone tell me where is my mistake ? (I've already try different delay values, with no success ...)

TIA.

Bests.

Stan.

Posted: Thu Sep 18, 2003 12:32 pm
by GPI
maybe you should add a main-loop (windowevent())

Posted: Thu Sep 18, 2003 2:32 pm
by stan
maybe you should add a main-loop (windowevent())
Thanks, but :

I also tried that (in the second loop) :

While MovieStatus() <> 0 : Delay( 1 ) : While WindowEvent() : Wend: Wend

Nothing works then ...

Do you mean adding it elsewhere ?

TIA.

Bests.

Stan.

Re: Movie problems

Posted: Thu Sep 18, 2003 3:30 pm
by PB
Your code works fine for me with MPG movies. When you say that it stops
playing, how far into the movie does this occur? Have you tried other AVIs?

Posted: Fri Sep 19, 2003 7:35 am
by stan
Hi,
Your code works fine for me with MPG movies. When you say that it stops
playing, how far into the movie does this occur? Have you tried other AVIs?
It stops randomly : using the very same AVI, it sometime works perfect twice in a row, then stop the next time anywhere, then works again fine the next time, which is puzzling (I always thought that a progarm either works or don't ...).

I've tried different AVIs (the output.avi is the default name for the program I use to make AVIs : SSMM 5.3.3) using different output Codecs,
all these AVIs run smoothly using Winamp3 or Zplayer.

Right now I solved the problem using Zplayer, but I would like to have my own player rather than Zplayer and understand why my program doesn't work ...

I am running it under Win98SE, with a Radeon 7500 (with the last available drivers), but the program I am trying to make should work under any Win version as it is intended to help my English teaching girlfriend to play a movie on any computer in her school ...

Maybe I should report it as a bug ? Unless someone sees something I missed ...

TIA.

Bests.

Stan.