[Solved] mp4 movie files

Everything else that doesn't fall into one of the other PB categories.
k3pto
User
User
Posts: 87
Joined: Sat Jan 17, 2015 5:24 pm

[Solved] mp4 movie files

Post 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?
Last edited by k3pto on Sat Aug 10, 2024 1:02 am, edited 3 times in total.
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: mp4 movie files

Post by boddhi »

Hello,

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

See this post :wink:
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Bitblazer
Enthusiast
Enthusiast
Posts: 761
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: mp4 movie files

Post by Bitblazer »

Use LibVLC
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: mp4 movie files

Post by dige »

I have seen that PB Linux already uses libVLC.
@Fred: would this also be a useful improvement for Windows?
"Daddy, I'll run faster, then it is not so far..."
infratec
Always Here
Always Here
Posts: 7576
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: mp4 movie files

Post by infratec »

On windows and mac libvlc is not natively available.
BarryG
Addict
Addict
Posts: 4122
Joined: Thu Apr 18, 2019 8:17 am

Re: mp4 movie files

Post 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.
k3pto
User
User
Posts: 87
Joined: Sat Jan 17, 2015 5:24 pm

Re: mp4 movie files

Post by k3pto »

Hi BarryG,

Would you happen to have some instructions and/or example for how to do it?
BarryG
Addict
Addict
Posts: 4122
Joined: Thu Apr 18, 2019 8:17 am

Re: mp4 movie files

Post 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
Bitblazer
Enthusiast
Enthusiast
Posts: 761
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: mp4 movie files

Post 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.
k3pto
User
User
Posts: 87
Joined: Sat Jan 17, 2015 5:24 pm

Re: mp4 movie files

Post 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!
BarryG
Addict
Addict
Posts: 4122
Joined: Thu Apr 18, 2019 8:17 am

Re: mp4 movie files

Post 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.
Post Reply