Camera Configurations with Gstreamer

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Camera Configurations with Gstreamer

Marlos C. Machado
Hello,

I'm developing a game which uses a PSEye (Camera) in Ubuntu. I'm able
to play what the camera captures in the game but the camera is auto
adjusting its gain (V4L2_CID_AUTOGAIN on Video For Linux Two API). I
don't want this behavior. Can I disable the camera AUTOGAIN using only
the Gstreamer?

I've understood that I need to develop a mini-driver using the V4L2
API, which is time-consuming for a simple task, since I'm able to do
all the rest I need using Gstreamer it would be wonderful to use only
it. I'm programming in C++ on Ubuntu 10.04.

Thanks in advance,

--
Marlos Cholodovskis Machado

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Camera Configurations with Gstreamer

Andrey Nechypurenko-2
Hi,

> I'm developing a game which uses a PSEye (Camera) in Ubuntu. I'm able
> to play what the camera captures in the game but the camera is auto
> adjusting its gain (V4L2_CID_AUTOGAIN on Video For Linux Two API). I
> don't want this behavior. Can I disable the camera AUTOGAIN using only
> the Gstreamer?

AFAIK, you can not do it neither with v4l2src nor with any other
elements available. I agree, that it would be nice feature for
v4l2src.

> I've understood that I need to develop a mini-driver using the V4L2
> API, which is time-consuming for a simple task, since I'm able to do
> all the rest I need using Gstreamer it would be wonderful to use only
> it. I'm programming in C++ on Ubuntu 10.04.

I do not think that driver is necessary in this case. If the camera
already supported by V4L2 (and as I understand it is the case) then
you can use V4L2 API from your application to set controls as you like
before using gstreamer.

For example, recently I did something similar (disable auto exposure
to increase the frame rate) before running gstreamer pipeline. To
learn how it works, I've written small program which prints available
camera controls and could be used to set these controls. Let me know
if you want to take a look at sources. I'll be glad to share it.

Regards,
Andrey.

>
> Thanks in advance,
>
> --
> Marlos Cholodovskis Machado
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Camera Configurations with Gstreamer

Marlos C. Machado-2
2010/10/14 Andrey Nechypurenko <[hidden email]>:

> Hi,
>
>> I'm developing a game which uses a PSEye (Camera) in Ubuntu. I'm able
>> to play what the camera captures in the game but the camera is auto
>> adjusting its gain (V4L2_CID_AUTOGAIN on Video For Linux Two API). I
>> don't want this behavior. Can I disable the camera AUTOGAIN using only
>> the Gstreamer?
>
> AFAIK, you can not do it neither with v4l2src nor with any other
> elements available. I agree, that it would be nice feature for
> v4l2src.
>
>> I've understood that I need to develop a mini-driver using the V4L2
>> API, which is time-consuming for a simple task, since I'm able to do
>> all the rest I need using Gstreamer it would be wonderful to use only
>> it. I'm programming in C++ on Ubuntu 10.04.
>
> I do not think that driver is necessary in this case. If the camera
> already supported by V4L2 (and as I understand it is the case) then
> you can use V4L2 API from your application to set controls as you like
> before using gstreamer.
>
> For example, recently I did something similar (disable auto exposure
> to increase the frame rate) before running gstreamer pipeline. To
> learn how it works, I've written small program which prints available
> camera controls and could be used to set these controls. Let me know
> if you want to take a look at sources. I'll be glad to share it.

It would be amazing if you could share this codes, it seems it will
solve my problem.

Thanks!

>
> Regards,
> Andrey.
>
>>
>> Thanks in advance,
>>
>> --
>> Marlos Cholodovskis Machado
>>
>> ------------------------------------------------------------------------------
>> Beautiful is writing same markup. Internet Explorer 9 supports
>> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
>> Spend less time writing and  rewriting code and more time creating great
>> experiences on the web. Be a part of the beta today.
>> http://p.sf.net/sfu/beautyoftheweb
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>
> ------------------------------------------------------------------------------
> Download new Adobe(R) Flash(R) Builder(TM) 4
> The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
> Flex(R) Builder(TM)) enable the development of rich applications that run
> across multiple browsers and platforms. Download your free trials today!
> http://p.sf.net/sfu/adobe-dev2dev
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>



--
Marlos Cholodovskis Machado

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Camera Configurations with Gstreamer

Marlos C. Machado
In reply to this post by Andrey Nechypurenko-2
It would be amazing if you could share this codes, it seems it will
solve my problem.

Thanks!

(Sorry, sent 2 e-mails from different accounts)

--
Marlos Cholodovskis Machado <marlos at dcc.ufmg.br>

o <[hidden email]>:

> Hi,
>
>> I'm developing a game which uses a PSEye (Camera) in Ubuntu. I'm able
>> to play what the camera captures in the game but the camera is auto
>> adjusting its gain (V4L2_CID_AUTOGAIN on Video For Linux Two API). I
>> don't want this behavior. Can I disable the camera AUTOGAIN using only
>> the Gstreamer?
>
> AFAIK, you can not do it neither with v4l2src nor with any other
> elements available. I agree, that it would be nice feature for
> v4l2src.
>
>> I've understood that I need to develop a mini-driver using the V4L2
>> API, which is time-consuming for a simple task, since I'm able to do
>> all the rest I need using Gstreamer it would be wonderful to use only
>> it. I'm programming in C++ on Ubuntu 10.04.
>
> I do not think that driver is necessary in this case. If the camera
> already supported by V4L2 (and as I understand it is the case) then
> you can use V4L2 API from your application to set controls as you like
> before using gstreamer.
>
> For example, recently I did something similar (disable auto exposure
> to increase the frame rate) before running gstreamer pipeline. To
> learn how it works, I've written small program which prints available
> camera controls and could be used to set these controls. Let me know
> if you want to take a look at sources. I'll be glad to share it.
>
> Regards,
> Andrey.
>
>>
>> Thanks in advance,
>>
>> --
>> Marlos Cholodovskis Machado
>>
>> ------------------------------------------------------------------------------
>> Beautiful is writing same markup. Internet Explorer 9 supports
>> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
>> Spend less time writing and  rewriting code and more time creating great
>> experiences on the web. Be a part of the beta today.
>> http://p.sf.net/sfu/beautyoftheweb
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>
> ------------------------------------------------------------------------------
> Download new Adobe(R) Flash(R) Builder(TM) 4
> The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
> Flex(R) Builder(TM)) enable the development of rich applications that run
> across multiple browsers and platforms. Download your free trials today!
> http://p.sf.net/sfu/adobe-dev2dev
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>



--
Marlos Cholodovskis Machado

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Camera Configurations with Gstreamer

Stefan Sauer
In reply to this post by Marlos C. Machado-2
Am 15.10.2010 02:36, schrieb Marlos C. Machado:
> 2010/10/14 Andrey Nechypurenko <[hidden email]>:
>> Hi,
>>
>>> I'm developing a game which uses a PSEye (Camera) in Ubuntu. I'm able
>>> to play what the camera captures in the game but the camera is auto
>>> adjusting its gain (V4L2_CID_AUTOGAIN on Video For Linux Two API). I
>>> don't want this behavior. Can I disable the camera AUTOGAIN using only
>>> the Gstreamer?

Once the gstphotography interface in gst-plugin-bad becomes more stable we can
move that to gst-plugin-good (or base) and implement it in v4l2src. Need to
check still what AUTOGAIN should be mapped too.

>>
>> AFAIK, you can not do it neither with v4l2src nor with any other
>> elements available. I agree, that it would be nice feature for
>> v4l2src.
>>
>>> I've understood that I need to develop a mini-driver using the V4L2
>>> API, which is time-consuming for a simple task, since I'm able to do
>>> all the rest I need using Gstreamer it would be wonderful to use only
>>> it. I'm programming in C++ on Ubuntu 10.04.
>>
>> I do not think that driver is necessary in this case. If the camera
>> already supported by V4L2 (and as I understand it is the case) then
>> you can use V4L2 API from your application to set controls as you like
>> before using gstreamer.
>>
>> For example, recently I did something similar (disable auto exposure
>> to increase the frame rate) before running gstreamer pipeline. To
>> learn how it works, I've written small program which prints available
>> camera controls and could be used to set these controls. Let me know
>> if you want to take a look at sources. I'll be glad to share it.
>
> It would be amazing if you could share this codes, it seems it will
> solve my problem.

There is also v4l-info (v4l2-utils package) to list them and various
v4l2-control panels.

Stefan

>
> Thanks!
>
>>
>> Regards,
>> Andrey.
>>
>>>
>>> Thanks in advance,
>>>
>>> --
>>> Marlos Cholodovskis Machado
>>>
>>> ------------------------------------------------------------------------------
>>> Beautiful is writing same markup. Internet Explorer 9 supports
>>> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
>>> Spend less time writing and  rewriting code and more time creating great
>>> experiences on the web. Be a part of the beta today.
>>> http://p.sf.net/sfu/beautyoftheweb
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>>
>>
>> ------------------------------------------------------------------------------
>> Download new Adobe(R) Flash(R) Builder(TM) 4
>> The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
>> Flex(R) Builder(TM)) enable the development of rich applications that run
>> across multiple browsers and platforms. Download your free trials today!
>> http://p.sf.net/sfu/adobe-dev2dev
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>
>
>


------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Camera Configurations with Gstreamer

Andrey Nechypurenko-2
In reply to this post by Marlos C. Machado
Hi,

> It would be amazing if you could share this codes, it seems it will
> solve my problem.

I just upload the example to: http://gitorious.org/cameractls .
You can browse reporsitory online or clone it.

There is README file available with more details.
Yet another example of how to use it to initialize the camera before
gstreamer starts working with it could be found here:
http://gitorious.org/veter/veter/blobs/master/src/vehicle/VideoSenderThread.cpp
around line 90 (search for "Initialize camera" string).

Regards,
Andrey.

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Camera Configurations with Gstreamer

Marlos C. Machado-2
Hello,

First of all, thanks for the code!
I compiled it with no problems and tried to make this:

$ ./cameractls /dev/video0

And I've gotten this:

NEXT_CTRL flag not supported
Device controls with Read/Write permissions:
Control id      Class           Minimum Maximum Step    Default Name

As I said, I'm using a PSEye. This operations are not supported by it
or I am doing something wrong?

FYI I only have the /dev/video0 in my /dev directory, there aren't
others 'videos'.

Thanks again!



2010/10/15 Andrey Nechypurenko <[hidden email]>:

> Hi,
>
>> It would be amazing if you could share this codes, it seems it will
>> solve my problem.
>
> I just upload the example to: http://gitorious.org/cameractls .
> You can browse reporsitory online or clone it.
>
> There is README file available with more details.
> Yet another example of how to use it to initialize the camera before
> gstreamer starts working with it could be found here:
> http://gitorious.org/veter/veter/blobs/master/src/vehicle/VideoSenderThread.cpp
> around line 90 (search for "Initialize camera" string).
>
> Regards,
> Andrey.
>



--
Marlos Cholodovskis Machado

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Camera Configurations with Gstreamer

Andrey Nechypurenko-2
On Fri, Oct 15, 2010 at 8:35 PM, Marlos C. Machado <[hidden email]> wrote:

> Hello,
>
> First of all, thanks for the code!
> I compiled it with no problems and tried to make this:
>
> $ ./cameractls /dev/video0
>
> And I've gotten this:
>
> NEXT_CTRL flag not supported

So your camera does not support NEXT_CTRL command for control
enumeration. I have to admit, that I have not ever tested the code
with such cameras. So maybe there is a bug in the code. You can try to
look at the code and see how this case is handled. Also, as Stefan
suggested above, you can try to run v4l-info and see what the output
is. If you can somehow figure out the id and class of the required
control, then you can set it using functions or code pieces from
cameractls.

Sorry, but I do not have a better suggestion. No, actually I do :-) .
I think it is now much more related to V4L and not to Gstreamer, so
probably there are much better chances to get help on V4L forum.

Regards,
Andrey.

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Camera Configurations with Gstreamer

Marlos C. Machado
Thanks I'll be looking for it and, If I'm able to solve it, I let you know...

--
Marlos Cholodovskis Machado <marlos at dcc.ufmg.br>


t and

2010/10/15 Andrey Nechypurenko <[hidden email]>:

> On Fri, Oct 15, 2010 at 8:35 PM, Marlos C. Machado <[hidden email]> wrote:
>> Hello,
>>
>> First of all, thanks for the code!
>> I compiled it with no problems and tried to make this:
>>
>> $ ./cameractls /dev/video0
>>
>> And I've gotten this:
>>
>> NEXT_CTRL flag not supported
>
> So your camera does not support NEXT_CTRL command for control
> enumeration. I have to admit, that I have not ever tested the code
> with such cameras. So maybe there is a bug in the code. You can try to
> look at the code and see how this case is handled. Also, as Stefan
> suggested above, you can try to run v4l-info and see what the output
> is. If you can somehow figure out the id and class of the required
> control, then you can set it using functions or code pieces from
> cameractls.
>
> Sorry, but I do not have a better suggestion. No, actually I do :-) .
> I think it is now much more related to V4L and not to Gstreamer, so
> probably there are much better chances to get help on V4L forum.
>
> Regards,
> Andrey.
>



--
Marlos Cholodovskis Machado

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel