How can make rtpmp4gpay work with udpsink?

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

How can make rtpmp4gpay work with udpsink?

Psychesnet Hsieh
Hi all,

I'm planning to write a testing tool which can output RTP packet with AAC-LC frame inside and out from UDP.
The server side, I expect the command like
"gst-launch-1.0 udpsrc port=1234 ! application/x-rtp,media=audio,clock-rate=16000,encoding-name=MPEG4-GENERIC,mode=AAC-lbr ! rtpmp4gdepay ! aacparse ! avdec_aac ! autoaudiosink"

The client side, my program is
app->pipeline = gst_parse_launch("appsrc name=ringbuf ! aacparse ! rtpmp4gpay pt=97 ! udpsink host=192.168.143.101 port=1234", NULL);

Question:
1. The server always return failure when receive packet? Why? How can I fix it?
0:00:04.060492843 65130 0x5571ecf301e0 INFO               GST_EVENT gstevent.c:820:gst_event_new_caps: creating caps event audio/mpeg, mpegversion=(int)4, stream-format=(string)raw
0:00:04.060544955 65130 0x5571ecf301e0 ERROR               aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need codec_data for raw AAC
0:00:04.060604164 65130 0x5571ecf301e0 INFO               GST_EVENT gstevent.c:900:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, offset=0:00:00.000000000, stop=99:99:99.999999999, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:03.993803726, duration 99:99:99.999999999
0:00:04.060683105 65130 0x5571ecf301e0 ERROR               aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need codec_data for raw AAC
0:00:04.060717219 65130 0x5571ecf301e0 ERROR               aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need codec_data for raw AAC
0:00:04.060768233 65130 0x5571ecf301e0 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<udpsrc0> error: Internal data stream error.
0:00:04.060788144 65130 0x5571ecf301e0 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<udpsrc0> error: streaming stopped, reason not-negotiated (-4)
0:00:04.060826233 65130 0x5571ecf301e0 INFO        GST_ERROR_SYSTEM gstelement.c:2140:gst_element_message_full_with_details:<udpsrc0> posting message: Internal data stream error.
0:00:04.060920528 65130 0x5571ecf301e0 INFO        GST_ERROR_SYSTEM gstelement.c:2167:gst_element_message_full_with_details:<udpsrc0> posted error message: Internal data stream error.
0:00:04.060970888 65130 0x5571ecf301e0 ERROR               aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need codec_data for raw AAC
0:00:04.061013514 65130 0x5571ecf301e0 ERROR               aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need codec_data for raw AAC
0:00:04.061057431 65130 0x5571ecf301e0 ERROR               aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need codec_data for raw AAC
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming stopped, reason not-negotiated (-4)


2. At client part, program will always be Segmentation fault after calling stop feeding. How can I debug it?
0:00:02.865150236  1601     0x1a229e00 INFO         appsrc-pipeline ringbuf_appsrc_dummy_aac_rtp_udpsink.cpp:68:stop_feed: stop feeding
0:00:03.475274389  1601     0x1a229e00 INFO         appsrc-pipeline ringbuf_appsrc_dummy_aac_rtp_udpsink.cpp:77:bus_message: got message tag
0:00:04.115481364  1601     0x1a229e00 INFO         appsrc-pipeline ringbuf_appsrc_dummy_aac_rtp_udpsink.cpp:77:bus_message: got message tag
Segmentation fault


Please help. If you want, I can upload my code. 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 can make rtpmp4gpay work with udpsink?

Tim Müller
On Wed, 2020-08-05 at 09:36 +0800, Psychesnet Hsieh wrote:

Hi,

> Question:
> 1. The server always return failure when receive packet? Why? How can
> I fix it?

It tells you right there in the log :)

> 0:00:04.060492843 65130 0x5571ecf301e0 INFO               GST_EVENT
> gstevent.c:820:gst_event_new_caps: creating caps event audio/mpeg,
> mpegversion=(int)4, stream-format=(string)raw
> 0:00:04.060544955 65130 0x5571ecf301e0 ERROR               aacparse
> gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need
> codec_data for raw AAC

It expects a codec data field in the caps if you pass stream-
format=raw.

Alternatively you can try passing the AAC data with an ADTS header.

Cheers
 Tim
--
Tim Müller, Centricular Ltd - http://www.centricular.com

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

Re: How can make rtpmp4gpay work with udpsink?

Psychesnet Hsieh
Hi Tim,

Thanks.
My AAC frame is with ADTS header.
How can I set format with ADTS? Thanks.

Tim Müller <[hidden email]> 於 2020年8月5日 週三 下午5:01寫道:
On Wed, 2020-08-05 at 09:36 +0800, Psychesnet Hsieh wrote:

Hi,

> Question:
> 1. The server always return failure when receive packet? Why? How can
> I fix it?

It tells you right there in the log :)

> 0:00:04.060492843 65130 0x5571ecf301e0 INFO               GST_EVENT
> gstevent.c:820:gst_event_new_caps: creating caps event audio/mpeg,
> mpegversion=(int)4, stream-format=(string)raw
> 0:00:04.060544955 65130 0x5571ecf301e0 ERROR               aacparse
> gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need
> codec_data for raw AAC

It expects a codec data field in the caps if you pass stream-
format=raw.

Alternatively you can try passing the AAC data with an ADTS header.

Cheers
 Tim
--
Tim Müller, Centricular Ltd - http://www.centricular.com

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

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

Re: How can make rtpmp4gpay work with udpsink?

Tim Müller
On Wed, 2020-08-05 at 17:04 +0800, Psychesnet Hsieh wrote:

> My AAC frame is with ADTS header.
> How can I set format with ADTS? Thanks.

Tried stream-format=adts yet?

Cheers
 Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

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

Re: How can make rtpmp4gpay work with udpsink?

Psychesnet Hsieh
Hi Tim,

Yes, I already try it before. "gst-launch-1.0 udpsrc port=1234 ! application/x-rtp,media=audio,clock-rate=16000,encoding-name=MPEG4-GENERIC,mode=AAC-lbr ! rtpmp4gdepay ! aacparse ! audio/mpeg,mpegversion=4,stream-format=adts ! avdec_aac ! autoaudiosink"
0:00:01.898194873 43326 0x55b40429e1e0 INFO               GST_EVENT gstevent.c:820:gst_event_new_caps: creating caps event application/x-rtp, media=(string)audio, clock-rate=(int)16000, encoding-name=(string)MPEG4-GENERIC, mode=(string)AAC-lbr
0:00:01.898364972 43326 0x55b40429e1e0 INFO               GST_EVENT gstevent.c:820:gst_event_new_caps: creating caps event audio/mpeg, mpegversion=(int)4, stream-format=(string)raw
0:00:01.898457880 43326 0x55b40429e1e0 ERROR               aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need codec_data for raw AAC
0:00:01.898602694 43326 0x55b40429e1e0 INFO               GST_EVENT gstevent.c:900:gst_event_new_segment: creating segment event time segment start=0:00:00.000000000, offset=0:00:00.000000000, stop=99:99:99.999999999, rate=1.000000, applied_rate=1.000000, flags=0x00, time=0:00:00.000000000, base=0:00:00.000000000, position 0:00:01.817802228, duration 99:99:99.999999999
0:00:01.898746315 43326 0x55b40429e1e0 ERROR               aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need codec_data for raw AAC
0:00:01.898818251 43326 0x55b40429e1e0 ERROR               aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need codec_data for raw AAC
0:00:01.898895373 43326 0x55b40429e1e0 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<udpsrc0> error: Internal data stream error.
0:00:01.898923016 43326 0x55b40429e1e0 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<udpsrc0> error: streaming stopped, reason not-negotiated (-4)
0:00:01.898983683 43326 0x55b40429e1e0 INFO        GST_ERROR_SYSTEM gstelement.c:2140:gst_element_message_full_with_details:<udpsrc0> posting message: Internal data stream error.
0:00:01.899123271 43326 0x55b40429e1e0 INFO        GST_ERROR_SYSTEM gstelement.c:2167:gst_element_message_full_with_details:<udpsrc0> posted error message: Internal data stream error.
0:00:01.899194207 43326 0x55b40429e1e0 ERROR               aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need codec_data for raw AAC
0:00:01.899223748 43326 0x55b40429e1e0 ERROR               aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need codec_data for raw AAC
0:00:01.899272123 43326 0x55b40429e1e0 ERROR               aacparse gstaacparse.c:354:gst_aac_parse_sink_setcaps:<aacparse0> Need codec_data for raw AAC
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming stopped, reason not-negotiated (-4)
0:00:01.899395118 43326 0x55b40429e1e0 WARN           audiobasesink gstaudiobasesink.c:1115:gst_audio_base_sink_wait_event:<autoaudiosink0-actual-sink-pulse> error: Sink not negotiated before eos event.
Execution ended after 0:00:01.819139648
Setting pipeline to PAUSED ...


Looks like I use the wrong way to set it. How can I change stream-format as adts? Thanks.

Tim Müller <[hidden email]> 於 2020年8月5日 週三 下午6:36寫道:
On Wed, 2020-08-05 at 17:04 +0800, Psychesnet Hsieh wrote:

> My AAC frame is with ADTS header.
> How can I set format with ADTS? Thanks.

Tried stream-format=adts yet?

Cheers
 Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com


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

Re: How can make rtpmp4gpay work with udpsink?

Tim Müller
On Thu, 2020-08-06 at 08:53 +0800, Psychesnet Hsieh wrote:

Hi

> Yes, I already try it before. "gst-launch-1.0 udpsrc port=1234 !
> application/x-rtp,media=audio,clock-rate=16000,encoding-name=MPEG4-
> GENERIC,mode=AAC-lbr ! rtpmp4gdepay ! aacparse !
> audio/mpeg,mpegversion=4,stream-format=adts ! avdec_aac !
> autoaudiosink"

Weren't we talking about the *server* pipeline with the appsrc? I was
talking about that, and I assume the log messages were in reference to
that as it seems unlikely that rtpmp4gdepay is creating invalid aac
caps.

On the receiver side, there should be no need for a capsfilter between
aacparse and avdec_aac, they should figure out the format between
themselves automatically.

Cheers
 Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

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

Re: How can make rtpmp4gpay work with udpsink?

Psychesnet Hsieh
Hi Tim,

Thanks for prompt reply. Yes, I agree with you, receiver side should not need to specific the capsfiliter.
I will keep receiver side with "gst-launch-1.0 udpsrc port=1234 ! application/x-rtp,media=audio,clock-rate=16000,encoding-name=MPEG4-GENERIC,mode=AAC-lbr ! rtpmp4gdepay ! aacparse ! audio/mpeg,mpegversion=4,stream-format=adts ! avdec_aac ! autoaudiosink" to try.

On sender side, my appsrc, what should I do? or how can I do to set correct cap for rtpmp4gpay? Thanks.

Tim Müller <[hidden email]> 於 2020年8月6日 週四 下午7:35寫道:
On Thu, 2020-08-06 at 08:53 +0800, Psychesnet Hsieh wrote:

Hi

> Yes, I already try it before. "gst-launch-1.0 udpsrc port=1234 !
> application/x-rtp,media=audio,clock-rate=16000,encoding-name=MPEG4-
> GENERIC,mode=AAC-lbr ! rtpmp4gdepay ! aacparse !
> audio/mpeg,mpegversion=4,stream-format=adts ! avdec_aac !
> autoaudiosink"

Weren't we talking about the *server* pipeline with the appsrc? I was
talking about that, and I assume the log messages were in reference to
that as it seems unlikely that rtpmp4gdepay is creating invalid aac
caps.

On the receiver side, there should be no need for a capsfilter between
aacparse and avdec_aac, they should figure out the format between
themselves automatically.

Cheers
 Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

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

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