Streaming a simple RTP audio stream from FFmpeg?
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:
-
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:
-
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.
阅读(5680) | 评论(0) | 转发(0) |