Recent

Author Topic: MPlayer Component, suitable for Linux and Windows  (Read 14113 times)

six1

  • Full Member
  • ***
  • Posts: 117
MPlayer Component, suitable for Linux and Windows
« on: March 24, 2014, 08:37:32 pm »
The MPlayer Component from Mattias Gaertner now also works for Lazarus/Windows Combination.

I needed a Cross Component for playing videos on a x86 X-System and also on x86 Microsoft Windows, so i decieded to push up the great working Component from Mattias.

New is the Property "MPlayerPath". For X-System leave it blank ( Player1.MPlayerPath :=''; ) but on a Microsoft Windows System, you have to fill it with a valid Path to mplayer.exe installation.
Also new is the Property "StartParam". This is for starting mplayer with special arguments like "-zoom".

Sample for Setup the Player:
  {$IFDEF Linux}
   MPlayerControl1.MPlayerPath:='';
   MPlayerControl1.StartParam:='-vo x11 -zoom -fs';
  {$else $IFDEF Windows}
   // Download MPlayer generic for Windows and save under Programm Folder Directory
   // http://sourceforge.net/projects/mplayer-win32/
   //Download MPlayer WIN32-Generic
   MPlayerControl1.MPlayerPath:=extractfilepath(application.exename)+'MPlayer/mplayer.exe' ;
   MPlayerControl1.StartParam:='-zoom -fs';
  {$endif}

Download MPlayer generic for Windows: http://sourceforge.net/projects/mplayer-win32/





Edit 2024/02:
Do to Problems with LAZ Versions >=2.2 on Linux , MplayerComponent was patched on Lazarus CCR
https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/mplayer/
Thanks to wp_xyz!



Hope, it will be usefull.
Best regards, Michael
« Last Edit: March 05, 2024, 09:34:07 am by six1 »

mattias

  • Administrator
  • Full Member
  • *
  • Posts: 184
    • http://www.lazarus.freepascal.org
Re: MPlayer Component
« Reply #1 on: March 26, 2014, 02:27:49 am »
I did  a few improvements: I fixed the default file name under Linux, less hints, better error handling and better quoting the file name.

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: MPlayer Component, suitable for Linux and Windows
« Reply #2 on: July 16, 2014, 09:03:11 pm »
The mplayer package now supports reading of video file properties and has all the usual events and methods you'd expect from a video player control.

A page on the wiki has been created: http://wiki.lazarus.freepascal.org/TMPlayerControl  (I've been meaning to add a usage notes section, but haven't got around to it and I'm out of time for now).

Recent changes have been tested on Windows 7/8 quite extensively, and, well, lightly under Linux.

Frame Capture under Windows seems to work best with the Direct3D renderer (TMPlayer1.StartParam := '-vo direct3d'), but under Linux (where you have to use '-vo x11') seems hit and miss...

The package also has a new demo that implements a fairly comprehensive video player (it's even got wheel mouse scroll for controlled stepping through the video (back or forth in 1/3 second increments), I work with underwater inspection video, wheel mouse scroll is very useful in this area).  See examples\FullFeatured\mplayerTestHarness.lpr
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

Kamau

  • Jr. Member
  • **
  • Posts: 67
  • Old Delphi programmer
Re: MPlayer Component, suitable for Linux and Windows
« Reply #3 on: January 22, 2019, 03:42:49 pm »
Hope, it will be usefull.
Best regards, Michael

Very good! Thank you for this information.

/Kamau

jipété

  • Full Member
  • ***
  • Posts: 113
Re: MPlayer Component, suitable for Linux and Windows
« Reply #4 on: December 10, 2022, 12:24:11 am »
Hi,
The MPlayer Component from Mattias Gaertner now also works for Lazarus/Windows Combination.
Not now, Mattias...

I've searched the internet for MPlayer coz' I have many old Delphi working sources using TMPlayer and PlaySound, and I wanted to convert these programs to Linux (Debian 11.5 64 bits with the last Lazarus) and I've found that topic.

But...
I downloaded the files from the 4th link of the first post (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/mplayer/)
I installed MPlayerCtrl, with a problem in MPlayerCtrl.pas... : "Wrong number of parameters" here (line 835) :
Code: Pascal  [Select][+][-]
  1.     WidgetInfo := GetWidgetInfo(NewWidget,true); // destroyed in MPLayerWidgetDestroyCB
So I commented out that line and added another one :
Code: Pascal  [Select][+][-]
  1.     WidgetInfo := GetWidgetInfo(NewWidget); // jpt

Restarted install = OK but now, the new line causes SIGSEGV with the example found in http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/mplayer/
img_sigsegv

mouse on LCLObject displays the following :
img_mouseon

So I tried the following : reboot computer, start Lazarus, create a new application, open Multimedia tab and double-click on the TMPlayer icon, a component is drawn on form, ok, so F9 and ACCESS VIOLATION at line 837 of MPlayerCtrl.pas...

And if I try to move up the Multimedia tab from ide menu / Tools / Options / Components' Palette, when I close the Options dialog, ide crashes.
img_crash_lazarus

In 3rd post I read
See examples\FullFeatured\mplayerTestHarness.lpr
Nothing like that in my computer (Debian 11.5, FPC 3.2.2, Laz 2.2.4)...

Dunno what to do now...

Thanks for help

PS : i run under X/gtk2, as required by the ReadMe.

PPS out of topic : how to insert images in text ?
« Last Edit: December 10, 2022, 12:37:55 am by jipété »

six1

  • Full Member
  • ***
  • Posts: 117
Re: MPlayer Component, suitable for Linux and Windows
« Reply #5 on: December 10, 2022, 01:05:41 am »
Hi,
my System ist LAZ 2.0.13 FPC 3.2.2 and MPlayer is working without Problems.
Maybe you can give it a try to install this LAZ/FPC Version with fpcupdeluxe?
Also install latest MPlayer Component with OPM.

( https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/v2.2.0n )

Michael

jipété

  • Full Member
  • ***
  • Posts: 113
Re: MPlayer Component, suitable for Linux and Windows
« Reply #6 on: December 10, 2022, 08:46:01 am »
Hello,

thanks for your reply.

Hi,
my System ist LAZ 2.0.13 FPC 3.2.2 and MPlayer is working without Problems.
Linux or Windows or Mac ?

Also install latest MPlayer Component with OPM.
At the time of my first try, I didn't noticed that mplayer was not uptodate, looking inside OPM :
img mplayer_compatibility
I'm running 2.2.4 / 3.2.2

Waiting for a new release, let us know here.
« Last Edit: February 19, 2024, 08:17:43 am by jipété »

six1

  • Full Member
  • ***
  • Posts: 117
Re: MPlayer Component, suitable for Linux and Windows
« Reply #7 on: December 10, 2022, 09:35:08 pm »
I'm using it in both worlds inside a Project wich compiles for WIN and LINUX (Debian 11.x)
I'm able to compile the Project under WIN or LINUX.

six1

  • Full Member
  • ***
  • Posts: 117
Re: MPlayer Component, suitable for Linux and Windows
« Reply #8 on: February 18, 2024, 09:08:57 am »
Hi,
i installed the new Lazarus 3.0 fpc 3.2.2
After installing MPlayer, i got same Error as jipété
Changing WidgetInfo := GetWidgetInfo(NewWidget,true);  to  GetWidgetInfo(@NewWidget);, Lazarus is starting only with "startlazarus" and crashing by starting it with "lazarus"
A form with MPlayer Komponent on it can't be shown in Designer, .lfm Form File is only displayed in Code Editor!

Maybe you will have a look at it @Mattias?  ...or someone else has any Idea?
« Last Edit: February 18, 2024, 09:13:44 am by six1 »

six1

  • Full Member
  • ***
  • Posts: 117
Re: MPlayer Component, suitable for Linux and Windows
« Reply #9 on: February 23, 2024, 03:03:44 pm »
Hello,
I'm not able to fix the GTK2 relatet stuff so I decided to replace it with an "Helper" component.
The included Mplayer component works on Linux and also on Windows with LAZ 2.x and LAZ 3.0

See first Post for downloading...


« Last Edit: February 25, 2024, 08:53:51 am by six1 »

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: MPlayer Component, suitable for Linux and Windows
« Reply #10 on: February 28, 2024, 10:11:14 am »
Many thanks @Six1 for uploading a CCR patch to the bugtracker (I was going to say Mantis there, showing my age...)

https://gitlab.com/freepascal.org/lazarus/ccr/-/issues/39070
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

six1

  • Full Member
  • ***
  • Posts: 117
Re: MPlayer Component, suitable for Linux and Windows
« Reply #11 on: March 04, 2024, 01:26:25 pm »
MPlayer Component is patched and working on Linux and Windows!
Thanks to wp_xyz!

 

TinyPortal © 2005-2018