GStreamer - appsrc as audio source

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

GStreamer - appsrc as audio source

canetti
Hi .
I'm capturing audio in my application and trying stream it via GStreamer .
From some reason, I hope, by this post, clarifies, no pipeline I build using appsrc as my
audio source transmits the data wheater the destination is a file , or a UDP sink , or the audio source
stands alone , or with a video source , both undergoing format encoding and muxing .

In all cases GStreamer reacts to data pushes with the following log lines :

0:00:00.118112000  5136   09653CB0 WARN                 basesrc gstbasesrc.c:2563:gst_base_src_loop:<AppAudioSource> error: Internal data flow error.
0:00:00.118112000  5136   09653CB0 WARN                 basesrc gstbasesrc.c:2563:gst_base_src_loop:<AppAudioSource> error: streaming task paused, reason not-negotiated (-4)
0:00:10.121569000  5136   09653CB0 WARN                  wavenc gstwavenc.c:262:gst_wavenc_push_header:<wavenc0> push header failed: flow = wrong-state

Here are 2 pipeline examples that yeild this result :
1:
appsrc name=AppAudioSource caps="audio/x-raw-int,rate=44100,width=16,channels=16,depth=2,signed=(boolean)true" ! wavenc ! filesink location=abc.wav

2:
rtpmux name=mux ! udpsink host=127.0.0.1 port=1234 appsrc name=AppVideoSource caps="video/x-raw-rgb, bpp=32, depth=32, endianness=4321, red_mask=65280, green_mask=16711680, blue_mask=-16777216, alpha_mask=255, framerate=(fraction)20, width=640, height=480" ! videocrop right=0 bottom=0 ! ffmpegcolorspace ! x264enc ! rtph264pay ! application/x-rtp ! mux.sink_0 appsrc name=AppAudioSource caps="audio/x-raw-int,rate=44100,width=16,channels=2,depth=16,signed=(boolean)true" ! vorbisenc ! rtpvorbispay ! application/x-rtp ! mux.sink_1


Thanks In Advance ,
Lior .
Reply | Threaded
Open this post in threaded view
|

Re: GStreamer - appsrc as audio source

Tim-Philipp Müller-2
On Thu, 2011-07-14 at 08:57 -0700, canetti wrote:

> I'm capturing audio in my application and trying stream it via GStreamer .
> From some reason, I hope, by this post, clarifies, no pipeline I build using
> appsrc as my
> audio source transmits the data wheater the destination is a file , or a UDP
> sink , or the audio source
> stands alone , or with a video source , both undergoing format encoding and
> muxing .
>
> In all cases GStreamer reacts to data pushes with the following log lines :
>
> 0:00:00.118112000  5136   09653CB0 WARN                 basesrc
> gstbasesrc.c:2563:gst_base_src_loop:<AppAudioSource> error: Internal data
> flow error.
> 0:00:00.118112000  5136   09653CB0 WARN                 basesrc
> gstbasesrc.c:2563:gst_base_src_loop:<AppAudioSource> error: streaming task
> paused, reason not-negotiated (-4)
> 0:00:10.121569000  5136   09653CB0 WARN                  wavenc
> gstwavenc.c:262:gst_wavenc_push_header:<wavenc0> push header failed: flow =
> wrong-state
>
> Here are 2 pipeline examples that yeild this result :
> 1:
> appsrc name=AppAudioSource
> caps="audio/x-raw-int,rate=44100,width=16,channels=16,depth=2,signed=(boolean)true"
> ! wavenc ! filesink location=abc.wav

Try adding an endianness field as well.

flow=not-negotiated means there's a problem with caps (either no caps or
wrong caps or incomplete caps or there's a converter like
audioconvert/audioresample missing somewhere).

 Cheers
  -Tim


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

Re: GStreamer - appsrc as audio source

cristian
You could check the sink pad from the filesink (or the src pad from encoder to see what is set for your output) I have the same problem, I realised that caps that I give to appsrc src pad is not the one coming out fron the pipe.

Regards.
Reply | Threaded
Open this post in threaded view
|

Re: GStreamer - appsrc as audio source

canetti
Hi .
Thanks for the replays .
I have added the endianess parameter - It still didn't change the results .
I have , however , added the "audioconvert" and "audioresample" elements to the pipeline .
This seems to improve the situation , as the pipeline works and streams the video .
( previously , It switched to "Paused" state )

When I watch the stream in VLC player , the audio controls are grayed out .
This means that VLC thinks there is no audio in the stream .

GStreamer logs a lot of warnings while streaming , as follows :

0:00:00.282226000  5156   098EAF20 WARN            rtpvorbispay gstrtpvorbispay.c:632:gst_rtp_vorbis_pay_handle_buffer:<rtpvorbispay0> warning: Error initializing header config
0:00:00.297851000  5156   098EAF20 WARN            rtpvorbispay gstrtpvorbispay.c:632:gst_rtp_vorbis_pay_handle_buffer:<rtpvorbispay0> warning: Error initializing header config
0:00:00.352538000  5156   098EAF20 WARN            rtpvorbispay gstrtpvorbispay.c:632:gst_rtp_vorbis_pay_handle_buffer:<rtpvorbispay0> warning: Error initializing header config

and so on ...

My pipeline looks like this :

rtpmux name=mux ! udpsink host=127.0.0.1 port=1234 appsrc name=AppVideoSource caps="video/x-raw-rgb, bpp=32, depth=32, endianness=4321, red_mask=65280, green_mask=16711680, blue_mask=-16777216, alpha_mask=255, framerate=(fraction)20, width=640, height=480" ! videocrop right=0 bottom=0 ! ffmpegcolorspace ! x264enc ! rtph264pay ! application/x-rtp ! mux.sink_0 appsrc name=AppAudioSource caps="audio/x-raw-int,rate=44100,width=16,channels=2,endianness=1234,depth=16,signed=(boolean)true" ! audioconvert ! audioresample ! vorbisenc ! rtpvorbispay ! application/x-rtp ! mux.sink_1

What is missing for the "rtpvorbispay" element to work ?


Thanks ,
Lior .
Reply | Threaded
Open this post in threaded view
|

Re: GStreamer - appsrc as audio source

canetti
Anyone ?
Reply | Threaded
Open this post in threaded view
|

Re: GStreamer - appsrc as audio source

canetti
Hi .
If I replace the "vorbisenc ! rtpvorbispay" with "x264enc ! rtph264pay" , The situation returns to what it was - meanning - when streaming starts ( The push functions of the source elements are called ) , The pipeline switches to "Paused" state .

with the following log lines :

0:00:01.699212000  4272   097DCF90 WARN                 basesrc gstbasesrc.c:2563:gst_base_src_loop:<AppAudioSource> error: Internal data flow error.
0:00:01.699212000  4272   097DCF90 WARN                 basesrc gstbasesrc.c:2563:gst_base_src_loop:<AppAudioSource> error: streaming task paused, reason not-negotiated (-4)
0:00:01.699212000  4272   097DCF90 WARN                    faac gstfaac.c:755:gst_faac_push_buffers:<faac0> encoder left 126208 bytes; discarding

The pipeline initialization string is :
rtpmux name=mux ! udpsink host=127.0.0.1 port=1234 appsrc name=AppVideoSource caps="video/x-raw-rgb, bpp=32, depth=32, endianness=4321, red_mask=65280, green_mask=16711680, blue_mask=-16777216, alpha_mask=255, framerate=(fraction)20, width=640, height=480" ! videocrop right=0 bottom=0 ! ffmpegcolorspace ! x264enc ! rtph264pay ! application/x-rtp ! mux.sink_0 appsrc name=AppAudioSource caps="audio/x-raw-int,rate=44100,width=16,channels=2,endianness=1234,depth=16,signed=(boolean)true" ! audioconvert ! audioresample ! faac ! rtpmp4gpay ! application/x-rtp ! mux.sink_1

What is the issue with the 2nd appsrc element ( name=AppAudioSource ) ?


Thanks ,
Lior .
Reply | Threaded
Open this post in threaded view
|

Re: GStreamer - appsrc as audio source

canetti
Does anybody have a clue ?


Lior .