PlayMovie on a Screen

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
THCM
Enthusiast
Enthusiast
Posts: 276
Joined: Fri Apr 25, 2003 5:06 pm
Location: Gummersbach - Germany
Contact:

PlayMovie on a Screen

Post by THCM »

Hi, I know there are a few workarounds for displaying on a screen, but I can't get a Movie played fullscreen with hardware-interpolation. I get jerky playback and tearing, because the playback of the movie is in a window and it seems to use gdi for output!

Fred, can you please use DirectVideo or DirectShow (uses Hardware-capabilities of the gfx-card) for this?

Yours
The Human Code Machine / Masters' Design Group
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Open a screen then try this:

Code: Select all

;-PlayAvi
playavi  :
FlipBuffers()
ClearScreen(0,  0, 0)
FlipBuffers()

If InitMovie()
  LoadMovie(0,  #gfx  + "title.avi")
  ClearScreen(0,  0, 0)
  Delay(1000)
  PlayMovie(0,  ScreenID())
  Repeat
    Delay(1)
  Until MovieStatus()=MovieLength() - 2
  FreeMovie(0)
  ClearScreen(0,  0, 0)
EndIf
Return
THCM
Enthusiast
Enthusiast
Posts: 276
Joined: Fri Apr 25, 2003 5:06 pm
Location: Gummersbach - Germany
Contact:

Post by THCM »

Hi Num3,

your example works exactly, how I play my movies at the moment! But it doesn't use the Hardware-Stretch from the graphics-card! It simply scales the output and pageflipping is not performed during the vertical-blank and causes a lot of tearing on the screen!

So, what's your point with your example?

Greetings
The Human Code Machine / Masters' Design Group
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

THCM wrote:So, what's your point with your example?
The point was to help you..

About the full screen player with hardware support, I will investigate this.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

The jerkyness can be due to a lot of things...
The AVI CODEC for one....
Problems with the movie stream....
Bad encoding...

For my game i'm using a 640x320x24bit divx intro and it plays smooth....
THCM
Enthusiast
Enthusiast
Posts: 276
Joined: Fri Apr 25, 2003 5:06 pm
Location: Gummersbach - Germany
Contact:

Post by THCM »

I tried with a simple Mpeg1 Stream, because I want to have movie-support without the need to install a codec. Even Windows 98 can play .mpg files! The tearing has nothing to do with the codec. The problem is, that no pageflipping is used.

Yours
The Human Code Machine / Masters' Design Group
Post Reply