1. 使用vlc,自帶server
安裝好vlc軟件,然後用如下命令起流
Applications/VLC.app/Contents/MacOS/VLC -vvv test.264 –sout ‘#rtp{sdp=rtsp://:5544/test}’;
vlc會自動創建server,不錯哦。
2. 使用ffmpeg,nginx做server
參考這裏
mac貌似自帶ffmpeg,沒有的話就安裝一個,然後
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