0
votes

I want to receive a RTP Stream and send the raw data received in it over TCP / UDP socket. For this i am trying following commands.

  1. I am sending the RTP stream using following command.

    ffmpeg -re -i hello.wav -ar 8000 -f mulaw -f rtp rtp://127.0.0.1:1234

  2. Receiver to re transmit the stream over TCP / UDP socket.

    ffmpeg -i rtp://127.0.0.1:1234 -f mulaw tcp://127.0.0.1:5555 -hide_banner

  3. A Player to play this Socket stream to verify.

    ffplay tcp://127.0.0.1:5555?listen

My second command shows that its receiving data and transmitting the data to tcp over 5555 port.

Input #0, rtp, from 'rtp://127.0.0.1:1234':
  Duration: N/A, start: 0.000000, bitrate: 64 kb/s
    Stream #0:0: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_mulaw (native) -> pcm_mulaw (native))
Press [q] to stop, [?] for help
Output #0, mulaw, to 'tcp://127.0.0.1:5555':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
    Metadata:
      encoder         : Lavc58.54.100 pcm_mulaw

But the third command does not receive anything, even i tried dumping the response into a file using FFMPEG in command three but same results.

What am i doing wrong, Please suggest the correct commands using FFMPEG.

1
"Please suggest the correct commands to achieve the same using FFMPEG." You are using ffmpeg. What's the actual question? This is too vague to answer.llogan

1 Answers

0
votes

Following three commands worked for me.

ffmpeg -re -i music.wav -ar 8000 -f mulaw -f rtp rtp://127.0.0.1:1236
ffmpeg -i rtp://127.0.0.1:1236 -f wav tcp://127.0.0.1:1256
ffplay tcp://127.0.0.1:1256?listen -ar 8000

I am able to send file as RTP, convert it to raw wav and send it over socket and then play it from that socket.