Qt5.7.1支持gstreamer1.0

来源:互联网 发布:淘宝gxg官方店是正品吗 编辑:程序博客网 时间:2024/05/16 05:40
Qt5.7.1支持gstreamer1.0
为了能让qmultimedia使用gstreamer1.0,真的是煞费苦心,各种心酸苦辣,宝宝心里苦,可是宝宝不说。现在终于实现了,感觉好开心。ps,看老外网站说,5.8版本(beta)已经默认支持了gstreamer1.0,不过没测试。(balabala)

1.进入解压目录(enter decompression path)


执行下列语句(excute)
cd /opt/qt-everywhere-opensource-src-5.7.1/qtbase/
2.下载依赖(download the build dependencies):
 
$ sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev
 
$ sudo apt-get install libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev  
 
$ sudo apt-get install gstreamer1.0*
 
$ sudo apt-get install libgstreamer1.0*
 
$ sudo apt-get install libxcb-xinerama0-dev

3.configure
执行下列语句(excute)
./configure -gstreamer 1.0 

然后你就会看见gstreamer 1.0 yes,哈哈哈哈(congratulations,then you can see the gstreamer 1.0 yes)
4.make
执行下列语句(excute)
make -j 4 && sudo make isntall
5.坐等(hold on)
6.安装qtcreator4.2(install qtcreator4.2 form qt website)
刚开始以为,opensource会自带qtcreator,但是找啊找,都找遍了还是没找到,才知道,qtcreator是分开安装的。(at first ,I don't know qtcreator need to be install separately)

7.安装qtmultimedia和其他一些模块(install qtmultimedia) and others models

cd cd /opt/qt-everywhere-opensource-src-5.7.1/然后执行下边语句

for MODULE in qtimageformats qtsvg  qtscript qtxmlpatterns qtdeclarative qtsensors qt3d qtgraphicaleffects  qtlocation qtmultimedia; do  cd $MODULE;  /usr/local/Qt-5.7.1/bin/qmake .;  make -j4;  sudo make install;  cd ..; done
注意的是qmake的位置,因为我在安装qt5.7时候没有自己指定安装路径,所以默认路径是/usr/local/Qt-5.7.1/bin/qmake,如果你的不是,请自己更改
8.运行qtcreator(open qtcretor(ide))
随便新建一个项目(new a project)

在左边Projects点击,(click the left Projects)


点击manage kits(click the manage kits)


点击qtversion,点击auto-detected,(click qtversion then click the auto-detected)


点击qtversion,选择/usr/local/Qt-5.7.1/bin/qmake(qtversion,select '/usr/local/Qt-5.7.1/bin/qmake' )

9.找个播放器测试一下(test)
给个例子的地址吧(或者在welcome examples 搜video 最后一个即可)(serch in welcome examples,keyword “video” the last one)
如果qtcreator4 没有examples,这里我把他上传至百度网盘公开链接https://pan.baidu.com/s/1qXKLrcC(if you have not the examps,click here)
我试验了RMVB和mp4都支持,(support rmvb MP4,others no test)

参考

http://blog.csdn.net/liuysheng/article/details/7826487

http://fmattdev.blogspot.com/2016/07/compiling-qt-57-for-gstreamer-10-on.html

Thanks qtforum's SGaist,I refer to yours reply.

0 0
原创粉丝点击