Movie Player

Just starting out? Need help? Post your questions and find answers here.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Movie Player

Post by chris319 »

What am I doing wrong here? I can't get this movie to play.

It doesn't work with either OpenGL or DirectX11.
It doesn't work in a regular window or a windowed screen.
The movie plays OK in VLC.
This code should play 10 seconds worth of movie, right?

Code: Select all

InitSprite(): InitMovie()

movieName$ = "reencoded.mp4"

OpenWindow(1,0,100,640,360,"")
;OpenWindowedScreen(WindowID(1),0,0,640,360)

If IsMovie(1)
Debug "Is movie"  
PlayMovie(1,WindowID(1)) ;: Delay(duration * 1000)
Delay(10000)
StopMovie(1)
FreeMovie(1)
EndIf
CloseWindow(1)
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4659
Joined: Sun Apr 12, 2009 6:27 am

Re: Movie Player

Post by RASHAD »

Hi

Code: Select all

InitMovie()
movieName$ = "reencoded.mp4"
LoadMovie(1, movieName$)
OpenWindow(1,0,0,MovieWidth(1),MovieHeight(1),"", #PB_Window_ScreenCentered)

PlayMovie(1,WindowID(1)) ;: Delay(duration * 1000)
Delay(10000)
StopMovie(1)
FreeMovie(1)
CloseWindow(1)
Egypt my love
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: Movie Player

Post by chris319 »

Sorry, Rashad, no joy.

Your code doesn't work, either.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4659
Joined: Sun Apr 12, 2009 6:27 am

Re: Movie Player

Post by RASHAD »

Where can I get reencoded.mp4?
Egypt my love
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: Movie Player

Post by chris319 »

Try playing any valid mp4 movie.

As I say, it plays back OK using VLC. Also with Windows Media Player.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4659
Joined: Sun Apr 12, 2009 6:27 am

Re: Movie Player

Post by RASHAD »

I did all ready

Code: Select all

InitMovie()
movieName$ = "e:\mmedia\movie\moon.mp4"
LoadMovie(1, movieName$)
OpenWindow(1,0,0,MovieWidth(1),MovieHeight(1),"", #PB_Window_ScreenCentered)

PlayMovie(1,WindowID(1)) ;: Delay(duration * 1000)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Egypt my love
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: Movie Player

Post by chris319 »

RASHAD wrote:I did all ready

Code: Select all

InitMovie()
movieName$ = "e:\mmedia\movie\moon.mp4"
LoadMovie(1, movieName$)
OpenWindow(1,0,0,MovieWidth(1),MovieHeight(1),"", #PB_Window_ScreenCentered)

PlayMovie(1,WindowID(1)) ;: Delay(duration * 1000)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Nothing.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4659
Joined: Sun Apr 12, 2009 6:27 am

Re: Movie Player

Post by RASHAD »

Then try to download and install K-Lite pack for media codecs
VLC is using it's own codecs
Egypt my love
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: Movie Player

Post by chris319 »

RASHAD wrote:Then try to download and install K-Lite pack for media codecs
VLC is using it's own codecs
I already have those.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4659
Joined: Sun Apr 12, 2009 6:27 am

Re: Movie Player

Post by RASHAD »

Try to download the next utilities maybe you can spot your problems
1- MediaInfo.exe
2- DSFMgr.exe
3- CodecTweakTool.exe

Good Luck
Egypt my love
Post Reply