To embed mplayer into a window you must know its ID. Window IDs have a relation with the WindowHandle, but that value must be somehow "translated" to be understood by X11 (or Windows). I don't know how to translate it :(.

For example, If I use Format('%x', [Self.WindowHandle]) I get the Hex value BB5380, then, using the wininfo tool I can get the ID. Just run xwininfo and click on the window you want to embed mplayer into.

In my example I got:

xwininfo: Window id: 0x2800048 "BB5380"

  Absolute upper-left X:  662
  Absolute upper-left Y:  270
  Relative upper-left X:  1
  Relative upper-left Y:  24
  Width: 320
  Height: 240
  Depth: 24
  Visual: 0x20
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x22 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +662+270  -1744+270  -1744-258  +662-258
  -geometry 320x240+661+246

As you can see, the first line displays the same Hex number I get from Lazarus, and 0x2800048, this is the value mplayer expects.

So, to embed a movie into a window, when you know the window Id, you just launch mplayer using this options:

mplayer -wid 0x2800048 /home/leonardo/Imágenes/Fotos/2009/11/21/mvi_0260.avi

Please, if any you know how to translate BB5380 to 0x2800048 I'll be glad to learn.

El 05/03/15 a las 18:51, Philippe Lévi escibió:
and you know how to tell MPLAYER to show the video in a specific window? (using 
WINDOWS, and glutCreateWindow).

thanks
Philippe

________________________________________
De: "Leonardo M. Ramé" <l.r...@griensu.com>
Enviado: quinta-feira, 5 de março de 2015 17:44
Para: lazarus@lists.lazarus.freepascal.org
Assunto: Re: [Lazarus] Play video from memory

Yes, you can!.

1) Load your Video to a TStream (TMemoryStream for example).
2) Use TProcess to execute "mplayer -", the "-" is the parameter.
3) Send your stream to the standard input of the process.


El 05/03/15 a las 16:45, aradeonas escibió:
Thank you Leonardo,

I saw it before but it doesn't seem there is a way to pass memory to it
or I couldn't find out how.
Do you know?

Regards,
Ara

On Thu, Mar 5, 2015, at 11:40 AM, Leonardo M. Ramé wrote:
It looks like MPlayer can do this:
http://www.mplayerhq.hu/DOCS/HTML/en/streaming.html

El 04/03/15 a las 13:29, aradeonas escibió:
Hi,

Any one know a library or way to buffer video file into memory and then
pass it to player?
Any simple player do the job but it should support a way to open file
from memory.

Regards,
Ara

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to