[gst-devel] audioconvert from channels=6 to channels=2

Tim-Philipp Müller t.i.m at zen.co.uk
Thu Dec 3 10:57:40 CET 2009


On Thu, 2009-12-03 at 10:05 +0100, Vincent Génieux wrote:

> I would like to select the 2 first channels of an audio signal.
> I tried the following pipeline but it does not work :
> 
> gst-launch mysrc ! 'audio/x-raw-int,endianness=1234,
> signed=true,width=32,depth=24,rate=48000,channels=6' ! audioconvert !
> 'audio/x-raw-int,endiannes=1234,
> signed=true,width=16,depth=16,rate=48000,channels=2' ! filesink
> location=out.raw
> 
> When I run this pipeline, I get the a warning message :
> "Failed to retrieve channel layout from caps."
> 
> I suppose I should add the "channel-positions" property but I do not
> know how to specify it on command line.

That's not possible with gst-launch, because when it parses those filter
caps strings the channel position enum types won't be registered with
the type system yet. It is possible in code though if you
g_type_class_ref() the type yourself before you call gst_parse_launch(),
or instantiate some element that does this for you, like audioconvert.

Btw, in the second filter caps that should be 'endianness' (two s).

But even if you made it work, this would downmix the 6 channels into
stereo, not select the first two channels.

You could try a combination of the interleave/deinterleave elements.

Cheers
 -Tim






More information about the gstreamer-devel mailing list