iis网站子目录设置二级域名,可以做设计私单的网站,定制网站的制作流程,icp备案查询网GStreamer是著名的开源多媒体框架#xff0c;功能强大#xff0c;其命令行程序 gst-launch 可以实现很多常规测试、播放等#xff0c;作为系统调试等是非常方便的。1、摄像头测试gst-launch v4l2src ! xvimagesinkgst-launch v4l2src ! video/x-raw-yuv,width320,height240,…GStreamer是著名的开源多媒体框架功能强大其命令行程序 gst-launch 可以实现很多常规测试、播放等作为系统调试等是非常方便的。1、摄像头测试gst-launch v4l2src ! xvimagesinkgst-launch v4l2src ! video/x-raw-yuv,width320,height240,framerate20/1 ! xvimagesink上述命令不一定能够成功或者出现的摄像头图像窗口没有正常的图像这是因为摄像头支持的图像格式会有差别gstreamer 默认采用的格式不被支持这时可以尝试gst-launch v4l2src ! video/x-raw-yuv,format\(fourcc\)YUY2,width320,height240 ! xvimagesink基本上可以了。根据 gstreamer 的文档针对 v4l2src 这个插件能够支持的图像格式在这里有详细说明说明。这里要注意强制指定图像格式是采用 format 参数并且要用到 (fourcc) 指示字必须带有括号的但是在命令行下括号是特殊含义字符所以用 \ 反斜杠转意处理这只是一个例子说明你可以尝试确定你的摄像头到底支持哪种图像格式然后就可以用通过 format 参数来指定了。2、播放文件gst-launch playbin urifile:///path/to/test.avi据说还有 playbin2 插件采用的是新的播放解码。具体有关 gstreamer 的一些资源参考Gstreamer中一些gst-launch常用命令用Linux系统中使用gstreamer架构做对媒体开发时gst-inspect和gst-launch是两个非常使用的小工具gst-inspect在开发时用于查询库各个插件element的详细信息后者用于在终端快速构建一条pipeline用于播放多媒体。下面列出我在以前的学习和项目开发时常用的gst-launch播放各种多媒体文件的实例一、gstreamer实现视频显示gst-launch videotestsrc ! xvimagesink二、gstreamer实现摄像头采集1、可以现实图像但图像卡住不动gst-launch v4l2src ! xvimagesink2、摄像头视频显示正常gst-launch v4l2src !video/x-raw-yuv,format\(fourcc\)YUY2,width640,height480,framerate15/1 !videorate ! videoscale ! ffmpegcolorspace ! xvimagesinkgst-launch v4l2src ! video/x-raw-yuv,width640,height480,framerate15/1 !queue2 ! videorate ! videoscale ! ffmpegcolorspace ! xvimagesink三、摄像头视频现实及保存为avi格式文件gst-launch -e v4l2src !video/x-raw-yuv,format\(fourcc\)YUY2,width640,height480,framerate30/1 ! teenamesrctee \srctee. ! queue2 namesqueue ! ffmpegcolorspace ! xvimagesink \srctee. ! queue2 namefqueue ! videorate ! ffmpegcolorspace !ffenc_mpeg4 ! avimux ! filesink locationtest.avi四、将摄像头视频比例设置为169gst-launch v4l2src ! video/x-raw-yuv,width640,height480,framerate15/1 !aspectratiocrop aspect-ratio16/9 ! ffmpegcolorspace ! xvimagesink五、保存摄像头的视频为avi格式gst-launch -e v4l2src ! video/x-raw-yuv, format\(fourcc\)YUY2,framerate30/1, width640, height480 ! videorate ! ffmpegcolorspace !ffenc_mpeg4 ! avimux ! filesink locationtest.avi六、多个流数据同时录制gst-launch -e avimux namemuxer ! filesink locationmulti.avi\v4l2src ! video/x-raw-yuv, format\(fourcc\)YUY2, framerate25/1,width640, height480 ! videorate ! ffmpegcolorspace ! ffenc_mpeg4 ! queue2 !muxer. \pulsesrc ! audioconvert ! audioresample! lamemp3enc target1 bitrate64cbrtrue ! queue2 ! muxer.七、画中画1、videomixer可以将两个或多个视频流混合到一起gst-launch -e videotestsrc patternsnow ! video/x-raw-yuv,framerate10/1, width200, height150 ! videomixer namemix ! \ffmpegcolorspace ! xvimagesink videotestsrc !video/x-raw-yuv, framerate10/1, width640, height360 ! mix.2、GstVideoMixerPad能够改变Z轴和图像的位置gst-launch videotestsrc patternsnow ! video/x-raw-yuv,framerate10/1, width200, height150 ! \videomixer namemix sink_1::xpos20 sink_1::ypos20sink_1::alpha0.5 sink_1::zorder3 sink_2::xpos100 sink_2::ypos100sink_2::zorder2 ! \ffmpegcolorspace ! xvimagesink videotestsrc pattern13 !video/x-raw-yuv, framerate10/1, width200, height150 ! mix. \videotestsrc ! video/x-raw-yuv, framerate10/1, width640,height360 ! mix.3、GstVideoMixerPad可以制定每个sinkgst-launch \videomixer namemix sink_1::xpos20 sink_1::ypos20sink_1::alpha0.5 sink_1::zorder3 sink_2::xpos100 sink_2::ypos100 sink_2::zorder2! \ffmpegcolorspace ! xvimagesink \videotestsrc ! video/x-raw-yuv, framerate10/1, width640,height360 ! mix.sink_0 \videotestsrc patternsnow ! video/x-raw-yuv,framerate10/1, width200, height150 ! mix.sink_1 \videotestsrc pattern13 ! video/x-raw-yuv, framerate10/1,width200, height150 ! mix.sink_2八、VideoBox可以用来制定视频框的大小和位置和apha混合透明度等1、不透明gst-launch -e videotestsrc patternsnow ! video/x-raw-yuv,framerate10/1, width200, height150 ! videobox border-alpha0 top-100left-100 ! \videomixer namemix ! ffmpegcolorspace ! xvimagesink videotestsrc !video/x-raw-yuv, framerate10/1, width640, height360 ! mix.2、指定透明度gst-launch -e videotestsrc patternsnow ! video/x-raw-yuv,framerate10/1, width200, height150 ! \videobox border-alpha0 alpha0.6 top-20 left-25 !videomixer namemix ! ffmpegcolorspace ! xvimagesink \videotestsrc ! video/x-raw-yuv, framerate10/1, width640,height360 ! mix.3、添加边框gst-launch -e videotestsrc patternsnow ! video/x-raw-yuv,framerate10/1, width200, height150 ! \videobox border-alpha1.0 top-2 bottom-2 left-2 right-2 !videobox border-alpha0 alpha0.6 top-20 left-25 ! \videomixer namemix ! ffmpegcolorspace ! xvimagesinkvideotestsrc ! video/x-raw-yuv, framerate10/1, width640, height360 ! mix.九、VideoWall视频墙gst-launch -e videomixer namemix ! ffmpegcolorspace ! xvimagesink \videotestsrc pattern1 ! video/x-raw-yuv, framerate5/1,width320, height180 ! videobox border-alpha0 top0 left0 ! mix. \videotestsrc pattern15 ! video/x-raw-yuv, framerate5/1,width320, height180 ! videobox border-alpha0 top0 left-320 ! mix. \videotestsrc pattern13 ! video/x-raw-yuv, framerate5/1,width320, height180 ! videobox border-alpha0 top-180 left0 ! mix. \videotestsrc pattern0 ! video/x-raw-yuv, framerate5/1,width320, height180 ! videobox border-alpha0 top-180 left-320 ! mix. \videotestsrc pattern3 ! video/x-raw-yuv, framerate5/1,width640, height360 ! mix.十、TextOverlay 在视频上面添加文本由textoverlay插件实现可以设置文本的属性gst-launch videotestsrc !video/x-raw-yuv,width640,height480,framerate15/1 ! textoverlaytextHello ! ffmpegcolorspace ! ximagesink十一、TimeOverlay 由timeoverlay插件实现1、由timeoverlay插件实现gst-launch videotestsrc ! timeoverlay ! xvimagesinkgst-launch -v videotestsrc ! video/x-raw-yuv, framerate25/1, width640,height360 ! \timeoverlay halignleft valignbottom textStreamtime: shaded-backgroundtrue ! xvimagesink2、cairotimeoverlaygst-launch videotestsrc ! cairotimeoverlay ! ffmpegcolorspace xvimagesink3、clockoverlay时钟gst-launch videotestsrc ! cairotimeoverlay ! ffmpegcolorspace xvimagesinkgst-launch videotestsrc ! clockoverlay halignright valignbottomshaded-backgroundtrue time-format%Y.%m.%D ! ffmpegcolorspace !ximagesink十二、录制视频为ogg格式带时间和日期overlaygst-launch -e v4l2src ! video/x-raw-yuv, format\(fourcc\)YUY2,framerate20/1, width640, height480 ! \ffmpegcolorspace ! \timeoverlay halignright valigntop ! clockoverlayhalignleft valigntop time-format%Y/%m/%d %H:%M:%S ! \tee namesplitter ! queue2 ! xvimagesinksyncfalse splitter. ! \queue2 ! videorate ! ffmpegcolorspace ! theoraenc bitrate256! oggmux ! filesink locationwebcam.ogg十三、视频墙gst-launch videomixer namemix sink_1::xpos20 sink_1::ypos20sink_1::alpha1.0 sink_1::zorder3 sink_2::xpos40 sink_2::ypos40sink_2::zorder2 ! ffmpegcolorspace ! xvimagesink \uridecodebinurifile:///mnt/hgfs/fedshare/source/video/loveStyle.mp4 ! ffmpegcolorspace !videoscale ! mix. \uridecodebin urifile:///mnt/hgfs/fedshare/source/video/davincieffect_480p30.mp4! ffmpegcolorspace ! videoscale ! mix. \videotestsrc ! video/x-raw-yuv, framerate10/1,width800, height540 ! mix.十四、播放视频文件带声音gst-launch uridecodebinurifile:///mnt/hgfs/fedshare/source/video/loveStyle.mp4 namedecoder \decoder. ! audioconvert ! autoaudiosink \decoder. ! ffmpegcolorspace ! xvimagesink