How to set streamheader in caps of appsrc?

Nicolas Dufresne nicolas at ndufresne.ca
Sat Feb 22 22:09:44 UTC 2020


Le sam. 22 févr. 2020 17 h 00, jeyp4 <jaiforfriend at gmail.com> a écrit :

> Hi
>
> I want to use appsrc as opussrc.
> I have set the all caps parameters
> caps = gst_caps_new_simple("audio/x-opus",
>                                        "rate", G_TYPE_INT, 16000,
>                                        "channels", G_TYPE_INT, 1,
>                                        "channel-mapping-family",
> G_TYPE_INT,
> 0,
>                                        "stream-count", G_TYPE_INT, 1,
>                                        "coupled-count", G_TYPE_INT, 0,
>                                        NULL
>                                        );
>
> But I think I have to set streamheader also, in order to avoid using
> opusparse. Because parsing may result in being a source of latency.
>
> I can know the stream headers by just simple command line.
> gst-launch-1.0 pulsesrc buffer-time=20000 ! opusenc frame-size=20 ! opusdec
> ! pulsesink buffer-time=20000 -v
>
> /GstPipeline:pipeline0/GstOpusEnc:opusenc0.GstPad:src: caps =
> "audio/x-opus\,\ rate\=\(int\)16000\,\
> channels\=\(int\)1\,\channel-mapping-family\=\(int\)0\,\
> stream-count\=\(int\)1\,\ coupled-count\=\(int\)0\,\
>
> streamheader\=\(buffer\)\<\4f7075734865616401013801803e0000000000\,\4f707573546167731e000000456e636f6465642077697468204753747265616d6572206f707573656e630000000001\
> \>"
>
> So, the stream headers are: 4f7075734865616401013801803e0000000000,
>
> 4f707573546167731e000000456e636f6465642077697468204753747265616d6572206f707573656e630000000001.
>
> How can I set these in appsrc's caps?
>

You need a GstBuffer, propably use new and allocate helper. The you have to
write this data in. You could also use an guint8 array, with the data in
hex, then use new wrap helper.


>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200222/62ae118d/attachment.htm>


More information about the gstreamer-devel mailing list