How to set streamheader in caps of appsrc?

jeyp4 jaiforfriend at gmail.com
Sat Feb 22 20:47:55 UTC 2020


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?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list