Skip to content

Instantly share code, notes, and snippets.

@0xBADC0FFEE
Forked from tmehlinger/run.sh
Last active October 9, 2018 12:14
Show Gist options
  • Select an option

  • Save 0xBADC0FFEE/fe9e035d753c7f492523c9e598f56a1d to your computer and use it in GitHub Desktop.

Select an option

Save 0xBADC0FFEE/fe9e035d753c7f492523c9e598f56a1d to your computer and use it in GitHub Desktop.

Revisions

  1. 0xBADC0FFEE revised this gist Oct 9, 2018. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions run.sh
    Original file line number Diff line number Diff line change
    @@ -11,8 +11,8 @@ apt-get install -y \
    # start gstreamer... assumes you have mediasoup configured to use Opus/H264
    gst-launch-1.0 -em \
    rtpbin name=rtpbin latency=5 \
    udpsrc port=10000 caps="application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)OPUS" ! rtpbin.recv_rtp_sink_0 \
    udpsrc uri=udp://0.0.0.0:10000 caps="application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)OPUS" ! rtpbin.recv_rtp_sink_0 \
    rtpbin. ! queue ! rtpopusdepay ! opusdec ! audioconvert ! audioresample ! voaacenc ! mux. \
    udpsrc port=10002 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" ! rtpbin.recv_rtp_sink_1 \
    udpsrc uri=udp://0.0.0.0:10002 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" ! rtpbin.recv_rtp_sink_1 \
    rtpbin. ! queue ! rtph264depay ! h264parse ! mux. \
    flvmux name=mux streamable=true ! rtmpsink sync=false location=rtmp://127.0.0.1:1935/stream
    mp4mux name=mux faststart=true streamable=true ! filesink sync=false location=/videos/asdf.mp4
  2. @tmehlinger tmehlinger revised this gist Feb 23, 2018. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions server.js
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,9 @@ room.on('newpeer', (peer) => {
    let rtpParams = {
    remoteIP: '127.0.0.1',
    remotePort: (producer.kind === 'audio') ? 10000 : 10002
    }
    room.createRtpStreamer(producer, rtpParams).then((streamer) => {
    console.log('started mirroring RTP for', producer.kind);
    });
    });
    room.createRtpStreamer(producer, rtpParams).then((streamer) => {
    console.log('started mirroring RTP for', producer.kind);
    });
    };
    });
  3. @tmehlinger tmehlinger revised this gist Feb 23, 2018. 2 changed files with 1 addition and 2 deletions.
    2 changes: 1 addition & 1 deletion run.sh
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ apt-get install -y \
    gstreamer1.0-plugins-good \
    gstreamer1.0-tools

    # start gstreamer
    # start gstreamer... assumes you have mediasoup configured to use Opus/H264
    gst-launch-1.0 -em \
    rtpbin name=rtpbin latency=5 \
    udpsrc port=10000 caps="application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)OPUS" ! rtpbin.recv_rtp_sink_0 \
    1 change: 0 additions & 1 deletion server.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    // snippet from the mediasoup server that actually sets up the `RtpStreamer`

    room.on('newpeer', (peer) => {
    peer.on('newproducer', (producer) => {
    let rtpParams = {
  4. @tmehlinger tmehlinger revised this gist Feb 23, 2018. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions run.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,13 @@
    #!/bin/bash

    # tested on Ubuntu 16.04
    apt-get install -y \
    gstreamer1.0-libav \
    gstreamer1.0-plugins-bad \
    gstreamer1.0-plugins-base \
    gstreamer1.0-plugins-good \
    gstreamer1.0-tools

    # start gstreamer
    gst-launch-1.0 -em \
    rtpbin name=rtpbin latency=5 \
  5. @tmehlinger tmehlinger created this gist Feb 23, 2018.
    10 changes: 10 additions & 0 deletions run.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/bin/bash

    # start gstreamer
    gst-launch-1.0 -em \
    rtpbin name=rtpbin latency=5 \
    udpsrc port=10000 caps="application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)OPUS" ! rtpbin.recv_rtp_sink_0 \
    rtpbin. ! queue ! rtpopusdepay ! opusdec ! audioconvert ! audioresample ! voaacenc ! mux. \
    udpsrc port=10002 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" ! rtpbin.recv_rtp_sink_1 \
    rtpbin. ! queue ! rtph264depay ! h264parse ! mux. \
    flvmux name=mux streamable=true ! rtmpsink sync=false location=rtmp://127.0.0.1:1935/stream
    12 changes: 12 additions & 0 deletions server.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    // snippet from the mediasoup server that actually sets up the `RtpStreamer`

    room.on('newpeer', (peer) => {
    peer.on('newproducer', (producer) => {
    let rtpParams = {
    remoteIP: '127.0.0.1',
    remotePort: (producer.kind === 'audio') ? 10000 : 10002
    });
    room.createRtpStreamer(producer, rtpParams).then((streamer) => {
    console.log('started mirroring RTP for', producer.kind);
    });
    };