title: How to stream Opus stream from Discord to RTP
body: <p>I'm using a Node.JS Discord bot to stream a voice call over RTP. Currently, in my <code>speaking</code> event handler, I have</p>
  
  <pre><code>var cmd = child_process.spawn("ffmpeg", [
            '-protocol_whitelist', 'file,crypto,sdp,rtp,udp,pipe,opus',
            '-re',
            '-acodec', 'opus',
            '-i', '-',
            '-ar', '8000',
            '-acodec', 'pcm_mulaw',
            '-f', 'mulaw',
            '-f', 'rtp',
            `rtp://${rtp_ip}:${rtp_port}`]);
  reciever.createOpusStream(user).pipe(cmd.stdin);
  </code></pre>
  
  <p>equivalent to running the ffmpeg command <code>ffmpeg -protocol_whitelist file,crypto,sdp,rtp,udp,pipe,opus -re acodec opus -i - -ar 8000 -acodec pcm_mulaw -f mulaw -f rtp rtp://${rtp_ip}:${rtp_port}</code></p>
  
  <p>Variations of this command produce errors ranging from <code>pipe:: Invalid input</code> or <code>pipe:: Invalid argument</code> to <code>Invalid data on input.</code> to <code>[mp3 @ 0x5615decebe60] Format mp3 detected only with low score of 1, misdetection possible!
  [mp3 @ 0x5615decebe60] Failed to read frame size: Could not seek to 16101.</code> Could anyone help me with sending a ReadableStream (opus) to an RTP mulaw stream? Thanks!</p>