Update volume of individual tee

Chris Wine chriswine at gmail.com
Fri Jan 15 18:48:41 UTC 2021


I think you just have too many extra restrictions in your pipeline that are
preventing things from running. You probably shouldn't be using capssetter,
because that will just coerce the caps to be what you want, but if the
underlying data isn't in that format, you'll end up with a corrupted
output. A couple other little observations:

- The wavenc element only uses little endian audio (S16LE).
- You don't necessarily need to run audioresample if you're audio is
already in the correct rate (I added rate=48000 to audiotestsrc below)
- The volume element is a multiplier on the current volume level... 0.5
will cut the volume in half, while 2.0 is double the volume.
- You shouldn't use decodebin, because your audio caps are already
audio/x-raw, and there is nothing to decode... it's all uncompressed audio
data.
- Your original command line had a lot of extra audioconvert elements, but
it's ok to have those because they'll just be a pass-through if there was
nothing to convert.

Here, I made some tweaks to your command line:

gst-launch-1.0 interleave name=i \
  audiotestsrc num-buffers=100 wave=0 freq=100 volume=0.4 ! \
    audio/x-raw,format=S16LE,channels=1,rate=48000 ! tee name=t1 \
  audiotestsrc num-buffers=100 wave=2 freq=100 volume=0.4 ! \
    audio/x-raw,format=S16LE,channels=1,rate=48000 ! tee name=t2 \
  t1. ! queue ! volume volume=1 ! i. \
  t2. ! queue ! volume volume=0.5 ! i. \
  t1. ! queue ! volume volume=0.8 ! i. \
  t2. ! queue ! volume volume=0.7 ! i. \
  i. ! audio/x-raw,format=S16LE,channels=4 \
    ! audioconvert ! wavenc ! filesink location=test.wav

--Chris

On Thu, Jan 14, 2021 at 11:48 PM Nick_law <nicholas at umantec.net> wrote:

> Is it possible to update the volume of a tee src?
>
> for example
>
> gst-launch-1.0 interleave name=i
> audiotestsrc wave=0 freq=100 volume=0.4 ! decodebin ! audioconvert !
> "audio/x-raw,format=S16BE,channels=1" ! tee name=t1
> audiotestsrc wave=2 freq=100 volume=0.4 ! decodebin ! audioconvert !
> "audio/x-raw,format=S16BE,channels=1" ! tee name=t2
> t1. ! queue ! i.   //make volume 1 here
> t2. ! queue ! i.   //make volume 0.5 here
> t1. ! queue ! i.   //make volume 0.8 here
> t2. ! queue ! i.   //make volume 0.7 here
> i.src !
> capssetter
> caps="audio/x-raw,format=S16BE,channels=4,channel-mask=(bitmask)0xf"
> ! audioconvert ! audioresample ! wavenc ! filesink location=test.wav
>
> I tried
>
> gst-launch-1.0 interleave name=i
> audiotestsrc wave=0 freq=100 volume=0.4 ! decodebin ! audioconvert !
> "audio/x-raw,format=S16BE,channels=1" ! tee name=t1
> audiotestsrc wave=2 freq=100 volume=0.4 ! decodebin ! audioconvert !
> "audio/x-raw,format=S16BE,channels=1" ! tee name=t2
> t1. ! queue ! audioconvert ! volume volume=1 ! i.   //make volume 1 here
> t2. ! queue ! audioconvert ! volume volume=0.5 ! i.   //make volume 0.5
> here
> t1. ! queue ! audioconvert ! volume volume=0.8 ! i.   //make volume 0.8
> here
> t2. ! queue ! audioconvert ! volume volume=0.7 ! i.   //make volume 0.7
> here
> i.src !
> capssetter
> caps="audio/x-raw,format=S16BE,channels=4,channel-mask=(bitmask)0xf"
> ! audioconvert ! audioresample ! wavenc ! filesink location=test.wav
>
> which runs but corrupts the audio, I think the audio convert is resetting
> the caps?
>
> Future use would be to give the new volume a name so that it can be updated
> dynamically with
> gst_parse_launch() and gst_bin_get_by_name()
>
> thanks in advance for the help.
>
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210115/7101baef/attachment.htm>


More information about the gstreamer-devel mailing list