Search code examples
linuxvoipgstreamerrtpvoice

how to modify the following command line?


I have the following gstreamer Command-line :

gst-launch alsasrc ! mulawenc ! rtppcmupay ! udpsink host= 127.0.0.1 port=5555

It records Mono Voice and i can hear it ,if i listen on 5555 port ( echo IP was used). But i need to transmit Stereo . I have also tried my Microphone for stereo-recording Capability using the following command:

arecord -vv -fdat voiceFile.wav 

and it works. Does anyone know how to specify stereo in the gstreamer command?


Solution

  • The problem is that rtppcmupay does not support stereo:

    $ gst-inspect rtppcmupay
    ...
        Capabilities:
          audio/x-mulaw
                   channels: 1
                       rate: 8000
    ....
    

    You can try some other codec (e.g. vorbis):

    $ gst-launch alsasrc \
      ! 'audio/x-raw-int,channels=2' \
      ! audioconvert \
      ! vorbisenc \
      ! rtpvorbispay \
      ! udpsink host=127.0.0.1 port=5555