Video Player example

View: New views
8 Messages — Rating Filter:   Alert me  

Video Player example

by Hartmut Eilers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

I did everything I can image, but I am not able to  make the
drawingarea invisible. Any ideas are highly welcome.

regards
Hartmut

--
Hartmut Eilers                          <hartmut@...>
Dorffer Str. 53                           http://www.eilers.net
52076 Aachen                           01522/1656914

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Video Player example

by Werner-9 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.
>
> I did everything I can image, but I am not able to  make the
> drawingarea invisible. Any ideas are highly welcome.
>
> regards
> Hartmut
>
>  
Does
DrawingArea.Visible = FALSE or
DrawingArea.Hide
not work?

Regards
Werner


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Video Player example

by Doriano Blengino :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Werner ha scritto:

> 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.
>>
>> I did everything I can image, but I am not able to  make the
>> drawingarea invisible. Any ideas are highly welcome.
>>
>> regards
>> Hartmut
>>
>>  
>>    
> Does
> DrawingArea.Visible = FALSE or
> DrawingArea.Hide
> not work?
>
> Regards
> Werner
>  
If this does not work, you can try to put some other graphic element
above (on top) the drawingarea...

Regards,
Doriano

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Parent Message unknown Re: Video Player example

by Hartmut Eilers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hallo Gambas Users,

>> 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.

Werner suggested:
>DrawingArea.Visible = FALSE or
>DrawingArea.Hide

sorry I tried both, but that didn't work, the drawingarea stays visible

Doriano suggested:
>If this does not work, you can try to put some other graphic element
>above (on top) the drawingarea...

this doesn't work too, because the drawingarea.grab commands grabs
also the elements on top of the drawingarea, not only the contents of
the drawing area as you can see on the attached screenshot.

to give you a short explanation of the app:
the yellow marked area is the drawing area for the video player in
the original size of the video. marked green is the video player with
its smaller preview picturebox. orange are the smaller previews and
controls of 2 usb cams and red is marked the recording preview, which
shows in a smaller preview what is recorded to disk. with the record
radio buttons you can select which source is recorded. despite of the
showed size all recordings are done with a resolution of 352x288 pixel.
as you can see in the green preview the grab method grabs whats visible
of the drawingarea, not the actual contents, its like a screenshot.

thats the reason why Dorianos idea doesn't work.

@Ron_1st
I try to get better in my postings ;)

Are there any hints or ideas how to tackle my problem ?

I use Gambas 2.7 as distributed with Ubuntu 8.10


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

VideoPlayerProblem2.png (186K) Download Attachment

Parent Message unknown Re: Video Player example

by Hartmut Eilers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hallo List,

I didn't know, that the attachments are scrubbed. at least in the digest.
so here is the screenshot of my video app for live recordings from 2 cams.

http://www.eilers.net/tmp/VideoPlayerProblem2.png

regards
Hartmut

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Video Player example

by Ron_1st :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 25 October 2009, Hartmut Eilers wrote:

> Hallo Gambas Users,
>
> >> 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.
>
> Werner suggested:
> >DrawingArea.Visible = FALSE or
> >DrawingArea.Hide
>
> sorry I tried both, but that didn't work, the drawingarea stays visible
>
> Doriano suggested:
> >If this does not work, you can try to put some other graphic element
> >above (on top) the drawingarea...
>
> this doesn't work too, because the drawingarea.grab commands grabs
> also the elements on top of the drawingarea, not only the contents of
> the drawing area as you can see on the attached screenshot.

I have made a form to contain a invoice in the past.
This form had to look the same as the printed form because the
personel using it have some disabilities (in real, not my opinion :) )

I did a FInvoice.grab and send the picture to the printer.
The form (A4) height is greater as the screen 800x600 terminal.
On the lower half of the grabbed picture there was memory garbage and
part of a browser page previous visit with login information!.

My conclusion is that the *.grab takes the visible part of the screen
with the dimensions determined by the control you use for *.grab instead
the in-memory surface for that control.
And more worse it uses X-servers memory to get the size you ask with *.grab.
This is out of screen area so may be a X-server bug??
 

>
> to give you a short explanation of the app:
> the yellow marked area is the drawing area for the video player in
> the original size of the video. marked green is the video player with
> its smaller preview picturebox. orange are the smaller previews and
> controls of 2 usb cams and red is marked the recording preview, which
> shows in a smaller preview what is recorded to disk. with the record
> radio buttons you can select which source is recorded. despite of the
> showed size all recordings are done with a resolution of 352x288 pixel.
> as you can see in the green preview the grab method grabs whats visible
> of the drawingarea, not the actual contents, its like a screenshot.
>
> thats the reason why Dorianos idea doesn't work.
>
> @Ron_1st
> I try to get better in my postings ;)
>
> Are there any hints or ideas how to tackle my problem ?
>
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,


> I use Gambas 2.7 as distributed with Ubuntu 8.10
>


Best regards,

Ron_1st

--


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Parent Message unknown Re: Video Player example

by Hartmut Eilers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Video Player example

by Ron_1st :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

--


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user