1. 安装依赖包
$ sudo apt-get install gtk-doc-tools libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
2. 下载、编译 gst-rtsp-server
$ git clone git://anongit.freedesktop.org/gstreamer/gst-rtsp-server
$ cd gst-rtsp-server
$ ./autogen.sh
$ make
3. 推流
$ cd examples
$ ./test-launch "( videotestsrc ! x264enc ! rtph264pay name=pay0 pt=96 )"
我的 Jetnon 的IP地址是: 192.168.119.210,因此用 VLC 打开网络串流:
当然,examples 目录i下有很多 test 的例子,比如 test-read、test-video 也可以实现上面的效果。还有许多其他范例,具体可参见其源代码。