最近在做dm368的開發,打算在368上移植個gst-rtsp-server。先在電腦上折騰了一天,終於是可以運行了。
我的虛擬機上早先已經安裝了gstreamer-0.10(gstreamer版本太新,有些插件不能用)。gstreamer和base,good,ugly,bad相關插件安裝沒碰到什么問題。下面是我編譯gst-rtsp-0.10.8碰到的問題。
1,下載源碼包
gst-rtsp-0.10.8.tar.bz2(源地址:http://people.freedesktop.org/~wtay/)
libtool-2.4.tar.gz
gtk-doc-1.18.tar.bz2
2.安裝libtool和gtk-doc兩個軟件包
libtool順利通過。gtk-doc配置時出錯:
checking for DocBook XML DTD V4.3 in XML catalog... found
checking for DocBook XSL Stylesheets in XML catalog... not found
查看地gtk-doc的REAME有說軟件的依賴包,可是提供的網址我訪問不了。死馬當活馬醫的試了下直接安裝xsl竟然成功了。
sudo apt-get install docbook-xsl
再config編譯通過。
2.安裝gst-rtsp-0.10.8
解壓后運行autogen.sh。如果沒有安裝上面兩個包會分別出現下面兩個錯誤。
沒有安裝libtool:
checking for libtoolize >= 2.2.6 ... checking for glibtoolize >= 2.2.6 ... libtoolize not found !
You must have libtoolize installed to compile gst-rtsp.
Download the appropriate package for your distribution,
or get the source tarball at ftp://ftp.gnu.org/pub/gnu/libtool/
checking for pkg-config >= 0.8.0 ... found 0.27.1, ok.
- Please get the right tools before proceeding.
- Alternatively, if you're sure we're wrong, run with --nocheck.
沒有安裝gtk-doc:
checking for valgrind... no
checking for gobject-introspection... no
checking for gtkdoc-check... no
checking for gtkdoc-rebase... no
checking for gtkdoc-mkpdf... no
configure: error: You need to have gtk-doc >= 1.3 installed to build Gst-RTSP
configure failed
autogen.sh腳本執行完成后運行make && sudo make install安裝。
3.測試gst-rtsp
首先要看下gst-rtsp安裝包中doc目錄中的README.這個文檔介紹了gst-rtsp的使用。examples目錄中有示例程序,已經全部編譯好了。
先運行個簡單的:
$ ./test_readme
另開一終端運行:vlc rtsp://localhost:8554/test成功看到圖像。九十年代電視台停播時的畫面,好有感覺。
到此gst-rtsp-server是編譯的沒什么問題了。
示例程序中有個超好用的類似gst-lanuch的工具。
$ ./test_launch "( videotestsrc is-live=1 ! vpuenc codec=6 ! rtph264pay name=pay0 pt=96 )"
這個命令效果跟.test_readme是一樣的。
我直接讀取攝像頭視頻的命令就是它了:
$ ./test-launch "( mfw_v4lsrc device=/dev/video0 ! queue ! vpuenc codec=6 ! rtph264pay name=pay0 pt=96 )"
用vlc打開vlc rtsp://localhost:8554/test成功看到圖像。
另,gst-rtsp是多播放支持的。
http://m.blog.csdn.net/blog/zhoudekuai_tjsd/8539432
