select channel to record from input device

Nicolas Dufresne nicolas at ndufresne.ca
Sun Jun 30 15:59:51 UTC 2019


Le dim. 30 juin 2019 08 h 10, kyle111 <purehavoc77 at gmail.com> a écrit :

> Thanks Nicolas, I also managed to find 'deinterleave' element and it seems
> to
> be working now.
> You suggestion further reassure me.
> I am now able to record 2 channels separately:
>
> gst-launch-1.0 alsasrc device=default ! decodebin ! audioconvert !
> "audio/x-raw,channels=2" ! deinterleave name=d d.src_0 ! queue !
> audioconvert ! vorbisenc ! oggmux ! filesink location=channel1.ogg d.src_1
> !
> queue ! audioconvert ! vorbisenc ! oggmux ! filesink location=channel2.ogg
>
> I am trying to implement this in Python GST. I am not sure how to implement
> this line:
> deinterleave name=d d.src_0
>
> I know element = 'deinterleave', property,value='name','d'
> but what is d.src_0 in Gstreamer terminology? is it another src pad ?
>
> # current code
> deinterleave = Gst.ElementFactory.make("deinterleave", "deinterleave")
> deinterleave.set_property("name", 'd')
> ## how to declare d.src_0 and d.src_1
>
> I am aware this is not gstreamer python forum. Stuck on this code so I'm
> just trying my luck.
> Thanks :)
>

Doing this manually requires connecting to the deinterleave pad-added
signal. That's how "sometimes pad" are handled. I'm replying from my phone,
so it is hard for me to provide an example, my apology. An alternative,
which is what I usually do, is to use Gst.parse_lauch() which is basically
the same thing gst-lau ch uses. It's such a time saver for simple cases
that works in gst-launch. Of you give elements a name, you can always
access these elements using pipeline.get_by_name().


>
>
>
>
>
>
>
> --
> 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 --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190630/17b1d0a4/attachment.html>


More information about the gstreamer-devel mailing list