其他分享
首页 > 其他分享> > gstreamer介绍及使用

gstreamer介绍及使用

作者:互联网

一、gstreamer介绍

参考链接:https://max.book118.com/html/2019/0302/8137062125002010.shtm

      https://www.cnblogs.com/luckbird/p/GStreamer_Demo.html

     https://www.cnblogs.com/xleng/p/10948838.html

Gstreamer是一个支持Windows,Linux,Android, iOS的跨平台的多媒体框架,应用程序可以通过管道(Pipeline)的方式,将多媒体处理的各个步骤串联起来,达到预期的效果。每个步骤通过元素(Element)基于GObject对象系统通过插件(plugins)的方式实现,方便了各项功能的扩展。

二、gstreamer安装

ubuntu下gstreamer安装命令为:

sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio

这个命令主要是安装gstreamer的各种插件包,这些包中包含了很多插件,如gstreamer1.0-plugins-base是基础插件包,gstreamer1.0-plugins-good是高质量的采用LGPL授权的插件包。通过gst-inspect-1.0命令看一下qtdemux插件的信息,如下所示:

红框中显示qtdemux的的插件属于gstreamer1.0-plugins-good插件包

 

 

三、gstreamer命令

3.1 gst-inspect-1.0 查看插件信息命令

gst-inspect-1.0 qtdemux 查看qtdemux插件的信息,如下所示:

3.2 gst-launch-1.0 构建管道

播放mp4文件命令:

gst-launch-1.0 filesrc location=1.mp4 ! qtdemux ! decodebin ! videoconvert ! autovideosink

播放mp4流程为:读入mp4文件->解mp4封装->解码->视频转换->播放,命令中的filesrc 、qtdemux、 decodebin 、videoconvert 、 autovideosink插件分别对应这四个步骤,构建的管道如下图所示:

 

 

产生一个指定宽高的视频

gst-launch-1.0 videotestsrc ! "video/x-raw,width=500,height=300" ! autovideosink

 

标签:插件,1.0,gstreamer,使用,介绍,plugins,gstreamer1.0,qtdemux
来源: https://www.cnblogs.com/YYFaGe/p/14977321.html