Multiple ogg vorbis audio files to single tcpserversink

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

Multiple ogg vorbis audio files to single tcpserversink

bomba
Hello,

I'm sampling 1 second ogg vorbis audio files, sending the samples over TCP and finally collecting them into one folder on the server. I want to play all the samples without merging them into a single file.

For the purpose, I've been trying to use multifilesrc:

multifilesrc location=%05d.ogg ! oggdemux ! vorbisdec ! queue ! autoaudiosink

But the pipeline goes EOS after the first sample.

What I'm planning to try now is to implement a dynamic pipeline witch switches filesrc cycling through the files present inside the source folder.


Does anybody has hints on how to properly set up multifilesrc for the case?
Any different angles on the workflow?
Reply | Threaded
Open this post in threaded view
|

Re: Multiple ogg vorbis audio files to single tcpserversink

bomba
I've been trying to test splitfilesrc element - which would do the job quite well - with the following pipeline:

splitfilesrc location=/path/to/*.ogg ! decodebin ! autoaudiosink

The pipeline plays the first sample, then exits. Logs:

Setting pipeline to PAUSED ...
0:00:00.025201433 32529      0x1b3f590 WARN                 basesrc gstbasesrc.c:3486:gst_base_src_start_complete:<splitfilesrc0> pad not activated yet
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = audio/ogg
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = "NULL"
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = audio/ogg
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstOggDemux:oggdemux0.GstPad:sink: caps = audio/ogg
0:00:00.040240751 32529 0x7f074004de80 WARN                oggdemux gstoggdemux.c:3318:gst_ogg_demux_do_seek:<'':src_02b386b6> Locking on ts 0:00:00.444081632

[..]

0:00:00.819383933 32529 0x7f074004de80 WARN                oggdemux gstoggdemux.c:4860:gst_ogg_demux_loop:<oggdemux0> error: Internal data stream error.
0:00:00.819402866 32529 0x7f074004de80 WARN                oggdemux gstoggdemux.c:4860:gst_ogg_demux_loop:<oggdemux0> error: stream stopped, reason not-linked
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstOggDemux:oggdemux0: Internal data stream error.
Additional debug info:
gstoggdemux.c(4860): gst_ogg_demux_loop (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstOggDemux:oggdemux0:
stream stopped, reason not-linked

Reply | Threaded
Open this post in threaded view
|

Re: Multiple ogg vorbis audio files to single tcpserversink

Tim Müller
On Mon, 2016-06-13 at 05:52 -0700, bomba wrote:

Hi,

> I've been trying to test splitfilesrc element - which would do the
> job quite well - with the following pipeline:
>
> splitfilesrc location=/path/to/*.ogg ! decodebin ! autoaudiosink
>
> The pipeline plays the first sample, then exits. Logs:
>
> /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstOggDemux:oggdemux0:
> stream stopped, reason not-linked

That's because oggdemux creates new pads when it finds a new stream
(each ogg file will have headers, so if you concatenate them it will
find a new stream for every chunk).

Shouldn't be a problem if you write some code or use playbin, something
like

  gst-play-1.0 splitfile:///path/to/files*.ogg

might work.

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: Multiple ogg vorbis audio files to single tcpserversink

bomba
So, splitfilesrc works like rtspsrc as I thought, dinamically adding new pads.
Maybe the first file plays because the pipeline detects and links it, like rtspsrc does, but it terminates when the first sample its over and does not relink on the new sample's pad, which would require some a callback.

Am I correct?
Reply | Threaded
Open this post in threaded view
|

Re: Multiple ogg vorbis audio files to single tcpserversink

Tim Müller
On Mon, 2016-06-13 at 06:19 -0700, bomba wrote:

> So, splitfilesrc works like rtspsrc as I thought, dinamically adding
> new pads.

No, splitfilesrc does not add new pads. oggdemux does.

You can also try the multifilesrc pipeline with a queue before
oggdemux, to see if that helps. But there again oggdemux will add new
pads then.

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: Multiple ogg vorbis audio files to single tcpserversink

bomba
splitfilesrc -> oggdemux -> vorbisdec -> audiorate -> audioresample -> audioconvert -> sink

I'm listening on pad-added signals from oggdemux and dynamically link them against vorbisdec:


static void
on_oggdemux_pad_added (GstElement * element, GstPad * pad, STREAM_INFO * data)
{
        gchar *dynamic_pad_name;
        dynamic_pad_name = gst_pad_get_name (pad);
        g_print ("\n\nDEBUG:: on_oggdemux_pad_added : %s\n\n", dynamic_pad_name);
        gst_element_link_pads (data->oggdemux, dynamic_pad_name, data->vorbisdec, "sink");
        g_free (dynamic_pad_name);
}

[..]

g_signal_connect (si.oggdemux, "pad-added", G_CALLBACK (on_oggdemux_pad_added), &si);

[..]

gst_bin_add_many (GST_BIN (si.pipeline), si.splitfilesrc, si.oggdemux, si.vorbisdec,
si.audiorate, si.audioresample, si.audioconvert, si.sink, NULL);

gst_element_link_many (si.splitfilesrc, si.oggdemux, NULL);
gst_element_link_many (si.vorbisdec, si.audiorate, si.audioresample, si.audioconvert, si.sink, NULL);

[..]


I can play the first file, then I receive EOS and the program terminates:

~ GST_DEBUG=3 ./fragment-stream test/*.ogg

0:00:00.028728478  2617      0x17e8e70 WARN                 basesrc gstbasesrc.c:3486:gst_base_src_start_complete:<Splitfiles> pad not activated yet

Running...

0:00:00.029459270  2617      0x17ab8a0 WARN                oggdemux gstoggdemux.c:3318:gst_ogg_demux_do_seek:<'':src_6921e04d> Locking on ts 0:00:00.448435374

DEBUG:: on_oggdemux_pad_added : src_6921e04d

0:00:00.884464145  2617 0x7f4ac0007010 WARN                   pulse pulsesink.c:702:gst_pulsering_stream_underflow_cb:<sink-actual-sink-pulse> Got underflow

End of stream
Returned, stopping playback
Deleting pipeline


Do I have to handle EOS for every single sample?