一.前提:
1.要连入相关的设备,虚拟机里的Ubuntu可在“移动设备”里查找相关设备,我浅显的觉得这个设备就是摄像头
2.在Linux上安装相关的gstreamer
3.gst-launch1.0和gst-launch0.1相比有所不同,具体区别见
GStreamer 0.10到1.0移植指南
4.注意命令格式
二.命令
1.实现测试视频显示
gst-launch-1.0 videotestsrc ! xvimagesink
- 显示图像,但图像卡住不动(我的没卡,只是有点慢而已)
gst-launch-1.0 v4l2src ! xvimagesink
- 摄像头显示正常
gst-launch-1.0 v4l2src ! video/x-raw,format=YUY2,width=640,height=480,framerate=15/1 ! queue2 ! videorate ! videoscale ! videoconvert ! xvimagesink
gst-launch-1.0 v4l2src ! video/x-raw,format=YUY2,width=640,height=480,framerate=15/1 ! videorate ! videoscale ! videoconvert ! xvimagesink
- 将摄像头比例设为16:9
gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480,framerate=15/1 ! aspectratiocrop aspect-ratio=16/9 ! videoconvert ! xvimagesink
- VideoWall视频墙
gst-launch-1.0 -e videomixer name=mix ! videoconvert ! xvimagesink videotestsrc pattern=1 ! video/x-raw,framerate=5