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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Psychesnet Hsieh
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 (asrc);


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? Thanks.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

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

Psychesnet Hsieh
Hi all,

Does anyone can provide me a sample code which can stream out h264/aac at same time when RTSP client do a request? Thanks.

Psychesnet Hsieh <[hidden email]> 於 2020年8月3日 週一 下午2:53寫道:
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 (asrc);


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? Thanks.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel