Movie Playing Problem (ignore)

Just starting out? Need help? Post your questions and find answers here.
RedmoonX
User
User
Posts: 26
Joined: Mon Jan 17, 2005 9:54 am
Location: Sweden
Contact:

Movie Playing Problem (ignore)

Post by RedmoonX »

hey i wants to display 2 movies in the same screen using
windowed screen

everything is setuped

but when i use this code

Code: Select all

InitMovie()
OpenWindow(0,0,0,600,300,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Application")

LoadMovie(0,"movie.avi")
LoadMovie(1,"movie.avi")
    
UseMovie(0) : ResizeMovie(0,0,300,300)
UseMovie(1) : ResizeMovie(300,0,300,300)

PlayMovie(0,WindowID(0))
PlayMovie(1,WindowID(0))

Repeat : Until WindowEvent()=#PB_Event_CloseWindow

then when i drag the window ill see bth movies with some flash and if i stp dragging i only see 1 movie!

is there anyway t oshow 2 movies on the same window on the same time
??

RedmoonX
Last edited by RedmoonX on Wed Jan 26, 2005 7:55 pm, edited 2 times in total.
^^
-
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Post by Paul »

is there anyway t oshow 2 movies on the same window on the same time
Yes but you must understand what you are doing.

You must decide if you are going to display the movie on a window or on a directX screen. In your above code, you setup a DirectX screen but you tell it to draw the movie on the Window, and at the same time flipping directX screens. (giving you flicker)

If you are displaying movie on a Window, it would look like this:

Code: Select all

InitMovie()

If OpenWindow(0,0,0,640,240,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Screen 1")

    LoadMovie(0,"vid1.mpg")
    LoadMovie(1,"vid2.mpg")

    UseMovie(0)
    ResizeMovie(0,0,320,240)
    UseMovie(1)
    ResizeMovie(320,0,320,240)

    PlayMovie(0,WindowID(0))
    PlayMovie(1,WindowID(0))

    Repeat 
    Until WaitWindowEvent()=#PB_Event_CloseWindow
    
EndIf

If you want to display on a DirectX screen it would look like this:

Code: Select all

InitSprite()
InitMovie()

If OpenWindow(0,0,0,640,240,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"Screen 1")
  If OpenWindowedScreen(WindowID(0),0,0,640,240,0,0,0)

    LoadMovie(0,"vid1.mpg")
    LoadMovie(1,"vid2.mpg")

    UseMovie(0)
    ResizeMovie(0,0,320,240)
    UseMovie(1)
    ResizeMovie(320,0,320,240)

    PlayMovie(0,ScreenID())
    PlayMovie(1,ScreenID())

    Repeat 
    Until WaitWindowEvent()=#PB_Event_CloseWindow
    
  EndIf
EndIf

Now, if you want to combine graphics/sprites with your movie, then you must render the movie to a sprite and display the sprite along with any other graphics and use FlipBuffers() to bring it into view.


Once again, it is best to read through the entire help file. You will learn lots!!!
RedmoonX
User
User
Posts: 26
Joined: Mon Jan 17, 2005 9:54 am
Location: Sweden
Contact:

Post by RedmoonX »

hehe i just maked almost the same thing before i looked at ur reply
and it worked


EDIT: :o

i tryed again with my code and with ur code and it wont show both movies
it only show one of the,

:D

thx
:wink:
^^
-
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Post by Paul »

Oh well... my example works fine here ;)
RedmoonX
User
User
Posts: 26
Joined: Mon Jan 17, 2005 9:54 am
Location: Sweden
Contact:

Post by RedmoonX »

try my code then its identcly but it wont work for me :cry:
i have demo version

the first movie gets black and then the next starts but first is black

and when i drag the window around i see both movies with much
fliks on the screen

and when i see one of the 2 movies it goes very laggy

may be my graphics card its INTREGRATED 64 mb
^^
-
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Post by Paul »

You might as well delete this entire thread since you basically changed your original post to what I posted as a reply. Anyone trying to follow this thread will get confused because the replies no longer seem relevant to the original post. :(

If you are going to make changes post them as a new reply, don't go back and modify the original post.


Now, many things can affect the playback of video streams. CPU speed, video card, how much you are scaling compared to original size, etc.
Also the demo version forces the debugger ON so much speed is lost.
RedmoonX
User
User
Posts: 26
Joined: Mon Jan 17, 2005 9:54 am
Location: Sweden
Contact:

Post by RedmoonX »

okay ill try when i get a full version
^^
-
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

In your code you use WindowEvent() instead of WaitWindowEvent() (Paul use WaitWindowEvent()). That's a big difference... BTW, uppercase topic titles should be avoided, it hurts my sight ;)
Fred - AlphaSND
Post Reply