1. 使用vlc,自带server
安装好vlc软件,然后用如下命令起流
1 | Applications/VLC.app/Contents/MacOS/VLC -vvv test.264 –sout ‘#rtp{sdp=rtsp://:5544/test}’; |
vlc会自动创建server,不错哦。
2. 使用ffmpeg,nginx做server
参考这里
mac貌似自带ffmpeg,没有的话就安装一个,然后
1 | ffmpeg -re -i test.mp4 -vcodec copy -codec copy -f rtsp rtsp://ip地址/ |
3. 使用live555,自带server
参考本文
live555目录下有个mediaServer目录,其中包含Live555流媒体服务器的标准示例程序,运行live555MediaServer.exe后出现如下界面:

在mediaServer目录中放入你的媒体文件,如test.mp3,在VLC播放器中选择“媒体”-“打开网络串流”,然后输入 rtsp://127.0.0.1:8554/test.mp3 就可以播放刚才的mp3文件了。
proxyServer目录中是live555实现的代理服务器的例子程序,这个程序可以从其他的流媒体服务器(如支持RTSP的摄像机)取实时的视频流然后转发给多个RTSP客户端,这个程序很有用,可以转发摄像机的实时视频流。
4. 使用gstream,自带server
下载源码进行编译后:
1、切换到examples目录:cd examples
2、搭建Rtsp Server:./test-launch “( videotestsrc ! x264enc ! rtph264pay name=pay0 pt=96 )”
3、播放rtsp流:gst-launch-1.0 playbin uri=rtsp://127.0.0.1:8554/test`
5. 使用ffmpeg,go做server
https://github.com/aler9/rtsp-simple-server,下载源码后,直接运行./rtsp-simple-server,然后就可以发布流了。
6. 使用SRS
参考下文:https://www.cnblogs.com/yjmyzz/p/srs_study_1_install_push_and_pull_stream.html