Recent

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

six1

  • Jr. Member
  • **
  • Posts: 74
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: 143
    • 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: 1249
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