getting data format info

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

getting data format info

Hendrik Schober
Hi,

we are using (or is that abusing?) gstreamer in order to capture
video data from an USB camera. For this we have setup a v4lsrc
and a fake sink and grab the data in the handoff hook of the
latter. So far, so good. However, despite several hours of
tinkering we haven't found out how to determine what format
(width, height, encoding) the data comes in.
What do we need to do to get these values?

TIA,

Schobi


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: getting data format info

Thiago Sousa Santos-2

On Mon, Sep 1, 2008 at 11:18 AM, Hendrik Schober <[hidden email]> wrote:
Hi,

we are using (or is that abusing?) gstreamer in order to capture
video data from an USB camera. For this we have setup a v4lsrc
and a fake sink and grab the data in the handoff hook of the
latter. So far, so good. However, despite several hours of
tinkering we haven't found out how to determine what format
(width, height, encoding) the data comes in.
What do we need to do to get these values?

Check the 'caps' in the source pad of the v4lsrc element.
 


TIA,

Schobi


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
Thiago Sousa Santos

Embedded Systems and Pervasive Computing Lab (Embedded)
Center of Electrical Engineering and Informatics (CEEI)
Federal University of Campina Grande (UFCG)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: getting data format info

Benoit Fouet
In reply to this post by Hendrik Schober
Hendrik Schober wrote:

> Hi,
>
> we are using (or is that abusing?) gstreamer in order to capture
> video data from an USB camera. For this we have setup a v4lsrc
> and a fake sink and grab the data in the handoff hook of the
> latter. So far, so good. However, despite several hours of
> tinkering we haven't found out how to determine what format
> (width, height, encoding) the data comes in.
> What do we need to do to get these values?
>
>  

if you're using gst-laucnh to do that, you can add -v to your command line

--
Benoit Fouet
Purple Labs S.A.
www.purplelabs.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: getting data format info

Hendrik Schober
In reply to this post by Thiago Sousa Santos-2
thiagoss wrote:

>
> On Mon, Sep 1, 2008 at 11:18 AM, Hendrik Schober <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi,
>
>     we are using (or is that abusing?) gstreamer in order to capture
>     video data from an USB camera. For this we have setup a v4lsrc
>     and a fake sink and grab the data in the handoff hook of the
>     latter. So far, so good. However, despite several hours of
>     tinkering we haven't found out how to determine what format
>     (width, height, encoding) the data comes in.
>     What do we need to do to get these values?
>
>
> Check the 'caps' in the source pad of the v4lsrc element.

  Thanks for your answer.
  In fact, we already did that -- and got back a rather long
  list of caps. But that doesn't tell us which one's currently
  used. (Also, they specify a range for width and height, while
  we need the ones that actually are negotiated.)

  Schobi


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: getting data format info

Hendrik Schober
In reply to this post by Benoit Fouet
Benoit Fouet wrote:

> Hendrik Schober wrote:
>> Hi,
>>
>> we are using (or is that abusing?) gstreamer in order to capture
>> video data from an USB camera. For this we have setup a v4lsrc
>> and a fake sink and grab the data in the handoff hook of the
>> latter. So far, so good. However, despite several hours of
>> tinkering we haven't found out how to determine what format
>> (width, height, encoding) the data comes in.
>> What do we need to do to get these values?
>>
>>  
>
> if you're using gst-laucnh to do that, you can add -v to your command line

  No, we're doing this in code (C++).

  Schobi


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: getting data format info

Thiago Sousa Santos-2
In reply to this post by Hendrik Schober


On Mon, Sep 1, 2008 at 11:56 AM, Hendrik Schober <[hidden email]> wrote:
thiagoss wrote:
>
> On Mon, Sep 1, 2008 at 11:18 AM, Hendrik Schober <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi,
>
>     we are using (or is that abusing?) gstreamer in order to capture
>     video data from an USB camera. For this we have setup a v4lsrc
>     and a fake sink and grab the data in the handoff hook of the
>     latter. So far, so good. However, despite several hours of
>     tinkering we haven't found out how to determine what format
>     (width, height, encoding) the data comes in.
>     What do we need to do to get these values?
>
>
> Check the 'caps' in the source pad of the v4lsrc element.

 Thanks for your answer.
 In fact, we already did that -- and got back a rather long
 list of caps. But that doesn't tell us which one's currently
 used. (Also, they specify a range for width and height, while
 we need the ones that actually are negotiated.)

You should check the caps in the buffers you get from the handoff buffers instead.

 Schobi


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
Thiago Sousa Santos

Embedded Systems and Pervasive Computing Lab (Embedded)
Center of Electrical Engineering and Informatics (CEEI)
Federal University of Campina Grande (UFCG)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: getting data format info

Hendrik Schober
thiagoss wrote:

>
>
> On Mon, Sep 1, 2008 at 11:56 AM, Hendrik Schober <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     thiagoss wrote:
>      >
>      > On Mon, Sep 1, 2008 at 11:18 AM, Hendrik Schober <[hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>      >
>      >     Hi,
>      >
>      >     we are using (or is that abusing?) gstreamer in order to capture
>      >     video data from an USB camera. For this we have setup a v4lsrc
>      >     and a fake sink and grab the data in the handoff hook of the
>      >     latter. So far, so good. However, despite several hours of
>      >     tinkering we haven't found out how to determine what format
>      >     (width, height, encoding) the data comes in.
>      >     What do we need to do to get these values?
>      >
>      >
>      > Check the 'caps' in the source pad of the v4lsrc element.
>
>      Thanks for your answer.
>      In fact, we already did that -- and got back a rather long
>      list of caps. But that doesn't tell us which one's currently
>      used. (Also, they specify a range for width and height, while
>      we need the ones that actually are negotiated.)
>
>
> You should check the caps in the buffers you get from the handoff
> buffers instead.

  Thanks, we hadn't even found those yet.
  However, this now leads to another question:
  Since these are rather suboptimal for us, we need to change
  them. We could use the ffmpegcolorspace conversion plugin,
  but IIUC we need to make this and the fakesink use the right
  pad.
  Where and how would we do this? When we setup the pipeline?
  By forcing some caps/pad onto the fakesink's source?

  Schobi


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: getting data format info

Thiago Sousa Santos-2
On Mon, Sep 1, 2008 at 12:59 PM, Hendrik Schober <[hidden email]> wrote:
thiagoss wrote:
>
>
> On Mon, Sep 1, 2008 at 11:56 AM, Hendrik Schober <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     thiagoss wrote:
>      >
>      > On Mon, Sep 1, 2008 at 11:18 AM, Hendrik Schober <[hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>      >
>      >     Hi,
>      >
>      >     we are using (or is that abusing?) gstreamer in order to capture
>      >     video data from an USB camera. For this we have setup a v4lsrc
>      >     and a fake sink and grab the data in the handoff hook of the
>      >     latter. So far, so good. However, despite several hours of
>      >     tinkering we haven't found out how to determine what format
>      >     (width, height, encoding) the data comes in.
>      >     What do we need to do to get these values?
>      >
>      >
>      > Check the 'caps' in the source pad of the v4lsrc element.
>
>      Thanks for your answer.
>      In fact, we already did that -- and got back a rather long
>      list of caps. But that doesn't tell us which one's currently
>      used. (Also, they specify a range for width and height, while
>      we need the ones that actually are negotiated.)
>
>
> You should check the caps in the buffers you get from the handoff
> buffers instead.

 Thanks, we hadn't even found those yet.
 However, this now leads to another question:
 Since these are rather suboptimal for us, we need to change
 them. We could use the ffmpegcolorspace conversion plugin,
 but IIUC we need to make this and the fakesink use the right
 pad.
 Where and how would we do this? When we setup the pipeline?
 By forcing some caps/pad onto the fakesink's source?

You can do like this:

v4lsrc ! ffmpegcolorspace ! capsfilter caps="yourdesiredcaps" ! fakesink

If you need scaling put a videoscale between ffmpegcolorspace and capsfilter.
 

 Schobi


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
Thiago Sousa Santos

Embedded Systems and Pervasive Computing Lab (Embedded)
Center of Electrical Engineering and Informatics (CEEI)
Federal University of Campina Grande (UFCG)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: getting data format info

Hendrik Schober
thiagoss wrote:

> On Mon, Sep 1, 2008 at 12:59 PM, Hendrik Schober <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     thiagoss wrote:
>      >
>      >
>      > On Mon, Sep 1, 2008 at 11:56 AM, Hendrik Schober <[hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>      >
>      >     thiagoss wrote:
>      >      >
>      >      > On Mon, Sep 1, 2008 at 11:18 AM, Hendrik Schober
>     <[hidden email] <mailto:[hidden email]>
>      >     <mailto:[hidden email] <mailto:[hidden email]>>
>      >      > <mailto:[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>>> wrote:
>      >      >
>      >      >     Hi,
>      >      >
>      >      >     we are using (or is that abusing?) gstreamer in order
>     to capture
>      >      >     video data from an USB camera. For this we have setup
>     a v4lsrc
>      >      >     and a fake sink and grab the data in the handoff hook
>     of the
>      >      >     latter. So far, so good. However, despite several hours of
>      >      >     tinkering we haven't found out how to determine what
>     format
>      >      >     (width, height, encoding) the data comes in.
>      >      >     What do we need to do to get these values?
>      >      >
>      >      >
>      >      > Check the 'caps' in the source pad of the v4lsrc element.
>      >
>      >      Thanks for your answer.
>      >      In fact, we already did that -- and got back a rather long
>      >      list of caps. But that doesn't tell us which one's currently
>      >      used. (Also, they specify a range for width and height, while
>      >      we need the ones that actually are negotiated.)
>      >
>      >
>      > You should check the caps in the buffers you get from the handoff
>      > buffers instead.
>
>      Thanks, we hadn't even found those yet.
>      However, this now leads to another question:
>      Since these are rather suboptimal for us, we need to change
>      them. We could use the ffmpegcolorspace conversion plugin,
>      but IIUC we need to make this and the fakesink use the right
>      pad.
>      Where and how would we do this? When we setup the pipeline?
>      By forcing some caps/pad onto the fakesink's source?
>
>
> You can do like this:
>
> v4lsrc ! ffmpegcolorspace ! capsfilter caps="yourdesiredcaps" ! fakesink
>
> If you need scaling put a videoscale between ffmpegcolorspace and
> capsfilter.

  That did the trick! We got it working now.

  Thank you for your support.

  Schobi


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel