voaacenc produces stereo when IMHO it should produce mono

Andy Robinson andy at seventhstring.com
Sun Mar 6 10:35:21 UTC 2016


On 06/03/16 08:07, Sebastian Dröge wrote:
> On Sa, 2016-03-05 at 12:19 +0000, Andy Robinson wrote:
>> So, how can I get voaacenc to encode a mono input to a mono output?
>
> How do you know that it creates stereo streams? Looks all ok here.
> Which version of GStreamer are you using?
>
> $ gst-launch-1.0  audiotestsrc num-buffers=100 ! \
>      audio/x-raw, channels=1 ! voaacenc ! fakesink -v
>
> $ gst-launch-1.0  audiotestsrc num-buffers=100 ! \
>      audio/x-raw, channels=1 ! voaacenc ! decodebin ! fakesink -v
>
> $ gst-launch-1.0  audiotestsrc num-buffers=100 ! \
>      audio/x-raw, channels=1 ! voaacenc ! mp4mux ! \
>      filesink location=test.mp4
>
> $ gst-discoverer-1.0 test.mp4
> [...]
> Channels: 1
> [...]

Thank you for testing this, and I should have said it's GST 1.2.4 on Linux.

The first test you quote above, I get the same result as you - one 
channel, correct.

But the other two, I get two channels, so I think in fact voaacenc is 
working correctly but decodebin is decoding aac to stereo though the 
source is mono. Here is the full output from the second example, if I am 
reading it correctly then it is saying that the fakesink is receiving 2 
channels.

andy at ubuntu:~/Temp1$ gst-launch-1.0  audiotestsrc num-buffers=100 ! 
audio/x-raw, channels=1 ! voaacenc ! decodebin ! fakesink -v
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0.GstPad:src: caps = 
audio/x-raw, format=(string)S16LE, layout=(string)interleaved, 
rate=(int)44100, channels=(int)1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = 
audio/x-raw, format=(string)S16LE, layout=(string)interleaved, 
rate=(int)44100, channels=(int)1
/GstPipeline:pipeline0/GstVoAacEnc:voaacenc0.GstPad:sink: caps = 
audio/x-raw, format=(string)S16LE, layout=(string)interleaved, 
rate=(int)44100, channels=(int)1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = 
audio/x-raw, format=(string)S16LE, layout=(string)interleaved, 
rate=(int)44100, channels=(int)1
/GstPipeline:pipeline0/GstVoAacEnc:voaacenc0.GstPad:src: caps = 
audio/mpeg, mpegversion=(int)4, channels=(int)1, rate=(int)44100, 
stream-format=(string)raw, level=(string)2, base-profile=(string)lc, 
profile=(string)lc, codec_data=(buffer)1208
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:sink.GstProxyPad:proxypad0: 
caps = audio/mpeg, mpegversion=(int)4, channels=(int)1, rate=(int)44100, 
stream-format=(string)raw, level=(string)2, base-profile=(string)lc, 
profile=(string)lc, codec_data=(buffer)1208
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: 
caps = audio/mpeg, mpegversion=(int)4, channels=(int)1, rate=(int)44100, 
stream-format=(string)raw, level=(string)2, base-profile=(string)lc, 
profile=(string)lc, codec_data=(buffer)1208
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:sink: 
caps = audio/mpeg, mpegversion=(int)4, channels=(int)1, rate=(int)44100, 
stream-format=(string)raw, level=(string)2, base-profile=(string)lc, 
profile=(string)lc, codec_data=(buffer)1208
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:sink: caps = 
audio/mpeg, mpegversion=(int)4, channels=(int)1, rate=(int)44100, 
stream-format=(string)raw, level=(string)2, base-profile=(string)lc, 
profile=(string)lc, codec_data=(buffer)1208
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstAacParse:aacparse0.GstPad:src: 
caps = audio/mpeg, mpegversion=(int)4, channels=(int)1, rate=(int)44100, 
stream-format=(string)raw, level=(string)2, base-profile=(string)lc, 
profile=(string)lc, codec_data=(buffer)1208, framed=(boolean)true
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstFaad:faad0.GstPad:sink: caps 
= audio/mpeg, mpegversion=(int)4, channels=(int)1, rate=(int)44100, 
stream-format=(string)raw, level=(string)2, base-profile=(string)lc, 
profile=(string)lc, codec_data=(buffer)1208, framed=(boolean)true
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstAacParse:aacparse0.GstPad:sink: 
caps = audio/mpeg, mpegversion=(int)4, channels=(int)1, rate=(int)44100, 
stream-format=(string)raw, level=(string)2, base-profile=(string)lc, 
profile=(string)lc, codec_data=(buffer)1208
/GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0.GstPad:src: caps = 
audio/x-raw, format=(string)S16LE, layout=(string)interleaved, 
rate=(int)44100, channels=(int)1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = 
audio/x-raw, format=(string)S16LE, layout=(string)interleaved, 
rate=(int)44100, channels=(int)1
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstFaad:faad0.GstPad:src: 
caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, 
rate=(int)44100, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = 
audio/x-raw, format=(string)S16LE, layout=(string)interleaved, 
rate=(int)44100, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_0.GstProxyPad:proxypad1: 
caps = audio/x-raw, format=(string)S16LE, layout=(string)interleaved, 
rate=(int)44100, channels=(int)2, channel-mask=(bitmask)0x0000000000000003
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0.GstPad:src: caps = 
audio/x-raw, format=(string)S16LE, layout=(string)interleaved, 
rate=(int)44100, channels=(int)1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = 
audio/x-raw, format=(string)S16LE, layout=(string)interleaved, 
rate=(int)44100, channels=(int)1
Got EOS from element "pipeline0".
Execution ended after 0:00:00.041991033
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

I then tried it on Windows, GST 1.6.3, and it works fine - one channel, 
correct.

So it looks like an issue somewhere inside decodebin which has since 
been fixed, would you agree?

If that's right, I'd be interested if anyone knows when it was fixed, 
and also if there is any workaround.

I would like my app to work correctly on 1.2.4 if possible as there is 
quite a lot of 1.2.4 out there, but this issue is not a showstopper for me.

Regards,
Andy Robinson, Seventh String Software, www.seventhstring.com


More information about the gstreamer-devel mailing list