<div dir="ltr">Hi all,<div><br></div><div>Does anyone can provide me a sample code which can stream out h264/aac at same time when RTSP client do a request? Thanks.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Psychesnet Hsieh <<a href="mailto:psychesnet@gmail.com">psychesnet@gmail.com</a>> 於 2020年8月3日 週一 下午2:53寫道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I'm testing gst-rtsp-server library, I call test_appsrc.cpp and change the input as appsrc(video), anything looks work good.</div><div><br></div><div>And I try to add AAC stream. My appsrc can output complete AAC frame at each callback. So, I add</div><div>1. factory</div><div><i> gst_rtsp_media_factory_set_launch (factory,<br> "( appsrc name=dummy_h264 ! rtph264pay name=pay0 pt=96 "<br> " appsrc name=dummy_aac ! rtpmp4gpay name=pay1 pt=97 )");</i><br></div><div>2. when connect is coming</div><div><i> /* get our vsrc, we named it 'dummy' with the name property */<br> asrc = gst_bin_get_by_name_recurse_up (GST_BIN (element), "dummy_aac");<br> <br> /* this instructs asrc that we will be dealing with timed buffer */<br> gst_util_set_object_arg (G_OBJECT (asrc), "format", "time");<br> /* configure the caps of the video */<br> g_object_set (G_OBJECT (asrc), "caps",<br> gst_caps_new_simple ("audio/mpeg",<br> "format", G_TYPE_STRING, "AAC-LC",<br> "layout", G_TYPE_STRING, "interleaved",<br> "rate", G_TYPE_INT, 16000, <br> "channels", G_TYPE_INT, 1, NULL), NULL);<br> <br> /* install the callback that will be called when a buffer is needed */<br> g_signal_connect (asrc, "need-data", (GCallback) need_aac_data, ctx);<br> gst_object_unref (asrc);</i><br></div><div><br></div><div>At 2, the capability is for appsrc(audio).</div><div>I double check the capability of rtpmp4gpay, like</div><div><i> SRC template: 'src'<br> Availability: Always<br> Capabilities:<br> application/x-rtp<br> media: { (string)video, (string)audio, (string)application }<br> payload: [ 96, 127 ]<br> clock-rate: [ 1, 2147483647 ]<br> encoding-name: MPEG4-GENERIC<br> streamtype: { (string)4, (string)5 }<br> mode: { (string)generic, (string)CELP-cbr, (string)CELP-vbr, (string)AAC-lbr, (string)AAC-hbr }</i><br></div><div><i><br></i></div><div>How do I set up the src's of rtpmp4gpay? Does anyone can give me a tip? Thanks.</div></div>
</blockquote></div>