[Gambas-user] Video Player example

Ron_1st ronstk at ...239...
Tue Oct 27 05:33:02 CET 2009


On Monday 26 October 2009, Hartmut Eilers wrote:
> Hallo List,
> 
> > >> for my Video project I need a video player which plays a video
> > >> in a unvisible DrawingArea where I can grab a picture contolled
> > >> by a timer. I want to show the grabbed image in a smaller preview
> > >> window where one can apply effects. When pressing a button all
> > >>effects should bei applied to the grabbed images in their original size
> > >> and saved as a sequence of pictures.
> 
> 
> > @Ron_1st
> >The dummy control i.e. a frame/panel should be on top of the DrawingArea.
> >Resize it in code to the dimension of the DrawingArea.
> >I'have don this to and should work.
> >Just one question, the drawing you use is it a mplayer screen?
> >The same way as the movieplayer from the gambas example kit?
> >If so then it can be the reason why it is not working now.
> 
> >One other method I think about is position the DrawingArea.left
> >and DrawingArea.top at negative position on the form or make
> >the left and/or top greater so it s outside the form, if allowed,
> 
> It is a version of the gambas movie player example using mplayer.
> Your suggestions to put a dummy frame/panel above had the same
> result as seen on my screenshot, it overlapped and is seen on the
> preview.
> 
> moving the drawing area in the off by using negative coordinates had
> the effect, that the screen at those coordinates was dumped. So I had
> different windows on my preview.
> 
> Its like you said, grab() is a screenshot of the x-window area of the
> component.
> 
> I tried a picturebox instead of the drawing area, and tried to access the
> Picture with PictureBox.Picture but the result is always null.
> >From my point of view that means, that mplayer doesn't write to
> the component, instead it writes to the area of the component in the
> x server.
> 
> Does anybody have an idea how to play a video inside gambas and
> how to access images from that video in order to resize them or
> apply effects?
> 
> Does anybody know how to modify  the mplayer example to really write
> to the  PictureBox not to the area of the PictureBox ?
> 
> Thanks and regards
> Hartmut

OK so my suspection was true for mplayer.
Mplayer is forced to display on the x-servers real screen surface.

Mplayer can out put to file and images instead of screen when I AFAIK.
Else you could use ffmpeg to stream the video to images.
I have done this for other stuff so I know that this should work.

Showing in picturebox could be done by a timer reading the images from ffmpeg into the box.
As I understood the frame rate is/was not to importand so this could be a way.

Second you talk about play a video inside gambas and access the image of it.
My previous posible soolution does not play inside gambas but access the images.

Try to think as playing the video with or without gambas but to a virtual screen 
as i.e. jpeg images and using gambas to access that result.





Best regards,

Ron_1st

-- 





More information about the User mailing list