title: Streaming raw sound with FFMPEG
body: <p>I'm using the ffmpeg library to decode / encode audio in JAVA, using the Process objets. The aim is to got the raw datas decoded by ffmpeg in my JAVA code and then, to send them back to ffmpeg to generate a stream or create a file.</p>
  
  <p>As JAVA sounds only allow wav audio datas, I made a first try with this command line :</p>
  
  <pre><code>ffmpeg -i http://199.180.75.118:80 -acodec pcm_s16le -ar 44100 -ac 2 "/home/dr_click/montest.wav"
  </code></pre>
  
  <p>It works. But, my goal is to get the frames on the fly and not a file. I thought about using a pipe but it seems it will work only with Linux and not with Windows (and no idea for MacOS)
  So, I'd prefer to stream locally a wav file and to catch it with JAVA into a AudioInputStream.</p>
  
  <p>I wrote this command :</p>
  
  <pre><code>ffmpeg -re -i http://199.180.75.118:80 -acodec pcm_s16le -ar 44100 -ac 2 -f rtp rtp://127.0.0.1:1234
  </code></pre>
  
  <p>It semms to work on the server side. But, when I enter the below command line on the server side :</p>
  
  <pre><code>ffplay rtp://127.0.0.1:1234
  </code></pre>
  
  <p>It doesn't work at all. I got this error :</p>
  
  <ul>
  <li>[rtp @ 0x7f29c8000b80] Unable to receive RTP payload type 97 without an SDP file describing it</li>
  </ul>
  
  <p>If I try the couple :</p>
  
  <pre><code>ffmpeg -i http://199.180.75.118:80 -acodec pcm_s16le -ar 44100 -ac 2 -f rtp -sdp_file /home/dr_click/audio.sdp rtp://127.0.1.1:1234
  </code></pre>
  
  <p>and</p>
  
  <pre><code>ffplay /home/dr_click/audio.sdp
  </code></pre>
  
  <p>I got the following error :</p>
  
  <ul>
  <li>[rtp @ 0x7f7d00008040] Protocol 'rtp' not on whitelist 'file,crypto'! if</li>
  </ul>
  
  <p>And if I finally try :</p>
  
  <pre><code>fmpeg -protocol_whitelist file,http,rtp,tcp -i http://199.180.75.118:80 -acodec pcm_s16le -ar 44100 -ac 2 -f rtp -sdp_file /home/dr_click/audio.sdp rtp://127.0.1.1:1234
  </code></pre>
  
  <p>I still get the same error.</p>
  
  <p>Which point do I miss to stream locally some raw datas and catch them back in the AudioInputStream ?</p>
  
  <p>Thank you for all your replies.</p>