Discussion:
[gst-devel] My H.264 encoder cound not work well with the MP4 muxer
(too old to reply)
Chen, Weian
2009-08-11 09:08:58 UTC
Permalink
Hi All

I am developing an H.264 encoder element, and with pipeline: gst-launch videotestsrc ! myencoder ! filesink location=test.264 I can dump the test.264 data, and also I can decoder it.

But when I use pipeline: gst-launch videotestsrc ! myencoder ! mp4mux ! filesink location=test.mp4 I could not get any output, and the size of test.mp4 is 0.

Could anybody here give me some hint what's the problem in my encoder? Why my encoder could not work with the MP4 muxer?

Thanks in advanced.

BTW: I got the warning : (gst-launch-0.10:17032): GStreamer-CRITICAL **: gst_value_set_fraction: assertion `denominator != 0' failed How to fix it?
Weian Chen
Ultra Mobility Group
Intel Corporation
Tel: 86-21-6116-6478
Fax: 86-21-3429-1915
iNet: 8-821-6478
Michael Smith
2009-08-11 11:56:29 UTC
Permalink
Post by Chen, Weian
Hi All
I am developing an H.264 encoder element, and with pipeline: gst-launch
videotestsrc ! myencoder ! filesink location=test.264 I can dump the
test.264 data, and also I can decoder it.
But when I use pipeline: gst-launch videotestsrc ! myencoder ! mp4mux !
filesink location=test.mp4 I could not get any output, and the size of
test.mp4 is 0.
Could anybody here give me some hint what’s the problem in my encoder? Why
my encoder could not work with the MP4 muxer?
You've given far too little information for us to help. What caps are
produced by your encoder? What's set on the buffers you push? Etc.
Post by Chen, Weian
Thanks in advanced.
gst_value_set_fraction: assertion `denominator != 0' failed How to fix it?
Something's trying to set a fraction (possibly a framerate) with a
denominator of 0 - if you set G_DEBUG=fatal_warnings, you can run in
gdb and see what's triggering this, and thus debug it.

Mike
Chen, Weian
2009-08-11 23:12:22 UTC
Permalink
Hi,



Thanks a lot for the reply, my chain function is as following:



gst_video_enc_chain (GstPad * pad, GstBuffer * buf)

{

GstVideoEnc *videoenc = GST_VIDEO_ENC (GST_OBJECT_PARENT (pad));



GstClockTime timestamp, duration;

gboolean discont;

GstBuffer *out_buf = NULL;

GstFlowReturn ret = GST_FLOW_OK;

guint width, height;

guint size;

guint outsize;



guint8 * buffer = GST_BUFFER_DATA (buf);

size = GST_BUFFER_SIZE (buf)



timestamp = GST_BUFFER_TIMESTAMP (buf);

duration = GST_BUFFER_DURATION (buf);

discont = GST_BUFFER_IS_DISCONT (buf);



outsize = encode_one_picture (videoenc, buffer, &codedbuf); //encode one picture



out_buf = gst_buffer_new_and_alloc (outsize);

memcpy (GST_BUFFER_DATA (out_buf), coded_buf, outsize);

GST_BUFFER_SIZE (out_buf) = outsize;

GST_BUFFER_TIMESTAMP (out_buf) = timestamp;

GST_BUFFER_DURATION (out_buf) = duration;

gst_buffer_set_caps (out_buf, GST_PAD_CAPS (videoenc->srcpad));



gst_buffer_unref (buf);



gst_pad_push (videoenc->srcpad, out_buf);

return ret;

}





And the srccaps set function is as following:



gst_video_enc_set_src_caps (GstVideoEnc * videoenc, GstPad * pad)

{

GstCaps *outcaps;

gboolean res;



outcaps = gst_caps_new_simple ("video/x-h264",

"width", G_TYPE_INT, videoenc->width,

"height", G_TYPE_INT, videoenc->height,

"framerate", GST_TYPE_FRACTION, videoenc->fps_num, videoenc->fps_den, NULL);

res = gst_pad_set_caps (pad, outcaps);

gst_caps_unref (outcaps);

}



Is my info enough? If yes, what¡¯s the problem?



Could you please give me some help?



Thanks in advanced.





thanks,

Weian

-----Original Message-----
From: Michael Smith [mailto:***@xiph.org]
Sent: 2009Äê8ÔÂ11ÈÕ 19:56
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] My H.264 encoder cound not work well with the MP4 muxer
Post by Chen, Weian
Hi All
I am developing an H.264 encoder element, and with pipeline: gst-launch
videotestsrc ! myencoder ! filesink location=test.264 I can dump the
test.264 data, and also I can decoder it.
But when I use pipeline: gst-launch videotestsrc ! myencoder ! mp4mux !
filesink location=test.mp4 I could not get any output, and the size of
test.mp4 is 0.
Could anybody here give me some hint what¡¯s the problem in my encoder? Why
my encoder could not work with the MP4 muxer?
You've given far too little information for us to help. What caps are

produced by your encoder? What's set on the buffers you push? Etc.
Michael Smith
2009-08-12 00:46:35 UTC
Permalink
Hi,
   gst_pad_push (videoenc->srcpad, out_buf);
  return ret;
Well, this is obviously wrong - you discard the return value of
gst_pad_push, and unconditionally return GST_FLOW_OK.

That's probably not the cause of your problem though - I don't know
what is. You'll need to do some debugging yourself; hopefully the
GST_DEBUG output will be helpful.

Mike
Chen, Weian
2009-08-12 22:36:22 UTC
Permalink
Thanks a lot for your help. :)

thanks,
Weian
-----Original Message-----
From: Michael Smith [mailto:***@xiph.org]
Sent: 2009年8月12日 8:47
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] My H.264 encoder cound not work well with the MP4 muxer
Hi,
   gst_pad_push (videoenc->srcpad, out_buf);
  return ret;
Well, this is obviously wrong - you discard the return value of
gst_pad_push, and unconditionally return GST_FLOW_OK.

That's probably not the cause of your problem though - I don't know
what is. You'll need to do some debugging yourself; hopefully the
GST_DEBUG output will be helpful.

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net
https://lists.sourceforge.net/lis
Chen, Weian
2009-08-19 11:41:33 UTC
Permalink
Hi All,

I need to send some data to the next element before calling the _chain function (such as send the data from src element to encoder element), does it possible?

If yes, how?

Thanks in advanced.

Weian
Michael Smith
2009-08-19 17:34:40 UTC
Permalink
Post by Chen, Weian
Hi All,
I need to send some data to the next element before calling the _chain
function (such as send the data from src element to encoder element), does
it possible?
Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike
Chen, Weian
2009-08-20 01:06:05 UTC
Permalink
The data I want to send is couple of bytes (some information of current element) which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian
-----Original Message-----
From: Michael Smith [mailto:***@xiph.org]
Sent: 2009年8月20日 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()
Post by Chen, Weian
Hi All,
I need to send some data to the next element before calling the _chain
function (such as send the data from src element to encoder element), does
it possible?
Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net
https://lists.sourc
sudarshan bisht
2009-08-20 04:31:45 UTC
Permalink
Hi ,
I think you can send such extradata using caps .

So on demuxer side do :---

GstBuffer *=buf;

buf = gst_buffer_new_and_alloc (size);

memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an
extradata (should be guint8*) , size);

gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER,
buf, NULL);

gst_buffer_unref (buf);
On Decoder side in _setcaps function u can do :----


GstBuffer *codec_data = NULL;

guint8* extradata =NULL;

capStruct = gst_caps_get_structure(caps,0);

/* Read extra data passed via demuxer. */
value = gst_structure_get_value(capStruct, "codec_data");

codec_data = gst_value_get_buffer(value);
**
extradata =GST_BUFFER_DATA(codec_data);

// now u can parse extradata to get your fields .
Post by Chen, Weian
The data I want to send is couple of bytes (some information of current
element) which will be used in next element's _setcap() funct. So we could
not wait the gst_pad_push() function to send.
thanks,
Weian
-----Original Message-----
Sent: 2009Äê8ÔÂ20ÈÕ 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()
Post by Chen, Weian
Hi All,
I need to send some data to the next element before calling the _chain
function (such as send the data from src element to encoder element),
does
Post by Chen, Weian
it possible?
Can you explain in a bit more detail what you want to do?
You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?
What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?
Mike
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,

Sudarshan Bisht
Chen, Weian
2009-08-20 05:30:40 UTC
Permalink
Thanks a lot for your help.

Then in demuxer side, where (or which function) these code should put?

thanks,
Weian
________________________________
From: sudarshan bisht [mailto:***@gmail.com]
Sent: 2009Äê8ÔÂ20ÈÕ 12:32
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

Hi ,
I think you can send such extradata using caps .

So on demuxer side do :---

GstBuffer *=buf;

buf = gst_buffer_new_and_alloc (size);

memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

gst_buffer_unref (buf);
On Decoder side in _setcaps function u can do :----


GstBuffer *codec_data = NULL;

guint8* extradata =NULL;

capStruct = gst_caps_get_structure(caps,0);

/* Read extra data passed via demuxer. */
value = gst_structure_get_value(capStruct, "codec_data");

codec_data = gst_value_get_buffer(value);

extradata =GST_BUFFER_DATA(codec_data);

// now u can parse extradata to get your fields .


2009/8/20 Chen, Weian <***@intel.com<mailto:***@intel.com>>

The data I want to send is couple of bytes (some information of current element) which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian
-----Original Message-----
From: Michael Smith [mailto:***@xiph.org<mailto:***@xiph.org>]
Sent: 2009Äê8ÔÂ20ÈÕ 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()
Post by Chen, Weian
Hi All,
I need to send some data to the next element before calling the _chain
function (such as send the data from src element to encoder element), does
it possible?
Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net<mailto:gstreamer-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net<mailto:gstreamer-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,

Sudarshan Bisht
sudarshan bisht
2009-08-20 05:36:33 UTC
Permalink
Do it as soon as you get extradata , before calling gst_pad_push .
Post by Chen, Weian
Thanks a lot for your help.
Then in demuxer side, where (or which function) these code should put?
thanks,
Weian
------------------------------
*Sent:* 2009Äê8ÔÂ20ÈÕ 12:32
*To:* Discussion of the development of GStreamer
*Subject:* Re: [gst-devel] How to send data to next elemnet before calling
_chain()
Hi ,
I think you can send such extradata using caps .
So on demuxer side do :---
GstBuffer *=buf;
buf = gst_buffer_new_and_alloc (size);
memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an
extradata (should be guint8*) , size);
gst_caps_set_simple (stream->caps,"codec_data",
GST_TYPE_BUFFER, buf, NULL);
gst_buffer_unref (buf);
On Decoder side in _setcaps function u can do :----
GstBuffer *codec_data = NULL;
guint8* extradata =NULL;
capStruct = gst_caps_get_structure(caps,0);
/* Read extra data passed via demuxer. */
value = gst_structure_get_value(capStruct, "codec_data");
codec_data = gst_value_get_buffer(value);
extradata =GST_BUFFER_DATA(codec_data);
// now u can parse extradata to get your fields .
The data I want to send is couple of bytes (some information of current
element) which will be used in next element's _setcap() funct. So we could
not wait the gst_pad_push() function to send.
thanks,
Weian
-----Original Message-----
Sent: 2009Äê8ÔÂ20ÈÕ 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()
Post by Chen, Weian
Hi All,
I need to send some data to the next element before calling the _chain
function (such as send the data from src element to encoder element),
does
Post by Chen, Weian
it possible?
Can you explain in a bit more detail what you want to do?
You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?
What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?
Mike
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,
Sudarshan Bisht
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,

Sudarshan Bisht
Chen, Weian
2009-08-20 05:45:05 UTC
Permalink
Sorry, actually I should do it in the source element.

So the problem is different, because maybe the source element will not call gst_pad_push at all.

Could you give me some hints?

thanks,
Weian
________________________________
From: sudarshan bisht [mailto:***@gmail.com]
Sent: 2009Äê8ÔÂ20ÈÕ 13:37
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

Do it as soon as you get extradata , before calling gst_pad_push .



2009/8/20 Chen, Weian <***@intel.com<mailto:***@intel.com>>



Thanks a lot for your help.



Then in demuxer side, where (or which function) these code should put?



thanks,

Weian

________________________________

From: sudarshan bisht [mailto:***@gmail.com<mailto:***@gmail.com>]
Sent: 2009Äê8ÔÂ20ÈÕ 12:32

To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()



Hi ,

I think you can send such extradata using caps .


So on demuxer side do :---



GstBuffer *=buf;

buf = gst_buffer_new_and_alloc (size);

memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

gst_buffer_unref (buf);

On Decoder side in _setcaps function u can do :----





GstBuffer *codec_data = NULL;


guint8* extradata =NULL;

capStruct = gst_caps_get_structure(caps,0);

/* Read extra data passed via demuxer. */
value = gst_structure_get_value(capStruct, "codec_data");


codec_data = gst_value_get_buffer(value);



extradata =GST_BUFFER_DATA(codec_data);



// now u can parse extradata to get your fields .





2009/8/20 Chen, Weian <***@intel.com<mailto:***@intel.com>>

The data I want to send is couple of bytes (some information of current element) which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:***@xiph.org<mailto:***@xiph.org>]
Sent: 2009Äê8ÔÂ20ÈÕ 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()
Post by Chen, Weian
Hi All,
I need to send some data to the next element before calling the _chain
function (such as send the data from src element to encoder element), does
it possible?
Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net<mailto:gstreamer-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net<mailto:gstreamer-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,

Sudarshan Bisht

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net<mailto:gstreamer-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,

Sudarshan Bisht
sudarshan bisht
2009-08-20 05:56:10 UTC
Permalink
what is the source element ? what it reads ? without pushing data how it
will stream buffers to next element ?
Post by Chen, Weian
Sorry, actually I should do it in the source element.
So the problem is different, because maybe the source element will not call
gst_pad_push at all.
Could you give me some hints?
thanks,
Weian
------------------------------
*Sent:* 2009Äê8ÔÂ20ÈÕ 13:37
*To:* Discussion of the development of GStreamer
*Subject:* Re: [gst-devel] How to send data to next elemnet before calling
_chain()
Do it as soon as you get extradata , before calling gst_pad_push .
Thanks a lot for your help.
Then in demuxer side, where (or which function) these code should put?
thanks,
Weian
------------------------------
*Sent:* 2009Äê8ÔÂ20ÈÕ 12:32
*To:* Discussion of the development of GStreamer
*Subject:* Re: [gst-devel] How to send data to next elemnet before calling
_chain()
Hi ,
I think you can send such extradata using caps .
So on demuxer side do :---
GstBuffer *=buf;
buf = gst_buffer_new_and_alloc (size);
memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an
extradata (should be guint8*) , size);
gst_caps_set_simple (stream->caps,"codec_data",
GST_TYPE_BUFFER, buf, NULL);
gst_buffer_unref (buf);
On Decoder side in _setcaps function u can do :----
GstBuffer *codec_data = NULL;
guint8* extradata =NULL;
capStruct = gst_caps_get_structure(caps,0);
/* Read extra data passed via demuxer. */
value = gst_structure_get_value(capStruct, "codec_data");
codec_data = gst_value_get_buffer(value);
extradata =GST_BUFFER_DATA(codec_data);
// now u can parse extradata to get your fields .
The data I want to send is couple of bytes (some information of current
element) which will be used in next element's _setcap() funct. So we could
not wait the gst_pad_push() function to send.
thanks,
Weian
-----Original Message-----
Sent: 2009Äê8ÔÂ20ÈÕ 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()
Post by Chen, Weian
Hi All,
I need to send some data to the next element before calling the _chain
function (such as send the data from src element to encoder element),
does
Post by Chen, Weian
it possible?
Can you explain in a bit more detail what you want to do?
You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?
What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?
Mike
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,
Sudarshan Bisht
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,
Sudarshan Bisht
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,

Sudarshan Bisht
Chen, Weian
2009-08-20 06:13:19 UTC
Permalink
Take V4l2src as an example, it read data from camera.



thanks,
Weian
________________________________
From: sudarshan bisht [mailto:***@gmail.com]
Sent: 2009Äê8ÔÂ20ÈÕ 13:56
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

what is the source element ? what it reads ? without pushing data how it will stream buffers to next element ?



2009/8/20 Chen, Weian <***@intel.com<mailto:***@intel.com>>



Sorry, actually I should do it in the source element.



So the problem is different, because maybe the source element will not call gst_pad_push at all.



Could you give me some hints?



thanks,

Weian

________________________________

From: sudarshan bisht [mailto:***@gmail.com<mailto:***@gmail.com>]
Sent: 2009Äê8ÔÂ20ÈÕ 13:37

To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()



Do it as soon as you get extradata , before calling gst_pad_push .





2009/8/20 Chen, Weian <***@intel.com<mailto:***@intel.com>>



Thanks a lot for your help.



Then in demuxer side, where (or which function) these code should put?



thanks,

Weian

________________________________

From: sudarshan bisht [mailto:***@gmail.com<mailto:***@gmail.com>]
Sent: 2009Äê8ÔÂ20ÈÕ 12:32

To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()



Hi ,

I think you can send such extradata using caps .


So on demuxer side do :---



GstBuffer *=buf;

buf = gst_buffer_new_and_alloc (size);

memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

gst_buffer_unref (buf);

On Decoder side in _setcaps function u can do :----





GstBuffer *codec_data = NULL;


guint8* extradata =NULL;

capStruct = gst_caps_get_structure(caps,0);

/* Read extra data passed via demuxer. */
value = gst_structure_get_value(capStruct, "codec_data");


codec_data = gst_value_get_buffer(value);



extradata =GST_BUFFER_DATA(codec_data);



// now u can parse extradata to get your fields .





2009/8/20 Chen, Weian <***@intel.com<mailto:***@intel.com>>

The data I want to send is couple of bytes (some information of current element) which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:***@xiph.org<mailto:***@xiph.org>]
Sent: 2009Äê8ÔÂ20ÈÕ 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()
Post by Chen, Weian
Hi All,
I need to send some data to the next element before calling the _chain
function (such as send the data from src element to encoder element), does
it possible?
Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net<mailto:gstreamer-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net<mailto:gstreamer-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,

Sudarshan Bisht

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net<mailto:gstreamer-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,

Sudarshan Bisht

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net<mailto:gstreamer-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,

Sudarshan Bisht
sudarshan bisht
2009-08-20 06:38:33 UTC
Permalink
Actually i am not very sure where to do it in such elements .
Post by Chen, Weian
Take V4l2src as an example, it read data from camera.
thanks,
Weian
------------------------------
*Sent:* 2009Äê8ÔÂ20ÈÕ 13:56
*To:* Discussion of the development of GStreamer
*Subject:* Re: [gst-devel] How to send data to next elemnet before calling
_chain()
what is the source element ? what it reads ? without pushing data how it
will stream buffers to next element ?
Sorry, actually I should do it in the source element.
So the problem is different, because maybe the source element will not call
gst_pad_push at all.
Could you give me some hints?
thanks,
Weian
------------------------------
*Sent:* 2009Äê8ÔÂ20ÈÕ 13:37
*To:* Discussion of the development of GStreamer
*Subject:* Re: [gst-devel] How to send data to next elemnet before calling
_chain()
Do it as soon as you get extradata , before calling gst_pad_push .
Thanks a lot for your help.
Then in demuxer side, where (or which function) these code should put?
thanks,
Weian
------------------------------
*Sent:* 2009Äê8ÔÂ20ÈÕ 12:32
*To:* Discussion of the development of GStreamer
*Subject:* Re: [gst-devel] How to send data to next elemnet before calling
_chain()
Hi ,
I think you can send such extradata using caps .
So on demuxer side do :---
GstBuffer *=buf;
buf = gst_buffer_new_and_alloc (size);
memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an
extradata (should be guint8*) , size);
gst_caps_set_simple (stream->caps,"codec_data",
GST_TYPE_BUFFER, buf, NULL);
gst_buffer_unref (buf);
On Decoder side in _setcaps function u can do :----
GstBuffer *codec_data = NULL;
guint8* extradata =NULL;
capStruct = gst_caps_get_structure(caps,0);
/* Read extra data passed via demuxer. */
value = gst_structure_get_value(capStruct, "codec_data");
codec_data = gst_value_get_buffer(value);
extradata =GST_BUFFER_DATA(codec_data);
// now u can parse extradata to get your fields .
The data I want to send is couple of bytes (some information of current
element) which will be used in next element's _setcap() funct. So we could
not wait the gst_pad_push() function to send.
thanks,
Weian
-----Original Message-----
Sent: 2009Äê8ÔÂ20ÈÕ 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()
Post by Chen, Weian
Hi All,
I need to send some data to the next element before calling the _chain
function (such as send the data from src element to encoder element),
does
Post by Chen, Weian
it possible?
Can you explain in a bit more detail what you want to do?
You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?
What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?
Mike
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,
Sudarshan Bisht
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,
Sudarshan Bisht
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,
Sudarshan Bisht
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,

Sudarshan Bisht
Chen, Weian
2009-08-20 09:04:36 UTC
Permalink
Hi,

I have another question, could you help to answew:

In your code, for stream->caps, whose caps is it?

thanks,
Weian
________________________________
From: sudarshan bisht [mailto:***@gmail.com]
Sent: 2009Äê8ÔÂ20ÈÕ 12:32
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

Hi ,
I think you can send such extradata using caps .

So on demuxer side do :---

GstBuffer *=buf;

buf = gst_buffer_new_and_alloc (size);

memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

gst_buffer_unref (buf);
On Decoder side in _setcaps function u can do :----


GstBuffer *codec_data = NULL;

guint8* extradata =NULL;

capStruct = gst_caps_get_structure(caps,0);

/* Read extra data passed via demuxer. */
value = gst_structure_get_value(capStruct, "codec_data");

codec_data = gst_value_get_buffer(value);

extradata =GST_BUFFER_DATA(codec_data);

// now u can parse extradata to get your fields .


2009/8/20 Chen, Weian <***@intel.com<mailto:***@intel.com>>

The data I want to send is couple of bytes (some information of current element) which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian
-----Original Message-----
From: Michael Smith [mailto:***@xiph.org<mailto:***@xiph.org>]
Sent: 2009Äê8ÔÂ20ÈÕ 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()
Post by Chen, Weian
Hi All,
I need to send some data to the next element before calling the _chain
function (such as send the data from src element to encoder element), does
it possible?
Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net<mailto:gstreamer-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net<mailto:gstreamer-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,

Sudarshan Bisht
sudarshan bisht
2009-08-20 09:39:01 UTC
Permalink
Hi ,

You would be setting some caps on the buffer before passing it to next
element . It is that buffer.
Post by Chen, Weian
Hi,
In your code, for stream->caps, whose caps is it?
thanks,
Weian
------------------------------
*Sent:* 2009Äê8ÔÂ20ÈÕ
12:32
*To:* Discussion of the development of GStreamer
*Subject:* Re: [gst-devel] How to send data to next elemnet before calling
_chain()
Hi ,
I think you can send such extradata using caps .
So on demuxer side do :---
GstBuffer *=buf;
buf = gst_buffer_new_and_alloc (size);
memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an
extradata (should be guint8*) , size);
gst_caps_set_simple (stream->caps,"codec_data",
GST_TYPE_BUFFER, buf, NULL);
gst_buffer_unref (buf);
On Decoder side in _setcaps function u can do :----
GstBuffer *codec_data = NULL;
guint8* extradata =NULL;
capStruct = gst_caps_get_structure(caps,0);
/* Read extra data passed via demuxer. */
value = gst_structure_get_value(capStruct, "codec_data");
codec_data = gst_value_get_buffer(value);
extradata =GST_BUFFER_DATA(codec_data);
// now u can parse extradata to get your fields .
The data I want to send is couple of bytes (some information of current
element) which will be used in next element's _setcap() funct. So we could
not wait the gst_pad_push() function to send.
thanks,
Weian
-----Original Message-----
Sent: 2009Äê8ÔÂ20ÈÕ 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()
Post by Chen, Weian
Hi All,
I need to send some data to the next element before calling the _chain
function (such as send the data from src element to encoder element),
does
Post by Chen, Weian
it possible?
Can you explain in a bit more detail what you want to do?
You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?
What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?
Mike
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,
Sudarshan Bisht
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
--
Regards,

Sudarshan Bisht
Chen, Weian
2009-08-20 12:35:26 UTC
Permalink
Hi All

Who will call the override function gst_x264_enc_sink_set_caps (GstPad * pad, GstCaps * caps) in gstx264enc? the gstreamer core? Then which func?

And if I want to add some codec_data into caps (above caps), where should I modify, suppose it should be modified in the upstream element such as v4l2src (we can take it as an example)?

In another word, where is the caps form?

Thanks in advanced.

thanks,
Weian
Michael Smith
2009-08-20 18:45:55 UTC
Permalink
Post by Chen, Weian
Hi All
Who will call the override function gst_x264_enc_sink_set_caps (GstPad *
pad, GstCaps * caps) in gstx264enc? the gstreamer core? Then which func?
The core will call this when the caps get set on the peer pad (by the
upstream element).
Post by Chen, Weian
And if I want to add some codec_data into caps (above caps), where should I
modify, suppose it should be modified in the upstream element such as
v4l2src (we can take it as an example)?
Yes, in the upstream element. However, don't do this arbitrarily - for
your example, x264enc has as its input raw video. Raw video has well
defined caps, adding arbitrary other things to those caps would be a
bad idea.

You should explain, with _specific details_, what you want to do, so
that we can suggest a better approach for what you're trying to do.

Mike
Chen, Weian
2009-08-20 23:03:38 UTC
Permalink
Thanks Michael.

I have some information (couple of bytes) has to be passed to next element before it call _set_caps.

Now I add codec_data to the caps of upstream element's srcpad, and then set this caps to the buffer which will be sent to next element, with this, I can get the codec_data in next element's _set_caps function. Thanks for sudarshan's hint.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:***@xiph.org]
Sent: 2009年8月21日 2:46
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] who will call x264enc's _setcap function?
Post by Chen, Weian
Hi All
Who will call the override function gst_x264_enc_sink_set_caps (GstPad *
pad, GstCaps * caps) in gstx264enc? the gstreamer core? Then which func?
The core will call this when the caps get set on the peer pad (by the
upstream element).
Post by Chen, Weian
And if I want to add some codec_data into caps (above caps), where should I
modify, suppose it should be modified in the upstream element such as
v4l2src (we can take it as an example)?
Yes, in the upstream element. However, don't do this arbitrarily - for
your example, x264enc has as its input raw video. Raw video has well
defined caps, adding arbitrary other things to those caps would be a
bad idea.

You should explain, with _specific details_, what you want to do, so
that we can suggest a better approach for what you're trying to do.

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreame
Michael Smith
2009-08-20 23:10:10 UTC
Permalink
Post by Chen, Weian
Thanks Michael.
I have some information (couple of bytes) has to be passed to next element before it call _set_caps.
As I said, if you provide _specific details_, we can try to advise
about what you should do. You're refusing to provide specific details,
so we can't suggest the proper way to do things - all we can do is
guess at what you actually want to do.

For an element like x264enc (in your example) it would be totally
inappropriate to add codec_data to the upstream element's srcpad caps.
So, either your example is completely different from what you actually
want to do, or you need to explain _exactly_ what you want to do so
that we can tell you what the proper approach is.

Mike
Chen, Weian
2009-08-21 01:20:25 UTC
Permalink
Hi Mike,

What I want to pass from upstream element (camera source element) to next element (encode element) is the buffer ID of the hardware (such as camera's image buffer), which should be use in encode element's _set_caps for encoder's initialization.

I am not sure whether the information is enough.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:***@xiph.org]
Sent: 2009年8月21日 7:10
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] who will call x264enc's _setcap function?
Post by Chen, Weian
Thanks Michael.
I have some information (couple of bytes) has to be passed to next element before it call _set_caps.
As I said, if you provide _specific details_, we can try to advise
about what you should do. You're refusing to provide specific details,
so we can't suggest the proper way to do things - all we can do is
guess at what you actually want to do.

For an element like x264enc (in your example) it would be totally
inappropriate to add codec_data to the upstream element's srcpad caps.
So, either your example is completely different from what you actually
want to do, or you need to explain _exactly_ what you want to do so
that we can tell you what the proper approach is.

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net
https://lists.sourceforge.n
Josep Torra
2009-08-21 08:08:23 UTC
Permalink
Hi Weian,

Caps aren't appropriate to transport information that changes for each buffer.

I can't really figure out what are you trying to do but I will expose you a possible scenario.

Having a src element that is capable to generate image buffers with video data stored in graphics
memory that can be referenced by an ID (hardware surface).

Having a video encoder that can encode a hardware surface like recent additions VAAPI.

The problem related to this scenario is how to pass surface ID between elements to avoid
pull/push the video data in main memory.

In this use case what is recommended is that both elements negotiate a kind of stream like
between video/x-raw-yuv and video/x-raw-va choices.

The content of buffers will be different depending on which kind of stream is negotiated:

video/x-raw-yuv : a frame per buffer in the form of raw video data in planar form.
video/x-raw-va : a frame per buffer in the form of an specialized structure containing the
hardware surface ID.

I'm in process to introduce video acceleration to gstreamer in a generic way, maybe are you
interested on reading the draft about the topic [1].

Current status is write/design the code for simple playback uses cases and the plan is extend it
into more use cases in the future.

[1] http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/docs/design/draft-va.txt

Best regards.

Josep
Post by Chen, Weian
Hi Mike,
What I want to pass from upstream element (camera source element) to next element (encode element) is the buffer ID of the hardware (such as camera's image buffer), which should be use in encode element's _set_caps for encoder's initialization.
I am not sure whether the information is enough.
thanks,
Weian
-----Original Message-----
Sent: 2009年8月21日 7:10
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] who will call x264enc's _setcap function?
Post by Chen, Weian
Thanks Michael.
I have some information (couple of bytes) has to be passed to next element before it call _set_caps.
As I said, if you provide _specific details_, we can try to advise
about what you should do. You're refusing to provide specific details,
so we can't suggest the proper way to do things - all we can do is
guess at what you actually want to do.
For an element like x264enc (in your example) it would be totally
inappropriate to add codec_data to the upstream element's srcpad caps.
So, either your example is completely different from what you actually
want to do, or you need to explain _exactly_ what you want to do so
that we can tell you what the proper approach is.
Mike
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Chen, Weian
2009-08-21 12:55:27 UTC
Permalink
Josep,

Awesome work.

It is great that you can know VAAPI. But my usage is a little bit different. The camera's buffer IDs I want to transport in caps would be used by vaCreateSurface, suppose it should be in _get_caps function but not _chain function. And further more, these buffer IDs will not change once they are created.

And what you are talking about are next step I need to do, you help me a lot. :)

thanks,
Weian
-----Original Message-----
From: Josep Torra [mailto:***@gmail.com]
Sent: 2009年8月21日 16:08
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] who will call x264enc's _setcap function?

Hi Weian,

Caps aren't appropriate to transport information that changes for each buffer.

I can't really figure out what are you trying to do but I will expose you a possible scenario.

Having a src element that is capable to generate image buffers with video data stored in graphics
memory that can be referenced by an ID (hardware surface).

Having a video encoder that can encode a hardware surface like recent additions VAAPI.

The problem related to this scenario is how to pass surface ID between elements to avoid
pull/push the video data in main memory.

In this use case what is recommended is that both elements negotiate a kind of stream like
between video/x-raw-yuv and video/x-raw-va choices.

The content of buffers will be different depending on which kind of stream is negotiated:

video/x-raw-yuv : a frame per buffer in the form of raw video data in planar form.
video/x-raw-va : a frame per buffer in the form of an specialized structure containing the
hardware surface ID.

I'm in process to introduce video acceleration to gstreamer in a generic way, maybe are you
interested on reading the draft about the topic [1].

Current status is write/design the code for simple playback uses cases and the plan is extend it
into more use cases in the future.

[1] http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/docs/design/draft-va.txt

Best regards.

Josep
Post by Chen, Weian
Hi Mike,
What I want to pass from upstream element (camera source element) to next element (encode element) is the buffer ID of the hardware (such as camera's image buffer), which should be use in encode element's _set_caps for encoder's initialization.
I am not sure whether the information is enough.
thanks,
Weian
-----Original Message-----
Sent: 2009年8月21日 7:10
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] who will call x264enc's _setcap function?
Post by Chen, Weian
Thanks Michael.
I have some information (couple of bytes) has to be passed to next element before it call _set_caps.
As I said, if you provide _specific details_, we can try to advise
about what you should do. You're refusing to provide specific details,
so we can't suggest the proper way to do things - all we can do is
guess at what you actually want to do.
For an element like x264enc (in your example) it would be totally
inappropriate to add codec_data to the upstream element's srcpad caps.
So, either your example is completely different from what you actually
want to do, or you need to explain _exactly_ what you want to do so
that we can tell you what the proper approach is.
Mike
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstrea
Chen, Weian
2009-08-24 09:29:47 UTC
Permalink
Hi All

I have a problem when doing encode + mux:

Encode pipeline is as following: gst-launch videotestsrc ! x264enc ! mp4mux ! filesink location=test.mp4, and then I use crtl + c to destroy the pipeline, then using gst-launch filesrc location=1.mp4 ! qtdemux ! ffdec_h264 ! xvimagesink to decoder, but the pipeline is hang up with log:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...


But if I use gst-launch videotestsrc num-buffers=30 ! x264enc ! mp4mux ! filesink location=test.mp4, and do not use ctrl + c to destroy, the decoder pipeline can work well.

Could anyone here help to explain this strange phenomenon to me?

Thanks in advanced.

thanks,
Weian
thiagoss
2009-08-24 10:51:44 UTC
Permalink
Post by Chen, Weian
Hi All
Encode pipeline is as following: *gst-launch videotestsrc ! x264enc !
mp4mux ! filesink location=test.mp4*, and then I use crtl + c to destroy
the pipeline, then using *gst-launch filesrc location=1.mp4 ! qtdemux !
ffdec_h264 ! xvimagesink* to decoder, but the pipeline is hang up with
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
But if I use *gst-launch videotestsrc num-buffers=30 ! x264enc ! mp4mux !
filesink location=test.mp4*, and do not use ctrl + c to destroy, the
decoder pipeline can work well.
Could anyone here help to explain this strange phenomenon to me?
When you press ctrl+c the source element does not push an EOS event to the
downstream elements, the pipeline is simply shut down. The muxer needs to
receive an EOS event to know that the data streaming has ended and properly
finish the mp4 file (like seeking back to the start of the file to rewrite
some fields that he coudn't write back at the start).

if you use '-e' option in gst-launch it forces an EOS at the pipeline when
ctrl+c is pressed and all should work fine.
Post by Chen, Weian
Thanks in advanced.
thanks,
Weian
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
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)
Michael Smith
2009-08-24 17:41:08 UTC
Permalink
Post by Chen, Weian
Hi All
Encode pipeline is as following:  gst-launch videotestsrc ! x264enc ! mp4mux
! filesink location=test.mp4, and then I use crtl + c to destroy the
This will create an invalid mp4 file since you just terminated the
pipeline without EOSing properly, so it doesn't have a chance to write
the final file headers correctly.
Post by Chen, Weian
pipeline, then using   gst-launch filesrc location=1.mp4 ! qtdemux !
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
However, given an invalid file, I'd expect it to error out - does it
do so if you use decodebin or decodebin2?

If not, sounds like a bug, you should file a bug report.

Mike
Chen, Weian
2009-08-25 02:38:28 UTC
Permalink
Thanks all.
If use decodebin or decodebin2, also no error out.

Then I will file a bug later.

thanks,
Weian
-----Original Message-----
From: Michael Smith [mailto:***@xiph.org]
Sent: 2009年8月25日 1:41
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] Question on x264enc + mp4mux
Post by Chen, Weian
Hi All
Encode pipeline is as following:  gst-launch videotestsrc ! x264enc ! mp4mux
! filesink location=test.mp4, and then I use crtl + c to destroy the
This will create an invalid mp4 file since you just terminated the
pipeline without EOSing properly, so it doesn't have a chance to write
the final file headers correctly.
Post by Chen, Weian
pipeline, then using   gst-launch filesrc location=1.mp4 ! qtdemux !
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
However, given an invalid file, I'd expect it to error out - does it
do so if you use decodebin or decodebin2?

If not, sounds like a bug, you should file a bug report.

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
gstreamer-***@lists.sourceforge.net
https://lists.s
Chen, Weian
2009-08-26 12:51:23 UTC
Permalink
Hi all,

We developed a video-sink plug-in, but have some problem to work with totem.

When we display the video to the Totem window, video is sometimes very munged, but When using the window created by video-sink, it all looks good.

Could anybody here to give me some hints?

Thanks in advanced.

thanks,
Weian
Michael Smith
2009-08-26 17:23:49 UTC
Permalink
Post by Chen, Weian
Hi all,
We developed a video-sink plug-in, but have some problem to work with totem.
When we display the video to the Totem window, video is sometimes very munged, but When using the window created by video-sink, it all looks good.
Could anybody here to give me some hints?
You'll need to give vastly more detail for us to be able to help.

What exactly is wrong with the display? Does it depend on the video
size? The pixel aspect ratio? Something else?

Mike

Loading...