gst-launch-1.0

gst-launch-1.0

OV5645 测试

OV5645 的测试方法与UVC Camera的测试方法基本相同。首先确认OV5645的设备节点。
root@OK8MP:~# v4l2-ctl --list-devices
查看摄像头支持的格式与分辨率:
root@OK8MP:~# v4l2-ctl --list-formats-ext -d /dev/video0

  1. 摄像头预览
    root@OK8MP:~# gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,
    format=YUY2, width=1280, height=960,framerate=30/1 ! imxvideoconvert_g2d ! queue !
    video/x-raw, format=RGB16, width=1024, height=600 ! waylandsink

  2. 摄像头拍照:
    root@OK8MP:~# gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 num-buffers=10 !
    video/x-raw,format=YUY2,width=1280,height=960,framerate=30/1 ! jpegenc !
    filesink location=picov.jpeg

运行完之后会在当前目录下生成然picov.jpeg,拷贝到Windows下,打开此文件可以看到拍到的照片。
3. 摄像头预览时录像:
root@OK8MP:~# gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,
format=YUY2, width=1280, height=960,framerate=30/1 ! imxvideoconvert_g2d ! tee name=t !
queue ! video/x-raw, format=RGB16, width=1280, height=720 ! filesink
location=5645_video.rgb16 t. ! queue ! waylandsink

  1. 摄像头预览时视频编码H264
    root@OK8MP:~# gst-launch-1.0 -e v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,
    format=YUY2, width=1280,height=960, framerate=30/1 ! tee name=t ! queue ! vpuenc_h264 !
    queue ! h264parse ! qtmux ! filesink location=5645_h264.mp4 t. ! queue ! waylandsink
    上面这条命令会开启摄像头的预览和录像,录像文件的格式为H264.
    播放编码后的H264视频:
    root@OK8MP:~# gst-launch-1.0 filesrc location=5645_h264.mp4 ! qtdemux ! queue !
    h264parse ! vpudec ! waylandsink
  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值