Gstreamer入门小结

1. 定义

gstreamer is a pipeline-based multimedia framwork written in the C programming language with the type system based on GObject.

1) support various multimedia apps

2) Based on GLib2.0 for object-oriented design and inheritance

3) work on multiple OS

4) Subject to LGPL

Note:

Glib is a bundle of five low-level system libraries written in C and mainly developed by GNOME. Glib provide advanced data structure, implements functions that provide threads, mutexes, asynchronous queue and so on.It consists of 5 libraries: Gobject, Glib, Gmodule, Gthread, GIO.

Gobject: Glib Object System, is a free software library providing a portable object system and transparent cross-language interoperability. Directly in C, or through bindings to other language.

2.  安装

1)在windows上先装一个虚拟机

    • virtual box安装时 注意先 管理->全局设定,将默认虚拟电脑位置做个修改。安装过程就正常走完,就好。
    • virtual box安装过后,重启电脑,如果报com错误,右击virtual box属性->兼容性->以兼容模式运行这个程序:windowsXP(service pack2)->以管理员身份运行此程序
    • 在virtual box中安装ubuntu系统,创建时系统是ubuntu,设置之后右击 设置->存储->镜像选择ubuntu的iso
    • ctrl+alt+T可以打开ubuntu的命令行
    • 先对ubuntu安装一个 设备->安装增强功能, 安装完成后重启ubuntu
      需要时,重新安装增强工具
      sudo apt-get install kernel-source
      sudo apt-get install kernel-devel
      sudo apt-get install gcc
      这三条命令,应该是成功的,如果不成功,直接重启ubuntu或者虚拟机
    • 实现ubuntu和window中的文件共享: virtual box->设置->共享文件夹->+文件,window目录
      sudo mkdir /mnt/shared
      sudo mount -t vboxsf windowsSharedDocument /mnt/shared

2) gstreamer版本的安装

    •  sudo apt-get install gstreamer,  TAB选择需要安装的包
    • 从github上下载想要的gstreamer的包,
      • eg.
        • gstreamer-0.10.28.tar.gz
          gst-plugins-base-0.10.28.tar.gz
          gst-plugins-good-0.10.21.tar.gz
          gst-plugins-bad-0.10.18.tar.gz
        • gst-template-master等
      • 编译安装注意设置Path:
        • $ cd gstreamer的安装目录
        • $ export PKG_CONFIG_PATH = /usr/local/lib/pkgconfig
        • $ export LD_LIBRARY_PATH = /usr/local/lib
      • 使用./configure & make & make install 命令

3) 测试是否可用

//hello.c/
#include <gst/gst.h>
int main (int argc,char *argv[])
{
    const gchar* nano_str;
    guint major, minor, micro, nano;
    gst_init(&argc,&argv);
    gst_version(&major,&minor,&micro,&nano);
    if(nano==1)
         nano_str = "(CVS)";
    else if(nano ==2)
         nano_str = "(Prerelease)";
    else
         nano_str ="";
    printf ("This program is linked against GStreamer %d.%d.%d %s/n",
           major, minor, micro, nano_str);
    return 0;
}
/

    • 编译$  gcc -Wall $(pkg-config --cflags --libs gstreamer-0.10) hello.c -o hello
              $ ./hello
    • Note: 如果编译时undefined reference to gst_init, 那么$ gcc -Wall hello.c -o hello $(pkg-config --cflags --libs gstreamer-0.10) 再$ ./hello

4) plugin的编译

$ cd  gst-templates/gst-plugin/src

$ ../tools/make_element  MyFilter

   Modify MakeFile.am -----gstmyfilter.c & gstmyfilter.h

$cd ..

$./autogen.sh

$make

$cd  src

$cp .libs/libgstplugin.so /usr/lib/i386-linux-gnu/gstreamer1.0

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值