目录
将videotestsrc推送为rtsp链接
- 先安装开发环境
# install gst-rtsp-server libs sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev # install gst-rtsp-server test server(1.14 is your gst version, checked by gst-lanch-1.0 --version) wget https://raw.githubusercontent.com/GStreamer/gst-rtsp-server/1.14/examples/test-launch.c gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)
- 注意检查主机是否开放了防火墙端口,这里用
8554
端口演示如何开放sudo iptables -I INPUT -p tcp --dport 8554 -j ACCEPT sudo iptables -I OUTPUT -p tcp --sport 8554 -j ACCEPT
- 运行编译好的程序
./test-launch " videotestsrc ! x264enc ! rtph264pay name=pay0 pt=96 "
- 用vlc拉流