Import/Export Commands for GStreamer and FFmpeg

If you are using the importing feature of LiveVoice you can use for example GStreamer or FFmpeg to send audio and video to LiveVoice.

First download the tool of your choice. Then open terminal and enter your commands.

Here are some command snippets you can use as a basis for your own needs:



GStreamer: Play an MP3 file

/Library/Frameworks/GStreamer.framework/Commands/gst-launch-1.0 -v filesrc location=LiveVoiceAudioClipDemo.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! queue ! audioresample ! 'audio/x-raw,channels=2,rate=16000' ! opusenc bitrate=20000 ! queue ! rtpopuspay ! udpsink host=jvr01.streaming.livevoice.io port=25517

GStreamer: Send from microphone

/Library/Frameworks/GStreamer.framework/Commands/gst-launch-1.0 -v autoaudiosrc ! audioconvert ! queue ! audioresample ! 'audio/x-raw,channels=2,rate=16000' ! opusenc bitrate=20000 ! queue ! rtpopuspay ! udpsink host=jvr01.streaming.livevoice.io port=25517

GStreamer: Playing pre-recorded content

gst-launch-1.0 -v udpsrc address=0.0.0.0 port=<port> caps='application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)OPUS' ! .recv_rtp_sink_0 rtpbin ! rtpopusdepay ! opusdec ! autoaudiosink

Receiving with GStreamer and directly forwarding via RTP

gst-launch-1.0 -v udpsrc address=0.0.0.0 port=<port> caps='application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)OPUS' ! .recv_rtp_sink_0 rtpbin ! udpsink host=<zielhost> port=<zielport>

GStreamer: Import Video with from file

gst-launch-1.0 filesrc location=lv-tutorial2-start-streaming.webm ! matroskademux name=demux \
 demux. ! parsebin ! rtpvp8pay ! udpsink host=jvr99.streaming.livevoice.io port=<port> \
 demux. ! opusparse ! rtpopuspay ! udpsink host=jvr99.streaming.livevoice.io port=<port> async=false

FFmpeg: Playing pre-recorded content

ffplay -protocol_whitelist data,rtp,udp -vn -nodisp -fflags nobuffer -i 'data:application/sdp;charset=UTF-8,
v=0
s=-
t=0 0
c=IN IP4 0.0.0.0
m=audio 12345 RTP/AVP 96
a=rtpmap:111 OPUS/48000/2
'

Receiving with FFmpeg and directly forwarding via RTP

ffmpeg -protocol_whitelist data,rtp,udp -re -reorder_queue_size 0 -fflags nobuffer -i 'data:application/sdp;charset=UTF-8,
v=0
s=-
t=0 0
c=IN IP4 0.0.0.0
m=audio 12345 RTP/AVP 96
a=rtpmap:111 OPUS/48000/2
' -c:a libopus -f rtp 'rtp://<zielhost>:<zielport>'

GStreamer: Video + Audio from File

gst-launch-1.0 filesrc location=lv-tutorial2-start-streaming.webm ! matroskademux name=demux \
 demux. ! parsebin ! rtpvp8pay ! udpsink host=jvr99.streaming.livevoice.io port=28695 \
 demux. ! opusparse ! rtpopuspay ! udpsink host=jvr99.streaming.livevoice.io port=28442 async=false

GStreamer: Audio from cam

gst-launch-1.0 pulsesrc device=alsa_input.usb-046d_0825_3368CE00-02.mono-fallback ! queue ! audioconvert ! audioresample ! 'audio/x-raw,channels=2,rate=48000' ! opusenc bitrate=20000 ! rtpopuspay ! udpsink host=jvr99.streaming.livevoice.io port=28442

GStreamer: Audio from desktop

gst-launch-1.0 pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! queue ! audioconvert ! audioresample ! 'audio/x-raw,channels=2,rate=48000' ! opusenc bitrate=20000 ! rtpopuspay ! udpsink host=jvr99.streaming.livevoice.io port=28442

GStreamer: Video from camera

gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,width=800,height=600 ! videoconvert ! queue ! vp8enc ! queue ! rtpvp8pay ! udpsink host=jvr99.streaming.livevoice.io port=28695

gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,width=1280,height=720 ! videoconvert ! queue ! vp8enc ! queue ! rtpvp8pay ! udpsink host=jvr99.streaming.livevoice.io port=28695

gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,width=1280,height=720 ! videoconvert ! queue ! vp8enc target-bitrate=512000 threads=4 deadline=0 cq-level=5 ! queue ! rtpvp8pay ! udpsink host=jvr99.streaming.livevoice.io port=28695

GStreamer: Video from desktop

gst-launch-1.0 ximagesrc startx=0 use-damage=0 ! video/x-raw,framerate=30/1 ! videoscale method=0 ! videoconvert ! queue ! vp8enc ! queue ! rtpvp8pay ! udpsink host=jvr99.streaming.livevoice.io port=28695

gst-launch-1.0 ximagesrc startx=0 use-damage=0 ! video/x-raw,framerate=30/1 ! videoscale method=0 ! videoconvert ! queue ! vp8enc target-bitrate=512000 threads=4 deadline=0 cq-level=5 ! queue ! rtpvp8pay ! udpsink host=jvr99.streaming.livevoice.io port=28695

gst-launch-1.0 ximagesrc startx=0 use-damage=0 ! video/x-raw,framerate=30/1 ! videoscale method=0 ! video/x-raw,width=640,height=480 ! videoconvert ! queue ! vp8enc ! queue ! rtpvp8pay ! udpsink host=jvr99.streaming.livevoice.io port=28695