使用gstreamer中自带的rtsp服务器,就能快速的以管道的形式搭建rtsp服务器推流
下载gst-rtsp-server
查看自己系统gstreamer的版本,在gstreamer官网下载相关版本.tar.xz源码包。解压后进入目录。./configurer 然后make编译。进入examples目录就能看到已经编译好的各种示例程序以及源码
gst-inspect-1.0 --version
推流usb摄像头JPEG格式视频同时显示
./test-launch “( v4l2src device=/dev/video0 ! image/jpeg,width=1280,height=720,framerate=30/1 ! jpegdec ! timeoverlay ! tee name=vsrc vsrc. ! queue ! videoconvert ! ximagesink vsrc. ! queue ! x264enc tune=zerolatency ! rtph264pay name=pay0 pt=96 )”
推流videotestsrc
./test-launch “( videotestsrc ! video/x-raw,width=640,height=480,framerate=30/1 ! timeoverlay ! tee name=vsrc vsrc. ! queue ! videoconvert ! ximagesink vsrc. ! queue ! x264enc tune=zerolatency ! rtph264pay name=pay0 pt=96 )”
转发H265
./test-launch "( rtspsrc latency=10 location=rtsp://192.168.20.51:8554/123 ! queue ! rtph265depay ! queue ! rtph265pay name=pay0 pt=98 )"
转发H264
./test-launch "( rtspsrc latency=20 location=rtsp://192.168.20.51:8554/123 ! queue ! rtph264depay ! queue ! rtph264pay name=pay0 pt=96 )"
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
sudo apt install mpv
sudo apt install libmpv-dev
mpv rtsp://192.168.144.25:8554/main.264
安装gstreamer基础库
sudo apt-get install libgl1-mesa-dev
sudo apt-get install gstreamer1.0-libav
sudo apt-get install gstreamer1.0-plugins-bad
sudo apt-get install gstreamer1.0-plugins-base
sudo apt-get install gstreamer1.0-plugins-ugly
sudo apt-get install gstreamer1.0-plugins-good
安装gst-rtsp推流功能包
sudo apt-get install gtk-doc-tools
git clone -b 1.8 https://github.com/GStreamer/gst-rtsp-server.git
cd gst-rtsp-server
./autogen.sh
sudo make
cd example/
./test-launch "( rtspsrc latency=20 location=rtsp://192.168.1.64 ! queue ! rtph264depay ! queue ! rtph264pay name=pay0 pt=96 )"
configure: error: Package requirements (glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0) were not met:
No package ‘glib-2.0’ found
No package ‘gobject-2.0’ found
sudo apt install -y libglib2.0-dev
configure: No package ‘gstreamer-1.0’ found
configure: error: no gstreamer-1.0 >= 1.8.0 (GStreamer) found
configure failed文章来源:https://www.toymoban.com/news/detail-693286.html
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
– No package ‘gstreamer-rtsp-server-1.0’ found文章来源地址https://www.toymoban.com/news/detail-693286.html
sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev
到了这里,关于使用gst-rtsp-server搭建rtsp服务器转发rtsp的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!