zynq gst-launch-1.0相关

三 视频管道:

1,gst-launch-1.0:

1)RGB888显示:
gst-launch-1.0 videotestsrc pattern=1 ! video/x-raw,format=RGB,width=1920,height=1080,framerate=60/1 ! kmssink plane_id=36 render-rectangle="<0,0,1920,1080>" bus-id="a0070000.v_mix"

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw,format=RGB,width=1920,height=1080,framerate=60/1 ! kmssink plane_id=36 render-rectangle="<0,0,1920,1080>" bus-id="a0070000.v_mix"
2)gst播放图像显示:
gst-launch-1.0 filesrc location=/media/sd-mmcblk1p1/1.jpg ! jpegdec ! imagefreeze ! videoconvert ! kmssink plane_id=36 render-rectangle="<0,0,1545,842>" bus-id="a0070000.v_mix"

gst-launch-1.0 filesrc location=/media/sd-mmcblk1p1/1.jpg ! jpegdec ! videoscale ! video/x-raw,width=320,height=240 ! imagefreeze ! videoconvert ! kmssink plane_id=36 render-rectangle="<0,0,320,240>" bus-id="a0070000.v_mix"
3) 播视频:
root@zcu106_vcu_trd:~# gst-launch-1.0 uridecodebin uri="file:///media/card/bbb_sunflower_1080p_60fps_normal_avc.mp4" ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix"
4) hdmi rx显示到tx:
modetest  -D a0070000.v_mix  -s 43:1920x1080-60@AR24
modetest -D a0070000.v_mix -s 40:1920x1080-60@BG24 &

xmedia-ctl -d /dev/media7 -V "\"a0080000.v_proc_ss\":0  [fmt:RBG888_1X24/1920x1080 field:none]"
xmedia-ctl -d /dev/media7 -V "\"a0080000.v_proc_ss\":1  [fmt:VYYUYY8_1X24/1920x1080 field:none]"

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat='NV12'

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, width=1920, height=1080, format=NV12, framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false filler-data=true latency-mode=normal ! video/x-h265, profile=main ! h265parse ! omxh265dec internal-entropy-buffers=5 latency-mode=normal ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix"
5) 从hdmi rx获取视频保存:
5-1.抓取视频并压缩成h265格式:
1080P:
xmedia-ctl -d /dev/media7 -V "\"a0080000.v_proc_ss\":0  [fmt:RBG888_1X24/1920x1080 field:none]"
xmedia-ctl -d /dev/media7 -V "\"a0080000.v_proc_ss\":1  [fmt:VYYUYY8_1X24/1920x1080 field:none]"
gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, format=NV12,width=1920,height=1080,framerate=60/1 ! omxh265enc qp-mode=auto gop-mode=basic gop-length=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=constant prefetch-buffer=true low-bandwidth=false filler-data=true latency-mode=normal ! queue ! mpegtsmux alignment=7 name=mux ! filesink location="/media/usb/test.ts"
6) 测试图像:
gst-launch-1.0 videotestsrc !  kmssink bus-id="a0070000.v_mix"
7) 设置偏移位以及图层:
gst-launch-1.0 videotestsrc pattern=3 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=60/1 ! kmssink plane_id=30 render-rectangle="<1920,0,1920,1080>" bus-id="a0070000.v_mix"
8) 冻结摄像头图像然后显示:
gst-launch-1.0 v4l2src device=/dev/video2 io-mode=2 ! video/x-raw, format=RGB,width=1920,height=1080,framerate=60/1 ! imagefreeze ! kmssink plane_id=36 render-rectangle="<0,540,960,540>" bus-id="a0070000.v_mix"
9) 特殊分辨率显示(需要添加render-rectangle配置):
gst-launch-1.0 videotestsrc pattern=1 ! video/x-raw,format=RGB,width=1440,height=1080,framerate=60/1 ! kmssink plane_id=35 render-rectangle="<0,0,1440,1080>" bus-id="a0070000.v_mix"
10)录像可播放视频:
vcu-demo-camera-encode-file.sh -v "/dev/video5" -s 1920x1080 -n 1000

root@lingmou:/media/sd-mmcblk1p1# which vcu-demo-camera-encode-file.sh 
/usr/bin/vcu-demo-camera-encode-file.sh
11)录制RGB格式时会用CPU软转换RGB->YUV420,会卡。
gst-launch-1.0 v4l2src device=/dev/video3 ! video/x-raw, format=RGB,width=1920,height=1080,framerate=60/1 ! videoconvert ! video/x-raw,format=NV12 ! omxh264enc control-rate=constant b-frames=2 gop-length=60 periodicity-idr=60 prefetch-buffer=true target-bitrate=5500 ! video/x-h264, alignment=au ! h264parse ! mpegtsmux name=mux mux. ! filesink location=videotestsrc1.mkv
12)NV16 H264编码录制视频 (需要拷贝到本地播放,不然VLC会卡)(不加绝对路径/usr/bin/gst-launch-1.0会录制失败):
#!/bin/sh
/usr/bin/gst-launch-1.0 v4l2src device=/dev/video3 io-mode=4 ! video/x-raw, format=NV16,width=1440,height=1080,framerate=60/1 ! omxh264enc qp-mode=auto gop-mode=basic gop-length=60 periodicity-idr=60 b-frames=0 target-bitrate=60000 num-slices=8 control-rate=constant prefetch-buffer=TRUE low-bandwidth=false filler-data=0 cpb-size=1000 initial-delay=500 ! queue ! mpegtsmux alignment=7 name=mux ! filesink location=test-nv16-h264.ts

相关推荐

  1. zynq gst-launch-1.0相关

    2024-04-07 19:42:01       33 阅读
  2. Android SplashActivity runs twice at launch on Android 13 API 33

    2024-04-07 19:42:01       27 阅读
  3. 12.IO相关概念

    2024-04-07 19:42:01       30 阅读
  4. 19.channel相关方法

    2024-04-07 19:42:01       32 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-07 19:42:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-07 19:42:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-04-07 19:42:01       87 阅读
  4. Python语言-面向对象

    2024-04-07 19:42:01       96 阅读

热门阅读

  1. 顺序表应用——通讯录实现

    2024-04-07 19:42:01       35 阅读
  2. 《解释器模式(极简c++)》

    2024-04-07 19:42:01       40 阅读
  3. 【Linux】常用压缩命令(八)

    2024-04-07 19:42:01       32 阅读
  4. Swagger使用配置笔记

    2024-04-07 19:42:01       41 阅读
  5. 蓝桥杯刷题 前缀和与差分-[2128]重新排序(C++)

    2024-04-07 19:42:01       36 阅读
  6. 移动端h5 js手势封装

    2024-04-07 19:42:01       41 阅读
  7. C# 索引器的范例和要点

    2024-04-07 19:42:01       47 阅读
  8. leetcode热题100.数组中的第k大的元素

    2024-04-07 19:42:01       38 阅读
  9. [leetcode] 66. 加一

    2024-04-07 19:42:01       35 阅读