How can i fix MCI\Movie Lib Video playback on Win10?

Just starting out? Need help? Post your questions and find answers here.
BarryG
Addict
Addict
Posts: 3268
Joined: Thu Apr 18, 2019 8:17 am

Re: How can i fix MCI Video playback on Win10?

Post by BarryG »

novablue wrote:if i leave the handle open and load the same video again or any other video after that it plays perfectly fine.
So the SAME video works in the same media player process instance on the SECOND play? That definitely isn't a codec problem, then. Any chance of a link to the video so we can test?
novablue
Enthusiast
Enthusiast
Posts: 165
Joined: Sun Nov 27, 2016 6:38 am

Re: How can i fix MCI Video playback on Win10?

Post by novablue »

But why would only the first load fail if it was a codec problem? I don't get it, i just have to except this workaround until windows 10 breaks it even more lol.
novablue
Enthusiast
Enthusiast
Posts: 165
Joined: Sun Nov 27, 2016 6:38 am

Re: How can i fix MCI Video playback on Win10?

Post by novablue »

BarryG wrote:
novablue wrote:if i leave the handle open and load the same video again or any other video after that it plays perfectly fine.
So the SAME video works in the same media player process instance on the SECOND play? That definitely isn't a codec problem, then. Any chance of a link to the video so we can test?
Yess exactly thank you! i can load 10 videos after that and they all will work. and i really don't need to send an example it happens with any video/png/jpg. the first time there wont be a picture but if i leave the handle open to the loaded video and keep loading more videos with a new handle it will all work from that point on and give me a picture.
BarryG
Addict
Addict
Posts: 3268
Joined: Thu Apr 18, 2019 8:17 am

Re: How can i fix MCI Video playback on Win10?

Post by BarryG »

Have you tried your problem on a different PC (sorry if you said this)? Just to rule out if your single PC is the problem, rather than PureBasic or codecs and so on.
novablue
Enthusiast
Enthusiast
Posts: 165
Joined: Sun Nov 27, 2016 6:38 am

Re: How can i fix MCI Video playback on Win10?

Post by novablue »

I have 2 windows 10 machines it doesnt work on either of them, in windows 7 vm it works fine like it used to.

i hope i am explaining myself good enough,
here is another example anyone can use:

Code: Select all

InitMovie()

#Film1 = 0
#Film2 = 1
#Film3 = 2

MovieName$ = "C:\Program Files\PureBasic\Examples\Sources\Data\PureBasicLogo.gif"

OpenWindow(0, 100, 150, 381, 381, "PureBasic - Movie")

LoadMovie(#Film1, MovieName$)  ; load as "dummy video" to fix future videos
PlayMovie(#Film1, WindowID(0)) ; Broken! will play a Blank video, the following videos also work with this line commented out
;FreeMovie(#Film1)             ; If i close here Film2 won't have a picture either and only Film3 will play fine, otherwise both work

LoadMovie(#Film2, MovieName$)
PlayMovie(#Film2, WindowID(0))  ; Plays Fine with picture

LoadMovie(#Film3, MovieName$)
PlayMovie(#Film3, WindowID(0))  ; Plays Fine with picture
ResizeMovie(#Film3, 0, 0, 100, 100)

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
BarryG
Addict
Addict
Posts: 3268
Joined: Thu Apr 18, 2019 8:17 am

Re: How can i fix MCI Video playback on Win10?

Post by BarryG »

Your code works normally here on Win 10 (the PureBasic logo rotates).
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: How can i fix MCI Video playback on Win10?

Post by Marc56us »

:idea: Check your DirectX installation

:arrow: Win + R then type dxdiag and wait some seconds

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

Re: How can i fix MCI Video playback on Win10?

Post by Paul »

Yess exactly thank you! i can load 10 videos after that and they all will work. and i really don't need to send an example it happens with any video/png/jpg. the first time there wont be a picture but if i leave the handle open to the loaded video and keep loading more videos with a new handle it will all work from that point on and give me a picture.
I can confirm this exact behavior on Windows 10.
Yes it is quite frustrating and the only way I have been able to solve this issue is to do exactly what you have done, load a dummy file first then everything after that plays as expected... 4k down to SD
Image Image
novablue
Enthusiast
Enthusiast
Posts: 165
Joined: Sun Nov 27, 2016 6:38 am

Re: How can i fix MCI Video playback on Win10?

Post by novablue »

Marc56us wrote::idea: Check your DirectX installation

:arrow: Win + R then type dxdiag and wait some seconds

:wink:
I recently just updated my DirectX version but it didn't change anything. I am running a fresh Win10 install with latest drivers and windows updates and so on.
Paul wrote:
Yess exactly thank you! i can load 10 videos after that and they all will work. and i really don't need to send an example it happens with any video/png/jpg. the first time there wont be a picture but if i leave the handle open to the loaded video and keep loading more videos with a new handle it will all work from that point on and give me a picture.
I can confirm this exact behavior on Windows 10.
Yes it is quite frustrating and the only way I have been able to solve this issue is to do exactly what you have done, load a dummy file first then everything after that plays as expected... 4k down to SD
Would you mind telling what exact version of Windows 10 you are running? Maybe it is a problem with LTSC?
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4622
Joined: Sun Apr 12, 2009 6:27 am

Re: How can i fix MCI Video playback on Win10?

Post by RASHAD »

Hi novablue
This problem happened to me before but I do not remember how I fixed it
- Run PB x86
- run any snippet
- Open another tab
- Insert MCI code into the second tab and run it

Then please report
Egypt my love
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1243
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: How can i fix MCI Video playback on Win10?

Post by Paul »

novablue wrote: Would you mind telling what exact version of Windows 10 you are running? Maybe it is a problem with LTSC?
Main computer is Windows 10 Home build 1909. Also tested on another computer running Windows 10 Home build 2004.

I have a laptop running Windows 8.1 Home and another running Windows 7 Home Premium and the same code on those play back video perfectly.
It's only my Windows 10 machines which require the "load a null clip first" hack before it will play all other video.
The videos I am playing are all 1080P, 2K & 4K ... MP4 format.
Image Image
novablue
Enthusiast
Enthusiast
Posts: 165
Joined: Sun Nov 27, 2016 6:38 am

Re: How can i fix MCI Video playback on Win10?

Post by novablue »

RASHAD wrote:Hi novablue
This problem happened to me before but I do not remember how I fixed it
- Run PB x86
- run any snippet
- Open another tab
- Insert MCI code into the second tab and run it

Then please report
Interesting, running "any snipped" did not work BUT i found out the "dummy file" does not even have to be in the same process to fix it.

Example first i run this and don't close the program:

Code: Select all

InitMovie()

#Film1 = 0

MovieName$ = "C:\Program Files\PureBasic\Examples\Sources\Data\PureBasicLogo.gif"

OpenWindow(0, 100, 150, 381, 381, "PureBasic - Movie")

LoadMovie(#Film1, MovieName$)

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
then i run in a new tab this and it will correctly play both videos:

Code: Select all

InitMovie()

#Film1 = 0
#Film2 = 1

MovieName$ = "C:\Program Files\PureBasic\Examples\Sources\Data\PureBasicLogo.gif"

OpenWindow(0, 100, 150, 381, 381, "PureBasic - Movie")

LoadMovie(#Film1, MovieName$)
PlayMovie(#Film1, WindowID(0))

LoadMovie(#Film2, MovieName$)
PlayMovie(#Film2, WindowID(0))
ResizeMovie(#Film2, 0, 0, 100, 100)

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
In both programs it does not even have to be the same video again. this means to fix this globally, running a program at windows startup that loads a random video and then stays open in the background would fix any other program with this issue. All these workarounds work fine but the question to WHY this even happens remains :lol:
Last edited by novablue on Sun Oct 04, 2020 7:33 am, edited 1 time in total.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4622
Joined: Sun Apr 12, 2009 6:27 am

Re: How can i fix MCI Video playback on Win10?

Post by RASHAD »

Hi novablue
Make sure that NT4.0 and DirectX v7.0 are installed
Egypt my love
novablue
Enthusiast
Enthusiast
Posts: 165
Joined: Sun Nov 27, 2016 6:38 am

Re: How can i fix MCI Video playback on Win10?

Post by novablue »

RASHAD wrote:Hi novablue
Make sure that NT4.0 and DirectX v7.0 are installed
On Windows 10? :shock:
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4622
Joined: Sun Apr 12, 2009 6:27 am

Re: How can i fix MCI Video playback on Win10?

Post by RASHAD »

:mrgreen:
- Search the web for dxwebsetup.exe it may help
Egypt my love
Post Reply