现在的位置: 首页 > 综合 > 正文

ubuntu 下GStreamer开发环境搭建

2012年04月12日 ⁄ 综合 ⁄ 共 19051字 ⁄ 字号 评论关闭

在ubuntu10.04下 GStreamer开发环境搭建 

 

一 安装gstreamer

1 下载gstreamer源码

http://gstreamer.freedesktop.org/src/gstreamer/

我下的是gstreamer-0.10.35.tar.gz

2 进入目录,解压

./configure

administrator@ubuntu:~/下载/gstreamer-0.10.35$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking nano version... 0 (release)
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... no
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether NLS is requested... yes
checking for msgfmt... no
checking for gmsgfmt... :
checking for xgettext... no
checking for msgmerge... no
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for VALGRIND... no
no
configure: Using GStreamer source release as package name
configure: Using Unknown package origin as package origin
configure: Using GST_PKG_CONFIG_PATH = $(top_builddir)/pkgconfig
configure: Setting GST_PACKAGE_RELEASE_DATETIME to 2011-06-15
configure: WARNING: Sissy ! By asking to not build the tests known to fail, you hereby waive your right to customer support.  If you do not agree with this EULA, please press Ctrl-C before the next line is printed.  By allowing the next line to be printed,
you expressly acknowledge your acceptance of this EULA.
checking whether byte ordering is bigendian... no
checking if unaligned memory access works correctly... (whitelisted) yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking for gcc option to accept ISO C99... -std=gnu99
checking for gcc -std=gnu99 option to accept ISO Standard C... (cached) -std=gnu99
checking whether gcc -std=gnu99 and cc understand -c and -o together... yes
checking dependency style of gcc -std=gnu99... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
configure: working c++ compiler found: yes
checking for perl... /usr/bin/perl

 

 

checking for bison... no
configure: error: Could not find bison
出现这个错误,找不到bison,那么解决方案也很简单,安装bison就是了。
configure: error: Could not find bison

解决错误:
administrator@ubuntu:~/下载/gstreamer-0.10.35$ sudo apt-get install bison

[sudo] password for administrator:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
建议安装的软件包:
  bison-doc
下列【新】软件包将被安装:
  bison
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 337 个软件包未被升级。
需要下载 468kB 的软件包。
解压缩后会消耗掉 1,810kB 的额外空间。
获取:1 http://cn.archive.ubuntu.com/ubuntu/ maverick/main bison i386 1:2.4.1.dfsg-3 [468kB]
下载 468kB,耗时 4秒 (113kB/s)
选中了曾被取消选择的软件包 bison。
(正在读取数据库 ... 系统当前共安装有 137397 个文件和目录。)
正在解压缩 bison (从 .../bison_1%3a2.4.1.dfsg-3_i386.deb) ...
正在处理用于 man-db 的触发器...
正在设置 bison (1:2.4.1.dfsg-3) ...
update-alternatives: 使用 /usr/bin/bison.yacc 来提供 /usr/bin/yacc (yacc),于 自动模式 中。

再次运行configure看看情况
administrator@ubuntu:~/下载/gstreamer-0.10.35$ ./configure
....
checking for bison... /usr/bin/bison
checking bison version 2.4.1 >= 1.875... yes
checking for flex... no
configure: error: Could not find flex

发现没安装flex,同上。
administrator@ubuntu:~/下载/gstreamer-0.10.35$ sudo apt-get install flex
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
建议安装的软件包:
  build-essential
下列【新】软件包将被安装:
  flex
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 337 个软件包未被升级。
需要下载 244kB 的软件包。
解压缩后会消耗掉 999kB 的额外空间。
获取:1 http://cn.archive.ubuntu.com/ubuntu/ maverick/main flex i386 2.5.35-9.1 [244kB]
下载 244kB,耗时 3秒 (73.3kB/s)
选中了曾被取消选择的软件包 flex。
(正在读取数据库 ... 系统当前共安装有 137435 个文件和目录。)
正在解压缩 flex (从 .../flex_2.5.35-9.1_i386.deb) ...
正在处理用于 install-info 的触发器...
正在处理用于 man-db 的触发器...
正在设置 flex (2.5.35-9.1) ...

发现还是有错误:
checking for GLIB... no
configure: No package 'glib-2.0' found
No package 'gobject-2.0' found
No package 'gthread-2.0' found
No package 'gmodule-no-export-2.0' found
configure: error: This package requires GLib >= 2.22 to compile.


administrator@ubuntu:~/下载/gstreamer-0.10.35$ sudo apt-get install glib-2.0

正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
注意,根据正则表达式 glib-2.0 选中了 gir1.0-glib-2.0
注意,根据正则表达式 glib-2.0 选中了 gobject-introspection-glib-2.0
gir1.0-glib-2.0 已经是最新的版本了。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 337 个软件包未被升级。

选择安装 http://ftp.acc.umu.se/pub/GNOME/sources/glib/2.29/
我选择安装glib-2.29.4.tar.gz    没代理的话,下载比较慢,大热天,学insun洗个澡再来吧。
解压
glib-2.29.4.tar.gz

administrator@ubuntu:~/下载/glib-2.29.4$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for the BeOS... no
checking for Win32... no
checking for Mac OS X Carbon support... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether we are using the GNU C Library 2.1 or newer... yes
checking whether to enable garbage collector friendliness... no
checking whether to disable memory pools... no
checking for c++... c++
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking dependency style of c++... gcc3
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking whether gcc and cc understand -c and -o together... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.16... yes
checking for gawk... (cached) mawk
checking for perl5... no
checking for perl... perl
checking for indent... no
checking for perl... /usr/bin/perl
checking for a Python interpreter with version >= 2.4... python
checking for python... /usr/bin/python
checking for python version... 2.6
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.6/dist-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.6/dist-packages
checking for iconv_open... yes
checking Whether to cache iconv descriptors... no
checking for ZLIB... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for inflate in -lz... no
configure: error: *** Working zlib library and headers not found ***

administrator@ubuntu:~/下载/glib-2.29.4$ sudo apt-get install zlib1g
[sudo] password for administrator:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
zlib1g 已经是最新的版本了。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 337 个软件包未被升级。
administrator@ubuntu:~/下载/glib-2.29.4$ sudo apt-get install zlib1g-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
下列【新】软件包将被安装:
  zlib1g-dev
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 337 个软件包未被升级。
需要下载 188kB 的软件包。
解压缩后会消耗掉 418kB 的额外空间。
获取:1 http://cn.archive.ubuntu.com/ubuntu/ maverick/main zlib1g-dev i386 1:1.2.3.4.dfsg-3ubuntu1 [188kB]
下载 188kB,耗时 7秒 (24.8kB/s)                                               
选中了曾被取消选择的软件包 zlib1g-dev。
(正在读取数据库 ... 系统当前共安装有 137458 个文件和目录。)
正在解压缩 zlib1g-dev (从 .../zlib1g-dev_1%3a1.2.3.4.dfsg-3ubuntu1_i386.deb) ...
正在处理用于 man-db 的触发器...
正在设置 zlib1g-dev (1:1.2.3.4.dfsg-3ubuntu1) ...

administrator@ubuntu:~/下载/glib-2.29.4$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
...
configure: error: Package requirements (libffi >= 3.0.0) were not met:

No package 'libffi' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBFFI_CFLAGS
and LIBFFI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

http://sourceware.org/libffi/
libffi-3.0.9 was released on December 31, 2009. You can ftp it from
sourceware.org:/pub/libffi/libffi-3.0.9.tar.gz.

解压libffi-3.0.9.tar.gz

administrator@ubuntu:~/下载/libffi-3.0.9$ ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mmap... yes
checking for sys/mman.h... (cached) yes
checking for mmap... (cached) yes
checking whether read-only mmap of a plain file works... yes
checking whether mmap from /dev/zero works... yes
checking for MAP_ANON(YMOUS)... yes
checking whether mmap with MAP_ANON(YMOUS) works... yes
checking for ANSI C header files... (cached) yes
checking for memcpy... yes
checking for working alloca.h... yes
checking for alloca... yes
checking size of double... 8
checking size of long double... 12
checking whether byte ordering is bigendian... no
checking assembler .cfi pseudo-op support... yes
checking assembler supports pc related relocs... yes
checking whether .eh_frame section should be read-only... no
checking for __attribute__((visibility("hidden")))... yes
configure: creating ./config.status
config.status: creating include/Makefile
config.status: creating include/ffi.h
config.status: creating Makefile
config.status: creating testsuite/Makefile
config.status: creating man/Makefile
config.status: creating libffi.pc
config.status: creating fficonfig.h
config.status: linking src/x86/ffitarget.h to include/ffitarget.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing include commands
config.status: executing src commands
无报错。
administrator@ubuntu:~/下载/libffi-3.0.9$ make
administrator@ubuntu:~/下载/libffi-3.0.9$ sudo make install
这个错误解决 下个错误又来了

administrator@ubuntu:~/下载/glib-2.29.4$ ./configure
...
checking for msgfmt... no
configure: error:
*** You must have either have gettext support in your C library, or use the
*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html

administrator@ubuntu:~/下载/glib-2.29.4$ sudo apt-get install gettex
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
E: 未发现软件包 gettex
只好自己去下gettex包。http://download.chinaunix.net/download.php?id=24924&ResourceID=3687
解压gettext-0.16.1.tar.gz
checking for dvips... /home/administrator/下载/gettext-0.16.1/ ./configure
然后make和sudo make install,源码比较大,比较耗时间。

administrator@ubuntu:~/下载/glib-2.29.4$  ./configure
无错误。
administrator@ubuntu:~/下载/glib-2.29.4$  make & sudo make install

administrator@ubuntu:~/下载/gstreamer-0.10.35$ ./configure
。。。。
checking for XML... no
no
configure: error:
        Need libxml2 and development headers/files to build GStreamer.

        You can do without libxml2 if you pass --disable-loadsave to
        configure, but that breaks ABI, so don't do that unless you
        are building for an embedded setup and know what you are doing.

administrator@ubuntu:~/下载/gstreamer-0.10.35$ sudo apt-get install libxml2
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
下列软件包将被升级:
  libxml2
升级了 1 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 336 个软件包未被升级。
需要下载 824kB 的软件包。
解压缩后将会空出 12.3kB 的空间。
获取:1 http://cn.archive.ubuntu.com/ubuntu/ maverick-updates/main libxml2 i386 2.7.7.dfsg-4ubuntu0.2 [824kB]
下载 824kB,耗时 13秒 (61.8kB/s)                                              
(正在读取数据库 ... 系统当前共安装有 137487 个文件和目录。)
正预备替换 libxml2 2.7.7.dfsg-4 (使用 .../libxml2_2.7.7.dfsg-4ubuntu0.2_i386.deb) ...
正在解压缩将用于更替的包文件 libxml2 ...
正在设置 libxml2 (2.7.7.dfsg-4ubuntu0.2) ...
正在处理用于 libc-bin 的触发器...
ldconfig deferred processing now taking place

然后发现还是出错,索性自己下载源码

http://xmlsoft.org/sources/

解压libxml2-2.7.7.tar.gz
administrator@ubuntu:~/下载/libxml2-2.7.7$ ./configure
出错:
config.status: executing libtool commands
/bin/rm: cannot remove `libtoolT': No such file or directory
Done configuring
administrator@ubuntu:~/下载/libxml2-2.7.7$ make & sudo make install

administrator@ubuntu:~/下载/gstreamer-0.10.35$ ./configure

终于安装完成,你蛋疼了没?

Configuration
    Version                    : 0.10.35
    Source code location       : .
    Prefix                     : /usr/local
    Compiler                   : gcc -std=gnu99
    Package name               : GStreamer source release
    Package origin             : Unknown package origin

    Documentation (manuals)    : no
    Documentation (API)        : no

    Debug Logging              : yes
    Pipeline XML load/save     : yes
    Command-line parser        : yes
    Option parsing in gst_init : yes
    Tracing subsystem          : yes
    Allocation tracing         : yes
    Plugin registry            : yes
    Plugin support               : yes
    Network support            : yes
    Unit testing support       : yes

    Debug                      : yes
    Profiling                  : no

    Building examples          : yes
    Building test apps         : yes
    Building tests that fail   : no

二 安装插件:

gstreamer-plugins-base

gstreamer-plugins-good

 

安装过程中会出现一些错误,请忽略;如果需要Gstreamer支持更多的多媒体格式,请自己安装相对应的插件!

抱歉!评论已关闭.