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

你可能感兴趣的:(linux,linux)