http://blog.csdn.net/zhoudekuai/article/details/8539432
gst-rtsp-server编译测试
分类: 流媒体 Linux c/c++ 2013-01-24 19:28 2550人阅读 评论(1) 收藏 举报
gst-rtsp gstreamer v4l2
最近在做全志A80平台的4K相机(RK3688的八核处理器只能够支持2K相机),调好之后就让全志A80作为4K的RTSP流媒体服务器。
操作系统选择(虚拟机VMware11中安装):
http://old-releases.ubuntu.com/releases/14.04.0/
ubuntu-14.04-desktop-amd64.iso
sudo apt-get install已经安装了freescale的i.MX6Q的android4.2.2/android4.4.2的软件。
1、下载源码包
gst-rtsp-0.10.8.tar.bz2(源地址:http://people.freedesktop.org/~wtay/)
http://people.freedesktop.org/~wtay/gst-rtsp-0.10.8.tar.bz2
libtool-2.4.tar.gz
http://ftpmirror.gnu.org/libtool/libtool-2.4.tar.gz
http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz
gtk-doc-1.18.tar.bz2
http://ftp.gnome.org/pub/gnome/sources/gtk-doc/1.18/gtk-doc-1.18.tar.xz
Download (HTTP): http://ftp.gnome.org/pub/gnome/sources/gtk-doc/1.24/gtk-doc-1.24.tar.xz
2、安装libtool和gtk-doc两个软件包
libtool顺利通过。
[email protected]:~/wyb/gst-rtsp-server/libtool-2.4$ ./configure
[email protected]:~/wyb/gst-rtsp-server/libtool-2.4$ make
[email protected]:~/wyb/gst-rtsp-server/libtool-2.4$ sudo make install
[email protected]:~/wyb/gst-rtsp-server/libtool-2.4$ libtool --help
[email protected]:~/wyb/gst-rtsp-server/libtool-2.4$ libtool --version
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编译通过。
[email protected]:~/wyb/gst-rtsp-server/gtk-doc-1.18$ ./configure
……
config.status: executing libtool commands
configure:
gtk-doc was configured with the following options:
==================================================
configure: ** Python based tools enabled, using /usr/bin/python
configure: ** SGML support enabled, using /usr/bin/openjade
configure: ** XML PDF support enabled, using /usr/bin/dblatex
configure: Gnome-doc-utils support disabled
configure: Scrollkeeper support disabled
configure: Syntax highlighting of examples disabled
configure: ** Building regression tests
configure: Debug tracing disabled
[email protected]:~/wyb/gst-rtsp-server/gtk-doc-1.18$ sudo apt-get install gnome-doc-utils
[email protected]:~/wyb/gst-rtsp-server/gtk-doc-1.18$ sudo apt-get install scrollkeeper
……
config.status: executing libtool commands
configure:
gtk-doc was configured with the following options:
==================================================
configure: ** Python based tools enabled, using /usr/bin/python
configure: ** SGML support enabled, using /usr/bin/openjade
configure: ** XML PDF support enabled, using /usr/bin/dblatex
configure: ** Gnome-doc-utils support enabled
configure: ** Scrollkeeper support enabled
configure: Syntax highlighting of examples disabled
configure: ** Building regression tests
configure: Debug tracing disabled
[email protected]:~/wyb/gst-rtsp-server/gtk-doc-1.18$
[email protected]:~/wyb/gst-rtsp-server/gtk-doc-1.18$ make
[email protected]:~/wyb/gst-rtsp-server/gtk-doc-1.18$ sudo make install
[email protected]:~/wyb/gst-rtsp-server/gtk-doc-1.18$
3、安装gst-rtsp-0.10.8
解压后运行autogen.sh。
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$ ./autogen.sh
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
ln: failed to create symbolic link ‘.git/hooks/pre-commit’: No such file or directory
+ check for build tools
checking for autoconf >= 2.60 ... found 2.69, ok.
checking for automake >= 1.10 ... found 1.14.1, ok.
checking for autopoint >= 0.17 ... autopoint not found !
You must have autopoint installed to compile gst-rtsp.
Download the appropriate package for your distribution,
or get the source tarball at ftp://ftp.gnu.org/pub/gnu/gettext/
checking for libtoolize >= 1.5.0 ... found 2.4, ok.
checking for pkg-config >= 0.8.0 ... found 0.26, ok.
- Please get the right tools before proceeding.
- Alternatively, if you‘re sure we‘re wrong, run with --nocheck.
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$ sudo apt-get install autopoint
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$ ./autogen.sh
……
checking for GST... no
configure: No package ‘gstreamer-0.10‘ found
configure: error: no gstreamer-0.10 >= 0.10.29 (GStreamer) found
configure failed
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$ sudo apt-get install libgstreamer0.10-dev
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$ sudo apt-get install libgstreamer-plugins-base0.10-dev
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$ ./autogen.sh
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$ make
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8$ sudo make install
[email protected]:~/wyb/gst-rtsp-server/gtk-doc-1.18$ sudo apt-get install xsltproc
http://zhidao.baidu.com/link?url=UAWMi6em_Vfn0fBsVb-qOwBYQfmO71OEOpPVTXuq3hZDZmrRCOnfyHR4WirN8ReBIkMLkg0tuuPdwpHsyGg4Bq
sudo apt-get install libgstreamer0.10-dev(之前会报找不到libgstreamer0.10的错误)
sudo apt-get install libgstreamer-plugins-base0.10-dev
安装必须的库:
http://blog.csdn.net/liukang325/article/details/45025853
ubuntu下 gstreamer 的配置及播放音视频例子
sudo apt-get install libgstreamer0.10-dev gstreamer-tools gstreamer0.10-tools gstreamer0.10-doc
sudo apt-get install gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse
不安装就会报错:
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8/examples$ ./test-readme
(lt-test-readme:2894): GLib-GObject-CRITICAL **: g_object_ref: assertion ‘G_IS_OBJECT (object)‘ failed
** (lt-test-readme:2894): CRITICAL **: gst_rtsp_media_factory_get_auth: assertion ‘GST_IS_RTSP_MEDIA_FACTORY (factory)‘ failed
GLib (gthread-posix.c): Unexpected error from C library during ‘pthread_mutex_lock‘: Invalid argument. Aborting.
Aborted (core dumped)
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8/examples$
http://www.linuxidc.com/Linux/2014-12/111000.htm
在Ubuntu 14.10上安装VLC播放器
sudo apt-get install vlc
4、测试gst-rtsp
首先要看下gst-rtsp安装包中doc目录中的README.这个文档介绍了gst-rtsp的使用。examples目录中有示例程序,已经全部编译好了。
先运行个简单的:
./test-readme
另开一终端运行:vlc rtsp://localhost:8554/test即可看到图像。九十年代电视台停播时的画面,好有感觉。
到此gst-rtsp-server的编译完成了。
如果是局域网的其他电脑,比如windows电脑,请使用ubuntu的IP地址比如:192.168.11.236。具体请通过ifconfig查询。localhost只能够在本机中执行。
rtsp://192.168.11.236:8554/test
示例程序中有个超好用的类似gst-lanuch的工具。
$ ./test_launch "( videotestsrc is-live=1 ! x264enc ! rtph264pay name=pay0 pt=96 )"
这个命令效果跟.test-readme是一样的。
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8/examples$ ./test-launch
usage: /home/rootroot/wyb/gst-rtsp-server/gst-rtsp-0.10.8/examples/.libs/lt-test-launch <launch line>
example: /home/rootroot/wyb/gst-rtsp-server/gst-rtsp-0.10.8/examples/.libs/lt-test-launch "( videotestsrc ! x264enc ! rtph264pay name=pay0 pt=96 )"
[email protected]:~/wyb/gst-rtsp-server/gst-rtsp-0.10.8/examples$ ./test-launch "( videotestsrc ! x264enc ! rtph264pay name=pay0 pt=96 )"
./test-launch "( videotestsrc is-live=1 ! x264enc ! rtph264pay name=pay0 pt=96 )"
我直接读取摄像头(笔记本电脑一般自带摄像头,台式机请插入USB摄像头)视频的命令就是它了:
$ ./test-launch "( v4l2src ! video/x-raw-yuv,format=‘fourcc‘YUY2,width=640,height=480 ! ffmpegcolorspace ! x264enc ! rtph264pay name=pay0 pt=96 )"
用vlc打开vlc rtsp://localhost:8554/test成功看到图像。
rtsp://192.168.11.236:8554/test
另,gst-rtsp是多播放支持的。不过示例程序test-readme和test_launch经过测试都只支持单播!
下载地址:
http://download.csdn.net/detail/wb4916/9242663
gst-rtsp-server编译测试20151105 0949