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

Mailing lists / lazarus / 2015-03
20 messages · 6 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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
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?:
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
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?:
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?"
Enviado: quinta-feira, 5 de mar?o de 2015 17:44
Para:
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?:
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?:
Leonardo,
Im not familiar with Mplayer but take a look at here: http://wiki.freepascal.org/TMPlayerControl And in MPlayerCtrl unit line 665 it just pass handle.
Do you have opinion about how to pass memory stream?
Regards, Ara
xwininfo ... linux ! ...
I need a solution for windows ...
I tried
whndl := WindowFromDC(wglGetCurrentDC())but MPLAYER does not seem to like it, either in decimal format or hex format ...
and I do not know how to check if I get the resquested value ... the handle of the window launched by glutCreateWindow ...
________________________________
De: aradeonas
Enviado: sexta-feira, 6 de mar?o de 2015 12:58
Para:
Assunto: Re: [Lazarus] Play video from memory
Leonardo,
Im not familiar with Mplayer but take a look at here: http://wiki.freepascal.org/TMPlayerControl
And in MPlayerCtrl unit line 665 it just pass handle.
Do you have opinion about how to pass memory stream?
Regards,
Ara
Anyway if anyone know a way or library please tell me.
Ara
Philippe L?vi wrotexwininfo ... linux ! ...
I need a solution for windows ...
I tried
whndl := WindowFromDC(wglGetCurrentDC())
but MPLAYER does not seem to like it, either in decimal format or hex format ...
and I do not know how to check if I get the resquested value ... the handle of the window launched by glutCreateWindow ...
http://www.fastmail.com - Email service worth paying for. Try it for free
-- _________________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
aradeonas wroteAnyway if anyone know a way or library please tell me. Ara
You can get some video libraries here:
http://wiki.freepascal.org/Video_Playback_Libraries
Dear Silvio I checked them before and I couldn't find out way for opening from memory.
Ara
aradeonas wroteDear Silvio I checked them before and I couldn't find out way for opening from memory.
Seeing that there isn't an option to feed a memorystream to a video player, it seems your best option to do that using a RAMDisk. You could use mapped file streams for speed too.
BTW, I am aware that this is not much different from buffering the videostream to physical disk, but at least you get to have a greater speed plus, of course, there will be no traces of the video file once you reboot.
or you could take a look at, if you haven't already, to BoxedApp:
http://boxedapp.com/encrypted_video_streaming.html
HTH,
Thank you HTH,
I already look at that but my project is a free project and I cant buy this and I think there a way to open video from memory but its hard to find!
Ara
Dear Silvio I checked them before and I couldn't find out way for opening from memory. Ara
FFVCL (from the link that I sent in previous message) offer support to video stream (FPC/Dephi):
http://www.delphiffmpeg.com/downloads/
Thank you Silvio,
I spoke with author and he its not have this ability but maybe its a misundesrtanding. I will check this library today.
Regards, Ara
Hi. Silvio you are right,That is a miss understanding. Here another test with DelphiFFmpeg,I don't have full version and I can test it with Delphi. I made a test that play video from memory but there is a delay between changing files,Can any one test this demo and help me with this? My goal is buffer second one before first one and after first one finished play second almost imminently. I also attached Delphi project.
Regards, Ara
Thank you all,
Now with help of author of FFVCL I can do what I want.
That is great library with a great support.After testing many libraries I think its best choice for any one wants expert and easy to use tools in video field (also audio and .. but I didn't work with them).
Regards,
Ara
Consider uploading it to some place where we can all learn from it, something like a
Frank Church
=======================
http://devblog.brahmancreations.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150317/13cb59fe/attachment.html>
Hi,
You need to take a look at MemoryPlayer demo of FFVCL,There is not? much I done and demo is documented fairly,my version is just simpler but if you wants any help tell me although Im newbie in this subject ;)
Regards,
Ara
I forgot to say I made it work with Delphi not Lazarus and for making it with Lazarus you will need full source version that it will compile only for windows.
Regards,
Ara