[转]GStreamer资料(摄像头采集,视频保存,远程监控)DVR
http://blog.csdn.net/wzwxiaozheng/archive/2010/12/26/6099397.aspx
GStreamer资料整理(包括摄像头采集,视频保存,远程监控,流媒体RTP传输)
1,gstreamer开发手册,gstreamer官网(这些都不用说了吧)
2,gst-launch的用法,这也不用说了吧。(白菜,鸡蛋,西红柿,砖头,鼠标……..)
3,http://blog.chinaunix.net/u/6646/showart_164960.html
lqplayer--基于gstreamer和qt的linux下的简单播放器。
实现了基于QT+GST的一个播放器。我下载源码后编译出现了几个BUG,如下:
(1),源码编译不通过,media.cpp下有个地方大概是第54行,g_free(tag_list);,把这个地方注释掉,资源没有申请到还free,当然出错了。(此BUG花了我几十分钟的时间)
(2),界面上的按钮都不能使用,pthread_create(&tid, NULL, cb_run_loop, this);这句要注释掉,我们的主循环使用的是QT的主循环,这个就不必了吧,要不就进GST的死循环了。(这个小BUG花了我某个星期六的一个清晨)
在这里还要说一下快放和慢放的问题:
gint64 value = m_frontend->sliderTiming->value();
m_speed = m_speed+1;
gst_element_seek (m_pipeline, m_speed, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, value * GST_MSECOND*1000 ,
GST_SEEK_TYPE_SET, GST_CLOCK_TIME_NONE);
当m_speed为负值时可实现倒放,但是不稳定,仅几秒钟就会出现GST_MESSAGE_EOS。
当m_speed为负值时,我这样实现
gst_element_seek (m_pipeline, m_speed, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, GST_CLOCK_TIME_NONE ,
GST_SEEK_TYPE_SET, value * GST_MSECOND*1000);
无非就是调了个位置,效果好了许多,不妨试一下。(为啥呢,我也不知道,此BUG花了我三四天的时间)
4,http://www.pierrox.net/dvr/releases/dvr-3.99.4.tar.bz2
基于QT3的,实现了GST的采集编码,并保存为avi文件。总感觉这东西写的有些地方让人不爽,又说不出是哪里来。
5,http://blog.chinaunix.net/u3/94516/showart_2269637.html
GStreamer发送视频/音频流至服务器端并播放、保存。
Client实现了gstreamer视频文件的RTP发送,写个vlc的配置文件,使用vlc打开可以在网络上进行观看(vlc的使用和配置文件使用可以从网上搜一下,还是比较多的),效果还不错.源码实现时稍显繁琐。Decodebin的连接要注意一下。还有就是gstrtpbin的连接要仔细看一下,刚开始感觉有些麻烦,错误了好几次。后来才明了了。(此功能的源码实现花了我一整天的时间,早9-晚11)
Server端,试了,没成功,后来就没仔细看。
6,http://www.since1985i.com/tag/gstreamer
Gstreamer实现摄像头采集并显示。不过是命令行下的,相对上面RTP网络的例子来说,这个用源码实现可就是小case了吧。同样结合上面RTP传输的例子,也同样使用vlc来播放,就可以实现网络摄像头。(哇塞,网络摄像头耶!远程监控耶!摄像头采集花了我两个月的时间吧,当时还年轻,后来发现是摄像头的问题,当然,这个也算是BUG,总结经验就是十几块的摄像头是靠不住的)
总结:上面有了摄像头采集保存的例子,有利用QT+GST实现播放器的例子,有RTP传输的例子,这样就可以实现用QT做界面,Gstreamer做后台的集采集编码保存,还有本地视频回放,网络视频监控于一体的DVR软件了。嗯,功能还挺全的。有意思吧~~
结束语:向以上几位哥们儿致敬。刚开始做民工,有你们的分享我很庆幸。
==========================================================================================
==================下边这个实在看不懂 留下研究=============================================
http://blog.csdn.net/wzwxiaozheng/archive/2011/01/12/6130818.aspx
在网上闲逛搜GST,不小心发现了一个网址
http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet
是WIKI的GStreamer小抄,应该是这样翻译吧。
看了这个网址我就笑了。
上面讲了gstreamer字符叠加,画中画,屏墙等的实现,附带实现的命令,这样实现源码就小case了。
本文描述了gstreamer可实现的功能,主要是针对本硬盘录像机软件功能来说的,以gst-launch命令行的方式,简洁明了,并附有插图。大部分是网络资源,小部分是自己研究。难免有疏漏,敬请指正。
参考网址:
1,http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet#Video_Wall:_Live_from_Pluto
1,gstreamer实现摄像头采集:
2,gstreamer实现视频显示
3,gstreamer实现字符叠加
其它一些相关元件的使用: gst-launch videotestsrc ! cairotimeoverlay ! xvimagesink (未通过) gst-launch videotestsrc ! clockoverlay ! xvimagesink (通过) gst-launch videotestsrc ! clockoverlay halign=right valign=bottom shaded-background=true time-format="%Y.%m.%D" ! ffmpegcolorspace ! ximagesink (通过) gst-launch -e v4l2src ! video/x-raw-yuv,format=\(fourcc\)YUY2,width=1280,height=720,framerate=5/1 ! \ ffmpegcolorspace ! \ timeoverlay halign=right valign=top ! clockoverlay halign=left valign=top time-format="%Y/%m/%d %H:%M:%S" ! \ tee name="splitter" ! queue ! xvimagesink sync=false splitter. ! \ queue ! videorate ! video/x-raw-yuv,framerate=1/1 ! \ theoraenc bitrate=256 ! oggmux ! filesink location=webcam.ogg (未通过)
4,gstreamer实现RTP网络服务端及客户端
5,gstreamer实现视频截图
6,gstreamer实现画中画效果
gst-launch videotestsrc pattern="snow" ! video/x-raw-yuv, framerate=10/1, width=200, height=150 ! \ videomixer name=mix sink_1::xpos=20 sink_1::ypos=20 sink_1::alpha=0.5 sink_1::zorder=3 sink_2::xpos=100 sink_2::ypos=100 sink_2::zorder=2 ! \ ffmpegcolorspace ! xvimagesink videotestsrc pattern=13 ! video/x-raw-yuv, framerate=10/1, width=200, height=150 ! mix. \ videotestsrc ! video/x-raw-yuv, framerate=10/1, width=640, height=360 ! mix. 设置视频界面的位置和效果,alpha透明效果
gst-launch \ videomixer name=mix sink_1::xpos=20 sink_1::ypos=20 sink_1::alpha=0.5 sink_1::zorder=3 sink_2::xpos=100 sink_2::ypos=100 sink_2::zorder=2 ! \ ffmpegcolorspace ! xvimagesink \ videotestsrc ! video/x-raw-yuv, framerate=10/1, width=640, height=360 ! mix.sink_0 \ videotestsrc pattern="snow" ! video/x-raw-yuv, framerate=10/1, width=200, height=150 ! mix.sink_1 \ videotestsrc pattern=13 ! video/x-raw-yuv, framerate=10/1, width=200, height=150 ! mix.sink_2 (通过,效果非常好,跟图片一样)
gst-launch -e videotestsrc pattern="snow" ! video/x-raw-yuv, framerate=10/1, width=200, height=150 ! videobox border-alpha=0 top=-20 left=-25 ! \ videomixer name=mix ! ffmpegcolorspace ! xvimagesink videotestsrc ! video/x-raw-yuv, framerate=10/1, width=640, height=360 ! mix. Videobox的使用:
gst-launch -e videotestsrc pattern="snow" ! video/x-raw-yuv, framerate=10/1, width=200, height=150 ! \ videobox border-alpha=0 alpha=0.6 top=-20 left=-25 ! videomixer name=mix ! ffmpegcolorspace ! xvimagesink \ videotestsrc ! video/x-raw-yuv, framerate=10/1, width=640, height=360 ! mix. (通过) Videobox和alpha效果
gst-launch -e videotestsrc pattern="snow" ! video/x-raw-yuv, framerate=10/1, width=200, height=150 ! \ videobox border-alpha=1.0 top=-2 bottom=-2 left=-2 right=-2 ! videobox border-alpha=0 alpha=0.6 top=-20 left=-25 ! \ videomixer name=mix ! ffmpegcolorspace ! xvimagesink videotestsrc ! video/x-raw-yuv, framerate=10/1, width=640, height=360 ! mix. (通过,效果略有出入,不透明) border-alpha,加边框的透明效果
gst-launch -e videomixer name=mix ! ffmpegcolorspace ! xvimagesink \ videotestsrc pattern=1 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! videobox border-alpha=0 top=0 left=0 ! mix. \ videotestsrc pattern=15 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! videobox border-alpha=0 top=0 left=-320 ! mix. \ videotestsrc pattern=13 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! videobox border-alpha=0 top=-180 left=0 ! mix. \ videotestsrc pattern=0 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! videobox border-alpha=0 top=-180 left=-320 ! mix. \ videotestsrc pattern=3 ! video/x-raw-yuv, framerate=5/1, width=640, height=360 ! mix. (通过)
7,gstreamer实现屏墙效果
可执行的命令行:(通过,需多次执行) gst-launch -e videomixer name=mix ! ffmpegcolorspace ! ximagesink \ videotestsrc pattern=0 ! video/x-raw-yuv, framerate=10/1, width=350, height=250 ! \ textoverlay font-desc="Sans 24" text="CAM1" valign=top halign=left shaded-background=true ! \ videobox border-alpha=0 top=-200 left=-850 ! mix. \ videotestsrc pattern="snow" ! video/x-raw-yuv, framerate=10/1, width=350, height=250 ! \ textoverlay font-desc="Sans 24" text="CAM2" valign=top halign=left shaded-background=true ! \ videobox border-alpha=0 top=-200 left=-450 ! mix. \ videotestsrc pattern=13 ! video/x-raw-yuv, framerate=10/1, width=350, height=250 ! \ textoverlay font-desc="Sans 24" text="CAM3" valign=top halign=left shaded-background=true ! \ videobox border-alpha=0 top=-200 left=-50 ! mix. \ multifilesrc location="pluto.jpg" caps="image/jpeg,framerate=10/1" ! jpegdec ! \ textoverlay font-desc="Sans 26" text="Live from Pluto" halign=left shaded-background=true auto-resize=false ! \ ffmpegcolorspace ! video/x-raw-yuv ! mix.
[转]GStreamer资料(摄像头采集,视频保存,远程监控)DVR的更多相关文章
- openwrt挂载摄像头及视频保存
一.编译选项的选择: -> Utilities ->usbutils (这个里面包含lsusb的命令,是查看你的摄像头型号的) -> Kernel modules -> I2C ...
- 【ARM-Linux开发】Gstreamer+QT+摄像头 编程总结
1,gstreamer开发手册,gstreamer官网(这些都不用说了吧) 2,gst-launch的用法,这也不用说了吧.(白菜,鸡蛋,西红柿,砖头,鼠标--..) 3,http://blog.ch ...
- Android中直播视频技术探究之---摄像头Camera视频源数据采集解析
一.前言 在视频直播中一般都是两种视频数据源,一个是摄像头数据,一个是录制桌面数据,而一般来说美女妹子直播都是来自于摄像头数据,游戏直播都是录制桌面数据的,那么今天就来看看第一个数据源数据采集分析,A ...
- Android中直播视频技术探究之---采集摄像头Camera视频源数据进行推流(采用金山云SDK)
一.前言 在之前已经详细介绍了Android中的一种视频数据源:Camera,不了解的同学可以点击进入:Android中Camera使用详解 ,在这篇文章中我们介绍了如何采集摄像头的每一帧数据,然后进 ...
- luvcview,使用mplayer查看摄像头和luvcview保存YUV图像视频的播放(转)
luvcview,使用mplayer查看摄像头和luvcview保存YUV图像视频的播放 在mplayer中查看摄像头,可使用如下命令:mplayer tv:// -tv driver=v4l2:in ...
- Linux 下V4l2摄像头采集图片,实现yuyv转RGB,RGB转BMP,RGB伸缩,jpeglib 库实现压缩RGB到内存中,JPEG经UDP发送功(转)
./configure CC=arm-linux-gnueabihf-gcc LD=arm-linux-gnueabihf-ld --host=arm-linux --prefix=/usr/loca ...
- 基于opencv和mfc的摄像头采集代码(GOMFCTemplate2)
编写带界面的图像处理程序,选择opencv+mfc是一种很好的选择:在读取摄像头数据方面,网上的方法很多,其中shiqiyu的camerads的方法是较好的. 基于现有资料 ...
- 基于opencv和mfc的摄像头采集代码(GOMFCTemplate2)持续更新
编写带界面的图像处理程序,选择opencv+mfc是一种很好的选择:在读取摄像头数据方面,网上的方法很多,其中shiqiyu的camerads的方法是较好的. 基于现有资料 ...
- 利用ffmpeg一步一步编程实现摄像头采集编码推流直播系统
了解过ffmpeg的人都知道,利用ffmpeg命令即可实现将电脑中摄像头的画面发布出去,例如发布为UDP,RTP,RTMP等,甚至可以发布为HLS,将m3u8文件和视频ts片段保存至Web服务器,普通 ...
随机推荐
- 【实用】如何在windows下快速截图?
如何在windows下快速截图? 快速截图是很多人的需求.截图的工具和方案也很多,但是,这里给出一个通用的,被大众认为最高效的一个解决方案. 我们都知道键盘上有一个"prt sc" ...
- 在 RHEL/CentOS 7 上配置NTP时间服务器
一.NTP简介 网络时间协议 - NTP - 是运行在传输层 123 号端口的 UDP 协议,它允许计算机通过网络同步准确时间.随着时间的流逝,计算机内部时间会出现漂移,这会导致时间不一致问题,尤其是 ...
- php 打印debug日志
A lesser known trick is that mod_php maps stderr to the Apache log. And, there is a stream for that, ...
- 网易2016研发project师编程题
http://www.nowcoder.com/test/970447/summary [编程题] 小易的升级之路 小易常常沉迷于网络游戏.有一次,他在玩一个打怪升级的游戏,他的角色的初始能力值为 a ...
- ERROR 1130: Host '' is not allowed to connect to thisMySQL server
今天1网友求助,说自己PHPmyadmin能够正常连接数据库,使用sqlyog报错: ERROR 1130: Host '172.27.214.1' is not allowed to connect ...
- linux下软件的安装与卸载
一 软件安装包的类型 通常Linux应用软件的安装有五种: 1) tar+ gz包,如software-1.2.3-1.tar.gz.他是使用UNIX系统的打包工具tar打包的. 2) r ...
- CAS 源码编译
准备 :gradle idea 第一次用Idea 还是有点不熟悉呀,还是eclipse 顺手! 哈哈 下载源码 :我的是4.2.7 解压 导入idea 重点: 调试时候在写 .没时间
- 前端发起resultUrl请求,服务端收到后做逆向处理,校验sign后,执行originUrl逻辑
originUrl=http://test.com:8080/user/alipay_phone?uid=123&amount=21.3第0步:前后端约定32位密钥KEY第一步:对参数按照ke ...
- ECMAScript6箭头函数ArrowFunction"=>"
一.说明 ECMAScript6可以用箭头"=>"定义函数.x => x * x或(x) => {return x * x;}与匿名函数function(x){r ...
- pmd 使用笔记
pmd是一块开源的代码静态分析工具,使用java编写,可以自定义规则来进行自己想要的分析.pmd可以单独使用,也可以作为idea.eclipse的插件使用.它的规则分为xpath规则,和java规则. ...