resampling and reformatting audio when rate/format will not need to change

Charlie Laub charleslaub at sbcglobal.net
Fri Mar 16 17:13:39 UTC 2018


Tim, thanks for the fast reply. 

One more question regarding audioresample: is there an anti-aliasing filter already built in when downsampling, or does the user need to do that explicitly upstream of the resampling element? I would always using the Kaiser (default) method.


-----Original Message-----
From: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> On Behalf Of Tim Müller
Sent: Friday, March 16, 2018 9:45 AM
To: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
Subject: Re: resampling and reformatting audio when rate/format will not need to change

On Fri, 2018-03-16 at 09:10 -0700, Charlie Laub wrote:

Hi Charlie,
 
> In some cases I might not know the input audio caps, and they might 
> already be the same as the desired output caps. In that case, does the 
> resampling code actually run as if it was changing the sample rate, or 
> is the element automatically bypassed when it discovers that no change 
> is needed? I looked at the code in gstaudioresample.c but I did not 
> see anything about it.

Yes, both elements should work in passthrough mode if downstream can accept the input caps and no work is needed.

> Also, if I need to reformat AND resample, can I construct the pipeline 
> like this:
> … ! audioconvert ! audioresample ! audio/x- 
> raw,format=NEW_FORMAT,rate=NEW_RATE ! …

Yes, that should work.
 
> Or do I need to explicitly provide caps for both elements 
> (audioconvert and audioresample), like this:
> … ! audioconvert ! audio/x-raw,format=NEW_FORMAT  ! audioresample !
> audio/x-raw,rate=NEW_RATE ! …

This should also work, but not be needed.

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com _______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list