Streaming a simple RTP audio stream from FFmpeg?
https://trac.ffmpeg.org/wiki/StreamingGuide


FFmpeg can stream a single stream using the RTPprotocol. In order to avoid buffering problems on the otherhand, the streaming should be done through the -re option, whichmeans that the stream will be streamed in real-time (i.e. it slowsit down to simulate a live streaming source.


For example the following command will generate a signal, andwill stream it to the port 1234 on localhost:



点击(此处)折叠或打开

  1. ffmpeg -re -f lavfi -i aevalsrc="sin(400*2*PI*t)" -ar 8000 -f mulaw -f rtp rtp://127.0.0.1:1234


To play the stream with ffplay, run the command:

点击(此处)折叠或打开

  1. ffplay rtp://127.0.0.1:1234


Note that rtp by default uses UDP, which, for large streams, cancause packet loss. See the "point to point" section in thisdocument for hints if this ever happens to you.

01-15 02:06