参考 《gstreamer编译安装》
一 编译gstreamer
1 生成编译配置


cd  gstreamer
sudo ./autogen.sh
checking for bison... no
configure: error: Could not find bison


依赖bison 但是没有安装bison。
解决办法:
A 下载自己编译(下载了,但是我没有编译)
下载bion<http://www.boost.org/>


B 直接安装bison
sudo apt-get install bison
下列【新】软件包将被安装:
  bison libbison-dev
这样安装了。


重新运行
sudo ./autogen.sh
checking bison version 2.5 >= 1.875... yes
checking for flex... no
configure: error: Could not find flex


A 直接安装flex
sudo apt-get install flex
下列【新】软件包将被安装:
  flex libfl-dev


重新运行
sudo ./autogen.sh
configure: error: You need to have gtk-doc >= 1.12 installed to build GStreamer
  configure failed


A 安装gtk-doc
sudo apt-get install gtk-doc-tools


将会安装下列额外的软件包:
  docbook docbook-dsssl docbook-to-man docbook-xsl gnome-common intltool jade
  libsp1c2 libxml-parser-perl sp xsltproc
建议安装的软件包:
  psgml docbook-defguide jadetex docbook-dsssl-doc docbook-xsl-doc-html
  docbook-xsl-doc-pdf docbook-xsl-doc-text docbook-xsl-doc libsaxon-java
  libxalan2-java libxslthl-java docbook-xsl-saxon fop xalan dbtoepub
下列【新】软件包将被安装:
  docbook docbook-dsssl docbook-to-man docbook-xsl gnome-common gtk-doc-tools
  intltool jade libsp1c2 libxml-parser-perl sp xsltproc


重新运行
sudo ./autogen.sh


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


Documentation (manuals)    : yes
Documentation (API)        : yes


Debug Logging              : yes
Command-line parser        : yes
Option parsing in gst_init : yes
Tracing subsystem          : yes
Allocation tracing         : yes
Plugin registry            : yes
Plugin support           : yes
Static plugins             : no
Unit testing support       : yes


Debug                      : yes
Profiling                  : no


Building benchmarks        : yes
Building examples          : yes
Building test apps         : yes
Building tests that fail   : yes
Building tools             : yes
2 开始编译
sudo make 


3 安装
sudo make install
test -z "/usr/local/bin" || /bin/mkdir -p "/usr/local/bin"
  /bin/bash ../libtool   --mode=install /usr/bin/install -c gst-inspect-1.0 gst-typefind-1.0 gst-launch-1.0 '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/gst-inspect-1.0 /usr/local/bin/gst-inspect-1.0
libtool: install: /usr/bin/install -c .libs/gst-typefind-1.0 /usr/local/bin/gst-typefind-1.0
libtool: install: /usr/bin/install -c .libs/gst-launch-1.0 /usr/local/bin/gst-launch-1.0
test -z "/usr/local/share/man/man1" || /bin/mkdir -p "/usr/local/share/man/man1"


可以查看/usr/local/bin 和usr/local/lib  下面和gst相关的内容项。


二 安装 gst-plugins-base
1 生成编译配置
cd gst-plugins-base
sudo ./autogen.sh


configure: *** Plug-ins without external dependencies that will be built:
adder
app
audioconvert
audiorate
audioresample
audiotestsrc
encoding
gio
playback
subparse
tcp
typefind
videoconvert
videorate
videoscale
videotestsrc
volume


configure: *** Plug-ins without external dependencies that will NOT be built:


configure: *** Plug-ins that have NOT been ported:


configure: *** Plug-ins with dependencies that will be built:
alsa
ogg
pango
theora
vorbis
ximagesink


configure: *** Plug-ins with dependencies that will NOT be built:
cdparanoia
ivorbisdec
libvisual
xvimagesink


configure: *** Orc acceleration disabled.  Requires Orc >= 0.4.17, which was
               not found.  Slower code paths will be used.


Now type 'make' to compile gst-plugins-base.


2 编译
sudo make
s-scan: error while loading shared libraries: libgstreamer-1.0.so.0: cannot open shared object file: No such file or directory


找不到libgstreamer-1.0.so.0
hdhuang@hdh-UBT:/usr/local/lib$ ls
gstreamer-1.0               libgstcontroller-1.0.so.0.103.0
libgstbase-1.0.la           libgstnet-1.0.la
libgstbase-1.0.so           libgstnet-1.0.so
libgstbase-1.0.so.0         libgstnet-1.0.so.0
libgstbase-1.0.so.0.103.0   libgstnet-1.0.so.0.103.0
libgstcheck-1.0.la          libgstreamer-1.0.la
libgstcheck-1.0.so          libgstreamer-1.0.so
libgstcheck-1.0.so.0        libgstreamer-1.0.so.0
libgstcheck-1.0.so.0.103.0  libgstreamer-1.0.so.0.103.0
libgstcontroller-1.0.la     pkgconfig
libgstcontroller-1.0.so     python2.7
libgstcontroller-1.0.so.0


这个文件在这个目录底下有,为什么说找不到这个文件呢?
A 修改环境变量:
export LD_LIBRARY=/usr/local/lib
echo $LD_LIBRARY
/usr/local/lib
sudo ldconfig


从新编译:
sudo make


3 安装
sudo make install
查看
/usr/local/lib 
多了好多组件。


三 安装 gst-plugins-good
A 生成编译配置
cd gst-plugins-good
sudo ./autogen.sh
configure: *** Plug-ins without external dependencies that will be built:
alpha
apetag
audiofx
audioparsers
auparse
autodetect
avi
cutter
debugutils
deinterlace
dtmf
effectv
equalizer
flv
flx
goom
goom2k1
icydemux
id3demux
imagefreeze
interleave
isomp4
law
level
matroska
multifile
multipart
replaygain
rtp
rtpmanager
rtsp
shapewipe
smpte
spectrum
udp
videobox
videocrop
videofilter
videomixer
wavenc
wavparse
y4m


configure: *** Plug-ins without external dependencies that will NOT be built:
monoscope


configure: *** Plug-ins that have NOT been ported:


configure: *** Plug-ins with dependencies that will be built:
aasink
cacasink
cairo
flac
gdkpixbuf
jack
jpeg
oss4
ossaudio
png
shout2
speex
taglib
v4l2src
ximagesrc


configure: *** Plug-ins with dependencies that will NOT be built:
1394
directsoundsink
dv
osxaudio
osxvideosink
pulseaudio
souphttpsrc
sunaudio
vpx
waveformsink
wavpack


configure: *** Orc acceleration disabled.  Requires Orc >= 0.4.17, which was
               not found.  Slower code paths will be used.


2 编译
sudo make


3 安装


四 安装 ffmpeg
1 配置
  cd gst-ffmpeg
  sudo ./autogen.sh
2编译
sudo make


3 安装
sudo make install
test -z "/usr/local/lib/gstreamer-1.0" || /bin/mkdir -p "/usr/local/lib/gstreamer-1.0"
 /bin/bash ../../libtool   --mode=install /usr/bin/install -c   libgstlibav.la '/usr/local/lib/gstreamer-1.0'
libtool: install: /usr/bin/install -c .libs/libgstlibav.so /usr/local/lib/gstreamer-1.0/libgstlibav.so
libtool: install: /usr/bin/install -c .libs/libgstlibav.lai /usr/local/lib/gstreamer-1.0/libgstlibav.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/lib/gstreamer-1.0
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib/gstreamer-1.0


If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'


See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.




将安装路径添加到/etc/ld.so.conf里面。
sudo gedit ld.so.conf
sudo ldconfig




 五 测试


gst-launch-0.10 -v playbin uri=file:///home/hdhuang/realize.ogg
ok可以正常播放。


补充说明:

需要案子ugly才可以播放rm和wma,asf等,所以ugly最好也安装

Logo

助力广东及东莞地区开发者,代码托管、在线学习与竞赛、技术交流与分享、资源共享、职业发展,成为松山湖开发者首选的工作与学习平台

更多推荐