Multichannel audio working pipeline
Nicolas Dufresne
nicolas at ndufresne.ca
Mon Oct 7 17:13:00 UTC 2019
Le lundi 07 octobre 2019 à 11:25 -0500, diegoavila a écrit :
> Hello its me again I solved my previous issue but no im totally stuck doing
> this:
> I have a working pipeline that splits a song into 6 channels but now i dont
> have any clue about how convert it to c++ code
> This is the pipeline "gst-launch-1.0 -v filesrc
> location=/home/arion/Downloads/test2.mp3 name=src ! decodebin ! audioconvert
> ! "audio/x-raw,channels=6" ! deinterleave keep-positions=true name=d
> interleave name=i ! autoaudiosink d.src_0 ! queue ! volume volume=0 !
> i.sink_1 d.src_1 ! queue ! volume volume=1 ! i.sink_2 d.src_2 ! volume
> volume = 0 ! queue ! i.sink_3 d.src_3 ! volume volume=0 ! queue ! i.sink_4
> d.src_4 ! volume volume=0 ! queue ! i.sink_5 d.src_5 ! volume volume=0 !
> queue ! i.sink_6"
The short version:
GError *error = NULL;
GstElement *pipeline = gst_parse_launch ("filesrc location=/home/arion/Downloads/test2.mp3 name=src "
"! decodebin ! audioconvert ! "audio/x-raw,channels=6" ! deinterleave keep-positions=true name=d "
"interleave name=i ! autoaudiosink "
"d.src_0 ! queue ! volume volume=0 ! i.sink_1 "
"d.src_1 ! queue ! volume volume=1 ! i.sink_2 "
"d.src_2 ! volume volume = 0 ! queue ! i.sink_3 "
"d.src_3 ! volume volume=0 ! queue ! i.sink_4 "
"d.src_4 ! volume volume=0 ! queue ! i.sink_5 "
"d.src_5 ! volume volume=0 ! queue ! i.sink_6",
&error);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
/* your main loop */
If you give any element a name, you can then access it using
gst_bin_get_by_name(GST_BIN (pipeline), name); Then you next step will
be to slowly make it more dynamic for your needs. Then you can combine
gst_parse_bin_from_description() and the previous function, and then
gst_bin_add() to add the dynamically created bins into the pipeline.
That all depends on the level of flexibility you want at the end of
your day.
Nicolas
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20191007/c861ea7b/attachment.sig>
More information about the gstreamer-devel
mailing list