Windows下快速配置gstreamer开发环境

来源:互联网 发布:派拓网络 编辑:程序博客网 时间:2024/05/17 12:24

Windows下快速配置gstreamer开发环境

杜晶 2010-07-21上海

 

本文采用OSSBuild快速构建Windows下的GStreamer开发环境,如果想要使用Gtk来开发的朋友们可以参照其他博文。

(本文的完整环境下载) 

1.安装GStreamer-WinBuilds-GPL-x86.msi,采用默认组件选项(全装),安装路径中最好不要有空格。

2.做开发的才需安装GStreamer-WinBuilds-SDK-GPL-x86.msi,采用默认组件选项(全装),安装路径被强制在运行时路径的sdk子目录下。

3.python26.dll复制到 <gst程序目录>/v0.10.6/bin下。刚开始我就是没有复制这个,运行自己写的测试应用程序总报如下错误,折腾了2天啊:

 

** (gst-launch-0.10:3528): WARNING **: Failed to loadplugin 'C:/GStreamer/v0.10

.6/lib/gstreamer-0.10/libgstpython-v2.6.dll': `C:/GStreamer/v0.10.6/lib/gstreame

r-0.10/libgstpython-v2.6.dll': 找不到指定的模块。

 

使用gst-launch.exe命令也会报上述错误,并且弹出如下对话框:

 

4.安装gst-ffmpeg-0.10.2.exe,安装时注意点开 Show details按钮,如下图,注意里面的dll和目的路径:

 

libgstffmpeg.dll复制到<gst程序目录>/v0.10.6/lib/gstreamer-0.10下,并将avcodec-51.dll,avformat-51.dll,avutil-49.dll复制到 c:/window/system32 (即系统目录%system32%)

 

这个东西折腾了我一天,如果不这么做,运行自己写的测试应用程序总报Cann't create player。使用gst-launch.exe命令,则会报如下错误:

Setting pipeline to PAUSED ...

Pipeline is PREROLLING ...

ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQueue:queu

e1: Internal data flow error.

Additional debug info:

../../../Source/gstreamer/plugins/elements/gstqueue.c(1212):gst_queue_loop ():

/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQueue:queue1:

streaming task paused, reason not-linked (-1)

ERROR: pipeline doesn't want to preroll.

Setting pipeline to NULL ...

Freeing pipeline ...

 

这些都说明没有找到合适的解码器导致链路没有链接成功,所以需要装上ffmpeg forGstreamer,而仅拷贝libgstffmpeg.dll运行自己写的测试应用程序还会报如下错误:

** (gst-launch-0.10:4324): WARNING **: Failed to loadplugin 'C:/GStreamer/v0.10

.6/lib/gstreamer-0.10/libgstffmpeg.dll': `C:/GStreamer/v0.10.6/lib/gstreamer-0.1

0/libgstffmpeg.dll': 找不到指定的模块。

 

使用gst-launch.exe命令也会报上述错误,并且弹出如下对话框:

 

5.做完上述四步,我们的gst环境就基本配置好了,把一个完好的avi文件放在c:/sun.avi(下载后将后缀改名为avi即可),如果使用下面命令可以看到下面的效果图就说明环境配置正确完成了:

gst-launchfilesrc location= C://sun.avi !decodebin !ffmpegcolorspace !autovideosink

 

快!上手跑个应用程序试试吧,是不是很兴奋?

 

综上,关键要注意:

gst-ffmpeg-0.10.2.exe安装时看细节。

命令行:gst-launchfilesrc location= C://sun.avi ! decodebin !ffmpegcolorspace !autovideosink

如何配置VC编译简单工程,请参见我博客里 转载的《windows下gstreamer软件开发环境的搭建过程》一文。

原创粉丝点击