|
发表于 2022-9-15 14:57:18
只看该作者
沙发
下面是系统启动的hdmi采集脚本,目前无法正确获取到device_id:
- firefly@firefly:~$ cat /usr/local/bin/test_hdmirx.sh
- #!/bin/bash
- device_id=$(v4l2-ctl --list-devices | grep -A1 hdmirx | grep -v hdmirx | awk -F ' ' '{print $NF}')
- v4l2-ctl -d $device_id --set-dv-bt-timings query
- width=$(v4l2-ctl -d $device_id --get-dv-timings | grep "Active width" |awk -F ' ' '{print $NF}')
- heigh=$(v4l2-ctl -d $device_id --get-dv-timings | grep "Active heigh" |awk -F ' ' '{print $NF}')
- trap 'onCtrlC' INT
- function onCtrlC () {
- echo 'Ctrl+C is captured'
- killall gst-launch-1.0
- exit 0
- }
- export XDG_RUNTIME_DIR=/run/user/1000
- gst-launch-1.0 alsasrc device=hw:2,0 ! audioconvert ! audioresample ! queue ! alsasink device="hw:1,0" &
- gst-launch-1.0 v4l2src device=$device_id ! queue ! video/x-raw,format=RGB ! capssetter replace = true caps="video/x-raw,format=BGR,width=$width,height=$heigh" ! glimagesink &
- echo "[Ctrl + C] exit"
- while true
- do
- sleep 10
- done
复制代码 |
|