Unable to play and record Internet stream at the same time

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

Unable to play and record Internet stream at the same time

ben_whiteus
I was able to play and record Internet stream using gstreamer when I was
using Ubuntu 16.04. However, after upgrading to 18.04, I can no longer do
that. The command I used and the corresponding error message are as follows:

$ gst-launch-1.0 souphttpsrc location=<livestream url> ! decodebin !
audioconvert ! tee name=t ! playsink t. ! lamemp3enc ! id3v2mux ! filesink
location=test.mp3
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'souphttpsrc0': gst.soup.session=context,
session=(SoupSession)NULL, force=(boolean)false;
Redistribute latency...
Redistribute latency...
^Chandling interrupt.
Interrupt: Stopping pipeline ...
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

I did try playing alone:

$ gst-launch-1.0 souphttpsrc location=<livestream url> ! decodebin !
audioconvert !  playsink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'souphttpsrc0': gst.soup.session=context,
session=(SoupSession)NULL, force=(boolean)false;
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstPulseSinkClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:17.987984164
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

and recording alone:

$ gst-launch-1.0 souphttpsrc location=<livestream url> ! decodebin !
audioconvert ! lamemp3enc ! id3v2mux ! filesink location=test.mp3
Pipeline is PREROLLING ...
Got context from element 'souphttpsrc0': gst.soup.session=context,
session=(SoupSession)NULL, force=(boolean)false;
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:16.354333158
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

and both works fine.

Any idea how I can resolve the issue?

Thanks



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

Re: Unable to play and record Internet stream at the same time

Michael MacIntosh

You could try adding a queue to each of your branches, since the lamemp3enc might have a very small buffer, (or playbin), you will need to have a small amount so it can play and record at the same time.  By default gstreamer will try to synchronize all sinks such that they "play" the same sample at the same time.

So you could try something like this (bolded the added queues for clarity):

$ gst-launch-1.0 souphttpsrc location=<livestream url> ! decodebin !
audioconvert ! tee name=t ! queue ! playsink t. ! queue ! lamemp3enc ! id3v2mux ! filesink
location=test.mp3
Hope that helps!


On 9/26/2018 8:15 AM, ben_whiteus wrote:
I was able to play and record Internet stream using gstreamer when I was
using Ubuntu 16.04. However, after upgrading to 18.04, I can no longer do
that. The command I used and the corresponding error message are as follows:

$ gst-launch-1.0 souphttpsrc location=<livestream url> ! decodebin !
audioconvert ! tee name=t ! playsink t. ! lamemp3enc ! id3v2mux ! filesink
location=test.mp3
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'souphttpsrc0': gst.soup.session=context,
session=(SoupSession)NULL, force=(boolean)false;
Redistribute latency...
Redistribute latency...
^Chandling interrupt.
Interrupt: Stopping pipeline ...
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

I did try playing alone: 

$ gst-launch-1.0 souphttpsrc location=<livestream url> ! decodebin !
audioconvert !  playsink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'souphttpsrc0': gst.soup.session=context,
session=(SoupSession)NULL, force=(boolean)false;
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstPulseSinkClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:17.987984164
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

and recording alone: 

$ gst-launch-1.0 souphttpsrc location=<livestream url> ! decodebin !
audioconvert ! lamemp3enc ! id3v2mux ! filesink location=test.mp3
Pipeline is PREROLLING ...
Got context from element 'souphttpsrc0': gst.soup.session=context,
session=(SoupSession)NULL, force=(boolean)false;
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:16.354333158
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

and both works fine.

Any idea how I can resolve the issue? 

Thanks



--
Sent from: http://gstreamer-devel.966125.n4.nabble.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: Unable to play and record Internet stream at the same time

ben_whiteus
I tired the suggestion, but it still didn't work.  Same error :-(

$ gst-launch-1.0 souphttpsrc location=<livestream url>  ! decodebin !
audioconvert ! tee name=t ! queue ! playsink t. ! queue ! lamemp3enc !
id3v2mux ! filesink location=test.mp3
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'souphttpsrc0': gst.soup.session=context,
session=(SoupSession)NULL, force=(boolean)false;
Redistribute latency...
Redistribute latency...
^Chandling interrupt.
Interrupt: Stopping pipeline ...
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel