Audio streaming via UDP

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

Audio streaming via UDP

pablorl
Hi guys,

I'm trying to implement the following functionality:

I have an .MP4 file which contains video in h264 and audio in eac3. I'd like to demultiplex the audio and stream it via UDP to localhost in a loopback.

Using gst-launch I'm able to get it using: gst-launch-1.0 filesrc location=video.mp4 ! qtdemux ! udpsink host=localhost port=1234

However I'm not able to achieve the same result through code although I build the same pipeline. What I get is:

"Error: Gstreamer encountered a general stream error."

This issue has been puzzling me for a couple of days and I'd appreciate if any of you could provide some insight. My code is attached to this email in case you want to revise.

Cheers

main.txt
Reply | Threaded
Open this post in threaded view
|

Re: Audio streaming via UDP

David Röthlisberger
On 8 Jul 2013, at 15:42, pablorl wrote:
> Using gst-launch I'm able to get it using: gst-launch-1.0 filesrc
> location=video.mp4 ! qtdemux ! udpsink host=localhost port=1234
>
> However I'm not able to achieve the same result through code although I
> build the same pipeline.

Does it work if you use "gst_parse_launch"?


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

Re: Audio streaming via UDP

Baby Octopus
Well, its tough to say anything without looking at your code. My feeling is that you might have connected videopads using gst_pad_link API. Though it should have given negotiation error, you never know what can happen when you force pad linking

~BO
Reply | Threaded
Open this post in threaded view
|

Re: Audio streaming via UDP

Tim-Philipp Müller-2
In reply to this post by pablorl
On Mon, 2013-07-08 at 07:42 -0700, pablorl wrote:

Hi,

> I'm trying to implement the following functionality:
>
> I have an .MP4 file which contains video in h264 and audio in eac3. I'd like
> to demultiplex the audio and stream it via UDP to localhost in a loopback.
>
> Using gst-launch I'm able to get it using: gst-launch-1.0 filesrc
> location=video.mp4 ! qtdemux ! udpsink host=localhost port=1234
>
> However I'm not able to achieve the same result through code although I
> build the same pipeline. What I get is:
>
> "Error: Gstreamer encountered a general stream error."
>
> This issue has been puzzling me for a couple of days and I'd appreciate if
> any of you could provide some insight. My code is attached to this email in
> case you want to revise.

When you receive an error message on the bus, you should also print the
'debug' string, it contains useful information for (surprise) debugging
purposes :) I bet in your case it says something like 'not-linked'.

I bet this call fails:

  /* link the elements together */
  gst_element_link_many (source, demuxer, sink, NULL);

The reason is that the demuxer does not have any source pads yet at this
time, it will only add pads once data flow starts. Please read the
section about 'dynamic pads' or 'sometimes pads' in the application
developer's manual:

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-pads.html

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: Audio streaming via UDP

pablorl
In reply to this post by David Röthlisberger
Hi David, thanks for your answer.

I'm trying with gst_parse_launch as well with the same result. However my investigations have found out that I may be unable to open a raw socket because of some limitation/rule in my firewall/network.

I'm able to stream UDP from Linux to W7, but the opposite doesn't work. Seems that this issue may fall in the side of the OS.

I'll keep the thread updated with further findings.

Cheers,


On Mon, Jul 8, 2013 at 5:45 PM, David Röthlisberger <[hidden email]> wrote:
On 8 Jul 2013, at 15:42, pablorl wrote:
> Using gst-launch I'm able to get it using: gst-launch-1.0 filesrc
> location=video.mp4 ! qtdemux ! udpsink host=localhost port=1234
>
> However I'm not able to achieve the same result through code although I
> build the same pipeline.

Does it work if you use "gst_parse_launch"?




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

Re: Audio streaming via UDP

Marc Leeman
> I'll keep the thread updated with further findings.


Note that if you stream audio, you should consider using RTP (with
RTCP). Otherwise you'lll have poor quality on the audio (less
forgiving than video).
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Audio streaming via UDP

Tim-Philipp Müller-2
In reply to this post by pablorl
On Tue, 2013-07-09 at 11:57 +0200, Pablo RL wrote:

Hi,

> I'm able to stream UDP from Linux to W7, but the opposite doesn't
> work. Seems that this issue may fall in the side of the OS.

Maybe you're running into this bug:

https://bugzilla.gnome.org/show_bug.cgi?id=700878

which will be fixed in the upcoming 1.0.8 release.

Cheers
 -Tim

>
> I'll keep the thread updated with further findings.
>
>
> On Mon, Jul 8, 2013 at 5:45 PM, David Röthlisberger
> <[hidden email]> wrote:
>         On 8 Jul 2013, at 15:42, pablorl wrote:
>         > Using gst-launch I'm able to get it using: gst-launch-1.0
>         filesrc
>         > location=video.mp4 ! qtdemux ! udpsink host=localhost
>         port=1234
>         >
>         > However I'm not able to achieve the same result through code
>         although I
>         > build the same pipeline.
>        
>         Does it work if you use "gst_parse_launch"?
>        
>        
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


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

Re: Audio streaming via UDP

Wes Miller
In reply to this post by Marc Leeman
For what it's worth, I do a lot of audio streaming and have learned that specifying the stream caps between elements where the caps change, say between an encoder and a payloader and the payloader and the sink, makes a big difference.  I don't really know why but taking away any opportunity for a wrong guess about a property seems to really beneficial.

Also, make the "sync" capability of your sink be false.  I have yet to see an application where true was needed, thought it does seem to not fail much of the time.

In your case, the operation to link the audio pads can be a link-with-filter-cats operation.

Wes