Recent

Author Topic: [SOLVED] MPLayer SendCommand  (Read 2396 times)

Pe3s

  • Hero Member
  • *****
  • Posts: 641
[SOLVED] MPLayer SendCommand
« on: September 08, 2023, 08:53:24 am »
Hello, I have a question. Does anyone on the forum know how to set the brightness and contrast in the MPlayer component? I checked SendMplayerCommand but it doesn't work.
« Last Edit: September 08, 2023, 06:31:14 pm by Pe3s »

Zvoni

  • Hero Member
  • *****
  • Posts: 3242
Re: MPLayer SendCommand
« Reply #1 on: September 08, 2023, 09:16:40 am »
Hello, I have a question. Does anyone on the forum know how to set the brightness and contrast in the MPlayer component? I checked SendMplayerCommand but it doesn't work.
?
http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html#VIDEO%20OUTPUT%20OPTIONS%20(MPLAYER%20ONLY)

Brightness and Contrast are commandline-Options
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

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: MPLayer SendCommand
« Reply #2 on: September 08, 2023, 09:25:51 am »
Brightness and Contrast are commandline-Options
Though no experience with MPlayer or the control, I respectfully disagree (because of available documentation).

Here is displayed a list of slave commands and though you are correct that they are commandline arguments they also appear in that list as properties (at  "Available properties:") and there f.e. the brightness is listed as get/set and step. That is unless I misinterpreted the X'es in exactly the wrong way (e.g. X means unsupported).

So to my knowledge you can set/get/step with get_property, set_property and step_property ?



I would have preferred testing/checking this myself but unfortunately:

Code: [Select]
Hint: (11030) Start of reading config file /home/apps/fpc/fpc.cfg
Hint: (11031) End of reading config file /home/apps/fpc/fpc.cfg
Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling mplayercontrollaz.pas
(3104) Compiling mplayerctrl.pas
/home/apps/lazarus/2.3.0/.lazconfig/onlinepackagemanager/packages/mplayer0.1.2/mplayerctrl.pas(171,26) Hint: (5024) Parameter "Sender" not used
/home/apps/lazarus/2.3.0/.lazconfig/onlinepackagemanager/packages/mplayer0.1.2/mplayerctrl.pas(643,44) Hint: (4055) Conversion between ordinals and pointers is not portable
/home/apps/lazarus/2.3.0/.lazconfig/onlinepackagemanager/packages/mplayer0.1.2/mplayerctrl.pas(709,3) Note: (6058) Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
/home/apps/lazarus/2.3.0/.lazconfig/onlinepackagemanager/packages/mplayer0.1.2/mplayerctrl.pas(777,3) Note: (6058) Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
/home/apps/lazarus/2.3.0/.lazconfig/onlinepackagemanager/packages/mplayer0.1.2/mplayerctrl.pas(809,5) Note: (6058) Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
/home/apps/lazarus/2.3.0/.lazconfig/onlinepackagemanager/packages/mplayer0.1.2/mplayerctrl.pas(815,58) Hint: (5024) Parameter "data" not used
/home/apps/lazarus/2.3.0/.lazconfig/onlinepackagemanager/packages/mplayer0.1.2/mplayerctrl.pas(835,19) Error: (3026) Wrong number of parameters specified for call to "GetWidgetInfo"
/home/apps/lazarus/2.3.0/lcl/units/x86_64-linux/gtk2/gtk2proc.ppu:gtk2proc.inc(4156,10) Error: (5088) Found declaration: GetWidgetInfo(const Pointer):^TWidgetInfo;
/home/apps/lazarus/2.3.0/.lazconfig/onlinepackagemanager/packages/mplayer0.1.2/mplayerctrl.pas(839,33) Hint: (4055) Conversion between ordinals and pointers is not portable
/home/apps/lazarus/2.3.0/.lazconfig/onlinepackagemanager/packages/mplayer0.1.2/mplayerctrl.pas(856,23) Hint: (4055) Conversion between ordinals and pointers is not portable
mplayerctrl.pas(876) Fatal: (10026) There were 2 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: /home/apps/fpc/3.2.2/bin/x86_64-linux/ppcx64 returned an error exitcode

For both Lazarus 2.2.6 and 3.0RC1
« Last Edit: September 08, 2023, 01:49:33 pm by TRon »
Today is tomorrow's yesterday.

Pe3s

  • Hero Member
  • *****
  • Posts: 641
Re: MPLayer SendCommand
« Reply #3 on: September 08, 2023, 05:59:21 pm »
for example, the volume command works

Code: Pascal  [Select][+][-]
  1. MPlayer.SendMPlayerCommand('volume ' + IntToStr(20) + ' 1');
  2. MPlayer.SendMPlayerCommand('volume 40' + ' 1');
  3.  
« Last Edit: September 08, 2023, 06:16:01 pm by Pe3s »

Pe3s

  • Hero Member
  • *****
  • Posts: 641
Re: MPLayer SendCommand
« Reply #4 on: September 08, 2023, 06:31:00 pm »
Problem solved, for the color adjustment sliders to work, you need to set -vo gl

Code: Pascal  [Select][+][-]
  1. MPlayer.StartParam := '-vo gl';
  2.  
Thank you all for the discussions

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: [SOLVED] MPLayer SendCommand
« Reply #5 on: September 08, 2023, 07:18:56 pm »
As stated I can't test myself so perhaps your issue is (completely) solved already but wanted to mention that it should probably look something like:
Code: Pascal  [Select][+][-]
  1. MPlayer.SendMPlayerCommand('set_property brightness 50');
  2.  
At least that is how the (full) example code seem to do it.
Today is tomorrow's yesterday.

Pe3s

  • Hero Member
  • *****
  • Posts: 641
Re: [SOLVED] MPLayer SendCommand
« Reply #6 on: September 08, 2023, 08:38:10 pm »
@TRon For the image settings commands to work, they must be set
Code: Pascal  [Select][+][-]
  1. MPlayer.StartParam := '-vo gl -nodouble';
Image settings commands do not work on
Code: Pascal  [Select][+][-]
  1. MPlayer.StartParam := '-vo direct3d';

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: [SOLVED] MPLayer SendCommand
« Reply #7 on: September 09, 2023, 12:24:07 am »
Ah ok, Thank you for the correction Pe3S.

I misunderstood at first but now realize (also after reading some more of the documentation) that you meant that certain drivers do not support having some of the settings changed (in slave mode or otherwise). The particular settings that you wanted to change seem to require a hardware accelerated driver.
« Last Edit: September 09, 2023, 12:26:29 am by TRon »
Today is tomorrow's yesterday.

 

TinyPortal © 2005-2018