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

Charlie Laub charleslaub at sbcglobal.net
Fri Mar 16 16:10:50 UTC 2018


I am processing audio streams and need to implement reformatting (e.g.
changing of the bit depth) and resampling. I am doing this via gst-launch.
Have a couple of questions about the behavior of these elements and how they
should be used together in the pipeline.

 

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. 

 

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

 

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

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180316/45eb40bb/attachment.html>


More information about the gstreamer-devel mailing list