Recent

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

six1

  • Full Member
  • ***
  • Posts: 114
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/




You can download the Component and Example for MPlayer at here:
http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/mplayer/



Hope, it will be usefull.
Best regards, Michael
« Last Edit: June 06, 2014, 06:48:58 am by six1 »

mattias

  • Administrator
  • Full Member
  • *
  • Posts: 180
    • 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: 1256
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é

  • Jr. Member
  • **
  • Posts: 55
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: 114
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é

  • Jr. Member
  • **
  • Posts: 55
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.

six1

  • Full Member
  • ***
  • Posts: 114
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.

 

TinyPortal © 2005-2018