Page 1 of 1

[Solved] mp4 movie files

Posted: Fri Jul 12, 2024 12:06 am
by k3pto
Can PB show mp4 files? If so, how. I tried using the example in the Movie section of the on-line manual and it failed.
I am using PB 6.11 and Windows 10.

Thank you all for your responses. I use the VLC program to view my MP4 files. How do I install LibVLC for Pure Basic?

I found these files ( do not remember where??? ): example.pb, libvlc.pb and vlc.pb. Running example.pb works fine without the debugger. However, it crashes when I compile with the debugger. Any ideas? Also, is there any documentation for this library?

Re: mp4 movie files

Posted: Fri Jul 12, 2024 4:51 am
by boddhi
Hello,

If it doesn't work, then it's not possible (in native way) :mrgreen: :(

See this post :wink:

Re: mp4 movie files

Posted: Fri Jul 12, 2024 7:32 am
by Bitblazer
Use LibVLC

Re: mp4 movie files

Posted: Fri Jul 12, 2024 8:39 am
by dige
I have seen that PB Linux already uses libVLC.
@Fred: would this also be a useful improvement for Windows?

Re: mp4 movie files

Posted: Fri Jul 12, 2024 9:30 am
by infratec
On windows and mac libvlc is not natively available.

Re: mp4 movie files

Posted: Fri Jul 12, 2024 9:45 am
by BarryG
k3pto wrote: Fri Jul 12, 2024 12:06 amCan PB show mp4 files?
Yes, if the codec for MP4s is installed on the PC. I can view MP4s just fine inside a PureBasic window.

Re: mp4 movie files

Posted: Sun Jul 14, 2024 1:51 am
by k3pto
Hi BarryG,

Would you happen to have some instructions and/or example for how to do it?

Re: mp4 movie files

Posted: Sun Jul 14, 2024 4:07 am
by BarryG
I originally installed my video codecs from the "K-Lite Mega Codec Pack" -> https://www.codecguide.com/download_k-l ... k_mega.htm

Once installed, this example plays MP4s for me:

Code: Select all

InitMovie()

If LoadMovie(0, "C:\Path\To\Movie.mp4")
  
  OpenWindow(0, 200, 200, MovieWidth(0), MovieHeight(0), "MP4 Playback")
  PlayMovie(0, WindowID(0))
  
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  
EndIf

Re: mp4 movie files

Posted: Sun Jul 14, 2024 10:45 am
by Bitblazer
k3pto wrote: Fri Jul 12, 2024 12:06 am I found these files ( do not remember where??? ): example.pb, libvlc.pb and vlc.pb. Running example.pb works fine without the debugger. However, it crashes when I compile with the debugger. Any ideas? Also, is there any documentation for this library?
You probably refer to this which includes a documentation link.

Re: mp4 movie files

Posted: Mon Jul 15, 2024 10:28 pm
by k3pto
Hi BarryG and Bitblazer,

Thanks for the info. Using BarryG's suggestion, I installed the standard K-Lite codecs and it seems to work just fine using the Movie library within PB. Although I did get the VLC library working, I believe using the standard PB library will probably be a better long term solution.

Thanks again for all your help!

Re: mp4 movie files

Posted: Tue Jul 16, 2024 8:37 am
by BarryG
k3pto wrote: Mon Jul 15, 2024 10:28 pmI believe using the standard PB library will probably be a better long term solution.
That's not how PureBasic's Movie library works. It doesn't support any video playback itself; it just uses whatever video codecs are installed. There's no codecs included in PureBasic itself.