voaacenc produces stereo when IMHO it should produce mono

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

voaacenc produces stereo when IMHO it should produce mono

Andy Robinson
Hello,

This pipeline produces a mono mp4 as I would expect:

gst-launch audiotestsrc num-buffers=100 ! audio/x-raw, channels=1 !
lamemp3enc ! mp4mux ! filesink location=test.mp4

However both of the next two produce stereo, which seems wrong to me:

gst-launch audiotestsrc num-buffers=100 ! audio/x-raw, channels=1 !
voaacenc ! mp4mux ! filesink location=test.mp4

gst-launch audiotestsrc num-buffers=100 ! audio/x-raw, channels=1 !
voaacenc ! audio/mpeg, channels=1 ! mp4mux ! filesink location=test.mp4

So, how can I get voaacenc to encode a mono input to a mono output? (or
should I be using a different encoder to produce aac?)

Thanks,
Andy Robinson, Seventh String Software, www.seventhstring.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: voaacenc produces stereo when IMHO it should produce mono

Sebastian Dröge-3
On Sa, 2016-03-05 at 12:19 +0000, Andy Robinson wrote:

> Hello,
>
> This pipeline produces a mono mp4 as I would expect:
>
> gst-launch audiotestsrc num-buffers=100 ! audio/x-raw, channels=1 ! 
> lamemp3enc ! mp4mux ! filesink location=test.mp4
>
> However both of the next two produce stereo, which seems wrong to me:
>
> gst-launch audiotestsrc num-buffers=100 ! audio/x-raw, channels=1 ! 
> voaacenc ! mp4mux ! filesink location=test.mp4
>
> gst-launch audiotestsrc num-buffers=100 ! audio/x-raw, channels=1 ! 
> voaacenc ! audio/mpeg, channels=1 ! mp4mux ! filesink
> location=test.mp4
>
> So, how can I get voaacenc to encode a mono input to a mono output?
> (or should I be using a different encoder to produce aac?)
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
[...]

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: voaacenc produces stereo when IMHO it should produce mono

Andy Robinson
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@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
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: voaacenc produces stereo when IMHO it should produce mono

Sebastian Dröge-3
On So, 2016-03-06 at 10:35 +0000, Andy Robinson wrote:
>
> 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?

It's not a problem in decodebin, but probably in whatever AAC decoder
you're using there.

> 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.

You would have to check the changes between 1.2.4 and 1.6.3 to find the
relevant commit that made things work correctly. git bisect might help
here. Once you found it, maybe someone here can tell you how to work
around the problem :) But most likely this won't be possible without
patching the plugin that is causing the problem.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment