• 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
  • 相关阅读:
    《算法之美》读后感
    k8s简单部署nginx
    MySQL数据库备份与还原批处理脚本
    数据结构
    批量生成图片的数据增强脚本
    嵌入式开发笔记:STM32的外设GPIO知识学习
    自动驾驶仿真:如何通过TCP方式进行VTD驾驶员仿真
    培训机构如何利用小程序提升服务质量
    Three.js做了一个网页版的我的世界
    如何实现LRU缓存淘汰算法?
  • 原文地址:https://blog.csdn.net/wowocpp/article/details/126181387