Author Topic: PasLibVLC  (Read 374 times)

geraldholdsworth

  • Sr. Member
  • ****
  • Posts: 308
PasLibVLC
« on: September 01, 2026, 07:52:50 pm »
Has anyone managed to get PasLibVLC to play a video on Lazarus on a Mac?

I've got Windows doing it, but can't get macOS to play ball.

I tried the supplied VLC player, that comes with Lazarus, but that won't even install on 4.8.

I've given up for now and moved the production of this particular program over to my work's Windows laptop, so this is now just more of a curiosity.

n7800

  • Hero Member
  • *****
  • Posts: 779
  • Lazarus IDE contributor
    • GitLab profile
Re: PasLibVLC
« Reply #1 on: September 01, 2026, 10:12:12 pm »
As far as I know, PasLibVLC (repository) and the LazVLC from the Lazarus folder are different packages:

* LazVLC: judging by the README, it support only Windows and Linux. I don't know how much work would be required to port it.

* PasLibVLC doesn't mention any platform support, but judging by the code, it should.

Have you tried using that specific package?

geraldholdsworth

  • Sr. Member
  • ****
  • Posts: 308
Re: PasLibVLC
« Reply #2 on: September 02, 2026, 09:03:55 am »
Have you tried using that specific package?
The PasLibVLCPlayer.lpk? Yep. Installed fine. Just doesn't play videos - all I get is a black image.

Thaddy

  • Hero Member
  • *****
  • Posts: 19805
  • Glad to be alive.
Re: PasLibVLC
« Reply #3 on: September 02, 2026, 09:12:09 am »
Have you tried using that specific package?
The PasLibVLCPlayer.lpk? Yep. Installed fine. Just doesn't play videos - all I get is a black image.
I will try and test it later this week. My M4 is in need of the latest updates and I do not have time now. But I promise I will test: that was the whole purpose of buying the M4 mini in the first place. To me it is just a toy, a good one, but a toy. But I know it is a serious compute too.
« Last Edit: September 02, 2026, 09:13:57 am by Thaddy »
Any "programmer" that knows only one programming language is not a programmer

Zvoni

  • Hero Member
  • *****
  • Posts: 3532
Re: PasLibVLC
« Reply #4 on: September 02, 2026, 09:13:51 am »
*snip*
* PasLibVLC doesn't mention any platform support, but judging by the code, it should.
*snip*
Have you tried using that specific package?
The PasLibVLCPlayer.lpk? Yep. Installed fine. Just doesn't play videos - all I get is a black image.

Line 59 in PasLibVlcUnit:
Carbon??

One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

geraldholdsworth

  • Sr. Member
  • ****
  • Posts: 308
Re: PasLibVLC
« Reply #5 on: September 03, 2026, 01:48:14 pm »
I'm thinking (stupid, I know) - shouldn't it be a simple case of just talking to the dynamic library libvlc.5.dylib, in just the same way as the Linux version talks to libvlc.so.5 and Windows to libvlc.dll and libvlccore.dll?
Just need to know the procedure/function/event names.

OK, it probably shows that I've only ever written a (Delphi) program to talk to a DLL once.

Inside the VLC application bundle (Contents/MacOS/include/vlc) are the C header files with all, I presume, that is required. The dylibs themselves are inside Contents/MacOS/lib.

n7800

  • Hero Member
  • *****
  • Posts: 779
  • Lazarus IDE contributor
    • GitLab profile
Re: PasLibVLC
« Reply #6 on: September 03, 2026, 10:28:56 pm »
I'm thinking (stupid, I know) - shouldn't it be a simple case of just talking to the dynamic library libvlc.5.dylib, in just the same way as the Linux version talks to libvlc.so.5 and Windows to libvlc.dll and libvlccore.dll?
Just need to know the procedure/function/event names.

OK, it probably shows that I've only ever written a (Delphi) program to talk to a DLL once.

Inside the VLC application bundle (Contents/MacOS/include/vlc) are the C header files with all, I presume, that is required. The dylibs themselves are inside Contents/MacOS/lib.

Yes, that's what packages are for. They wrap direct library calls and add simple classes for easy management. They also provide LCL components for player customization directly in the Designer and Object Inspector.

geraldholdsworth

  • Sr. Member
  • ****
  • Posts: 308
Re: PasLibVLC
« Reply #7 on: September 09, 2026, 11:43:50 am »
I contacted the author of PasLibVlc, but it looks like he is not very willing to adapt his code for modern macOS. He's only suggestion is to use
Code: Pascal  [Select][+][-]
  1. {$IFDEF Darwin}{$DEFINE MACOS}{$ENDIF}
  2. {$IFDEF Linux}{$DEFINE UNIX}{$ENDIF}
But I think we'd need to undefine UNIX when run in Darwin.

However, I've found this player which works quite well. So, I've been looking on how to expand it to add things like getting the current timecode and responding to events. However, the example code doesn't expose any events from the underlying library, and I'm not sure how to implement them in Lazarus. Looking at the Apple links at the bottom of the page, there does appear to be events available.

Can anyone help please?
(hopefully, just the one example will do which should give me an idea on how to do the rest - end of media play would be a good one to start with)

 

TinyPortal © 2005-2018