How to set capability for the src's of rtpmp4gpay?

Psychesnet Hsieh psychesnet at
Mon Aug 3 06:53:19 UTC 2020

Hi all,

I'm testing gst-rtsp-server library, I call test_appsrc.cpp and change the
input as appsrc(video), anything looks work good.

And I try to add AAC stream. My appsrc can output complete AAC frame at
each callback. So, I add
1. factory

*    gst_rtsp_media_factory_set_launch (factory,            "( appsrc
name=dummy_h264 ! rtph264pay name=pay0 pt=96 "            "  appsrc
name=dummy_aac ! rtpmp4gpay name=pay1 pt=97 )");*
2. when connect is coming

*    /* get our vsrc, we named it 'dummy' with the name property */    asrc
= gst_bin_get_by_name_recurse_up (GST_BIN (element), "dummy_aac");
/* this instructs asrc that we will be dealing with timed buffer */
gst_util_set_object_arg (G_OBJECT (asrc), "format", "time");    /*
configure the caps of the video */    g_object_set (G_OBJECT (asrc),
"caps",            gst_caps_new_simple ("audio/mpeg",
"format", G_TYPE_STRING, "AAC-LC",                "layout", G_TYPE_STRING,
"interleaved",                "rate", G_TYPE_INT, 16000,
"channels", G_TYPE_INT, 1, NULL), NULL);                    /* install the
callback that will be called when a buffer is needed */    g_signal_connect
(asrc, "need-data", (GCallback) need_aac_data, ctx);    gst_object_unref

At 2, the capability is for appsrc(audio).
I double check the capability of rtpmp4gpay, like

*  SRC template: 'src'    Availability: Always    Capabilities:
application/x-rtp                  media: { (string)video, (string)audio,
(string)application }                payload: [ 96, 127 ]
 clock-rate: [ 1, 2147483647 ]          encoding-name: MPEG4-GENERIC
     streamtype: { (string)4, (string)5 }                   mode: {
(string)generic, (string)CELP-cbr, (string)CELP-vbr, (string)AAC-lbr,
(string)AAC-hbr }*

How do I set up the src's of rtpmp4gpay? Does anyone can give me a tip?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list