gstreamer streaming video metadata help
Nicolas Dufresne
nicolas.dufresne at collabora.com
Tue May 3 13:32:21 UTC 2016
Hi Brateesh,
once of the intent of the gstreamer-devel list is to share with all the
readers problems and solutions to commonly encountered issues. For this
purpose, I'm re-introducing the gstreamer-devel to this thread.
Le mardi 03 mai 2016 à 06:31 +0100, brateeshkumar at yahoo.com a écrit :
> hi sir,
> In gstreamer-devel streaming video metadata, you have posted that
> instead of metadata i can use rtpheader to attach the extra data to
> the buffer, 1.whether it is unaffected during encoding ??.
> 2.and i m not able to have both in buffer ,either i can have only
> data or rtpheader not both please help me how to contain the both
It's not during encoding. In fact, you should add the header on already
existing RTP buffer after the payloader. This could be done using a
data probe. Instead of creating a new buffer, you simply "map" the
existing RTP buffer, modify it, and finally unmap it (to commit you
work). See:
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-b
ase-libs/html/gst-plugins-base-libs-gstrtpbuffer.html#gst-rtp-buffer-
map
cheers,
Nicolas
>
> (buffer original data,buffer2 where i want both data and
> rtpheader)
>
> GstBuffer *buffer2 = gst_buffer_new_allocate(NULL, size+100,
> NULL);
>
>
>
>
> gst_rtp_buffer_allocate_data(buffer2, 100, 0, 0);
>
> GstRTPBuffer rtp_buf ={ NULL,0 ,{ NULL, NULL, NULL, NULL },{ 0,
> 0, 0, 0 }, { { NULL, (GstMapFlags)0, NULL, 0, 0,{ 0, },{ 0, } },{
> NULL,(GstMapFlags) 0, NULL, 0, 0,{ 0, },{ 0, } },{ NULL,
> (GstMapFlags)0, NULL, 0, 0,{ 0, },{ 0, } },{ NULL,(GstMapFlags) 0,
> NULL, 0, 0,{ 0, },{ 0, } } } };
>
> if (gst_rtp_buffer_map(buffer2, GST_MAP_READ, &rtp_buf)) {
> int q = p;
> data = &q;
> for (int i = 0; i < 10; i++) {
> q++;
> gst_rtp_buffer_add_extension_onebyte_header(&rt
> p_buf, 1, data, sizeof(int));
> }
> }
> gst_rtp_buffer_unmap(&rtp_buf);
>
>
> GstMapInfo info2;
> gst_buffer_map(buffer2, &info2, (GstMapFlags)GST_MAP_WRITE);
> memcpy(info2.data, (guint8*)info.data, size);
> gst_buffer_unmap(buffer2, &info2);
> gst_buffer_unmap(buffer, &info);
>
>
> thank you,
> brateesh
>
>
>
> _____________________________________
> Sent from http://gstreamer-devel.966125.n4.nabble.com
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160503/3f275982/attachment.sig>
More information about the gstreamer-devel
mailing list